Skip to content

Commit d39d4d0

Browse files
George Wrightcommit-bot@chromium.org
authored andcommitted
Revert "Add an --os=fuchsia option to build.py:"
This reverts commit 4ce18ab. Reason for revert: bad merge, caused build breakages in flutter/engine Original change's description: > Add an --os=fuchsia option to build.py: > > tools/build.py --os=fuchsia runtime create_sdk > > This is analogous to --os=android. It cross compiles from Linux x64 to > Fuchsia. > > A lot of the build rules are just slightly different between the existing > Fuchsia build rules used by Flutter, and the ones added by GN SDK. For > example "$fuchsia_sdk_root/pkg:fdio" is now "$fuchsia_sdk_root/pkg/fdio". > So to support this I had to add a new variable, using_fuchsia_gn_sdk, > analogous to using_fuchsia_sdk. Flutter will need to set this to false. > > Change-Id: Ief275d65f30a42a801607de93cf2d27a1fe825dd > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150689 > Reviewed-by: Ryan Macnak <[email protected]> > Commit-Queue: Liam Appelbe <[email protected]> [email protected],[email protected],[email protected],[email protected],[email protected] Change-Id: If01ee34eba906c55f2d56ba650748a86e81e701c No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151321 Auto-Submit: George Wright <[email protected]> Commit-Queue: Liam Appelbe <[email protected]> Reviewed-by: Liam Appelbe <[email protected]>
1 parent 047f172 commit d39d4d0

File tree

16 files changed

+32
-309
lines changed

16 files changed

+32
-309
lines changed

DEPS

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -470,17 +470,6 @@ deps = {
470470
"dep_type": "cipd",
471471
},
472472

473-
Var("dart_root") + "/third_party/fuchsia/sdk/linux": {
474-
"packages": [
475-
{
476-
"package": "fuchsia/sdk/gn/linux-amd64",
477-
"version": "git_revision:8d5242d4f6ff8b7634b492700e60b0fd09abefa3"
478-
}
479-
],
480-
"condition": 'host_os == "linux" and host_cpu == "x64"',
481-
"dep_type": "cipd",
482-
},
483-
484473
Var("dart_root") + "/pkg/front_end/test/fasta/types/benchmark_data": {
485474
"packages": [
486475
{

build/config/BUILDCONFIG.gn

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,6 @@ if (current_os == "win") {
196196
is_nacl = false
197197
is_posix = true
198198
is_win = false
199-
} else if (current_os == "fuchsia") {
200-
is_android = false
201-
is_chromeos = false
202-
is_fuchsia = true
203-
is_ios = false
204-
is_linux = false
205-
is_mac = false
206-
is_nacl = false
207-
is_posix = true
208-
is_win = false
209199
}
210200

211201
# =============================================================================
@@ -394,11 +384,6 @@ if (is_win) {
394384
} else if (is_mac) {
395385
host_toolchain = "//build/toolchain/mac:clang_x64"
396386
set_default_toolchain(host_toolchain)
397-
} else if (is_fuchsia) {
398-
assert(host_os == "linux")
399-
assert(host_cpu == "x64")
400-
host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
401-
set_default_toolchain("//build/toolchain/fuchsia")
402387
}
403388

404389
# ==============================================================================

build/config/compiler/BUILD.gn

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ config("compiler") {
243243
# 3. When using the sanitizers.
244244
# Otherwise there is a performance hit, in particular on ia32.
245245
if (is_android || is_asan || is_lsan || is_msan || is_tsan || is_ubsan ||
246-
(is_linux && current_cpu != "x86") || is_fuchsia) {
246+
(is_linux && current_cpu != "x86")) {
247247
cflags += [ "-fPIC" ]
248248
ldflags += [ "-fPIC" ]
249249
}
@@ -276,8 +276,6 @@ config("compiler") {
276276
if (is_win) {
277277
# Up-to-date toolchain MSVC doesn't support c++11 flag any longer.
278278
cc_std = [ "/std:c++14" ]
279-
} else if (is_fuchsia) {
280-
cc_std = [ "-std=c++17" ]
281279
} else {
282280
cc_std = [ "-std=c++11" ]
283281
}

build/fuchsia/sdk.gni

Lines changed: 0 additions & 10 deletions
This file was deleted.

build/toolchain/fuchsia/BUILD.gn

Lines changed: 0 additions & 164 deletions
This file was deleted.

runtime/BUILD.gn

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ config("dart_config") {
136136
}
137137

138138
if (is_fuchsia) {
139-
if (using_fuchsia_gn_sdk) {
140-
lib_dirs = [ "../out/DebugFuchsiaX64/lib" ]
141-
}
142-
if (using_fuchsia_gn_sdk || using_fuchsia_sdk) {
139+
if (using_fuchsia_sdk) {
143140
# TODO(chinmaygarde): Currenty these targets need to be build in the
144141
# Fuchsia tree as well as outside it using the SDK. However, not all
145142
# Fuchsia features are available in the SDK. As these features are added,
@@ -226,12 +223,7 @@ library_for_all_configs("libdart") {
226223
defines = [ "DART_ENABLE_WASM" ]
227224
}
228225
if (is_fuchsia) {
229-
if (using_fuchsia_gn_sdk) {
230-
extra_deps += [
231-
"$fuchsia_sdk_root/pkg/fdio",
232-
"$fuchsia_sdk_root/pkg/trace-engine",
233-
]
234-
} else if (using_fuchsia_sdk) {
226+
if (using_fuchsia_sdk) {
235227
extra_deps += [
236228
"$fuchsia_sdk_root/pkg:fdio",
237229
"$fuchsia_sdk_root/pkg:trace-engine",

runtime/bin/BUILD.gn

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ template("build_libdart_builtin") {
4242
public_configs = [ ":libdart_builtin_config" ]
4343
deps = []
4444
if (is_fuchsia) {
45-
if (using_fuchsia_gn_sdk) {
46-
public_deps = [ "$fuchsia_sdk_root/pkg/fdio" ]
47-
} else if (using_fuchsia_sdk) {
45+
if (using_fuchsia_sdk) {
4846
public_deps = [ "$fuchsia_sdk_root/pkg:fdio" ]
4947
} else {
5048
public_deps = [ "//zircon/public/lib/fdio" ]
@@ -320,13 +318,7 @@ template("build_gen_snapshot_dart_io") {
320318
deps = []
321319

322320
if (is_fuchsia) {
323-
if (using_fuchsia_gn_sdk) {
324-
deps += [
325-
"$fuchsia_sdk_root/fidl/fuchsia.netstack",
326-
"$fuchsia_sdk_root/pkg/sys_cpp",
327-
]
328-
public_deps = [ "$fuchsia_sdk_root/pkg/fdio" ]
329-
} else if (using_fuchsia_sdk) {
321+
if (using_fuchsia_sdk) {
330322
deps += [
331323
"$fuchsia_sdk_root/fidl:fuchsia.netstack",
332324
"$fuchsia_sdk_root/pkg:sys_cpp",
@@ -462,13 +454,7 @@ template("dart_io") {
462454
deps += [ "//third_party/boringssl" ]
463455

464456
if (is_fuchsia) {
465-
if (using_fuchsia_gn_sdk) {
466-
deps += [
467-
"$fuchsia_sdk_root/fidl/fuchsia.netstack",
468-
"$fuchsia_sdk_root/pkg/sys_cpp",
469-
]
470-
public_deps = [ "$fuchsia_sdk_root/pkg/fdio" ]
471-
} else if (using_fuchsia_sdk) {
457+
if (using_fuchsia_sdk) {
472458
deps += [
473459
"$fuchsia_sdk_root/fidl:fuchsia.netstack",
474460
"$fuchsia_sdk_root/pkg:sys_cpp",
@@ -802,9 +788,7 @@ template("dart_executable") {
802788
# have them. They are needed for running Fuchsia binaries built for the
803789
# host.
804790
if (is_linux) {
805-
# TODO(liama): Commenting this line out because it causes problems for
806-
# --os=fuchsia. If no one complains, remove it.
807-
# configs += [ "../../build/config/gcc:executable_ldconfig" ]
791+
configs += [ "../../build/config/gcc:executable_ldconfig" ]
808792
} else if (is_mac) {
809793
configs += [ "../../build/config/mac:mac_dynamic_flags" ]
810794
}
@@ -1028,11 +1012,7 @@ executable("run_vm_tests") {
10281012
}
10291013

10301014
if (is_fuchsia) {
1031-
if (using_fuchsia_gn_sdk) {
1032-
include_dirs += [ "$fuchsia_sdk_path/pkg/trace-engine/include" ]
1033-
libs = [ "zircon" ]
1034-
}
1035-
if (!using_fuchsia_gn_sdk && !using_fuchsia_sdk) {
1015+
if (!using_fuchsia_sdk) {
10361016
deps += [ "//zircon/system/ulib/trace" ]
10371017
}
10381018
}

runtime/bin/process_fuchsia.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -744,20 +744,16 @@ class ProcessStarter {
744744
}
745745
actions[3] = {
746746
.action = FDIO_SPAWN_ACTION_SET_NAME,
747-
.name = {
748-
.data = program_arguments_[0],
749-
},
747+
.name.data = program_arguments_[0],
750748
};
751749

752750
// Then fill in the namespace actions.
753751
if (ns != nullptr) {
754752
for (size_t i = 0; i < flat_ns->count; i++) {
755753
actions[fixed_actions_cnt + i] = {
756754
.action = FDIO_SPAWN_ACTION_ADD_NS_ENTRY,
757-
.ns = {
758-
.prefix = flat_ns->path[i],
759-
.handle = flat_ns->handle[i],
760-
},
755+
.ns.prefix = flat_ns->path[i],
756+
.ns.handle = flat_ns->handle[i],
761757
};
762758
}
763759
free(flat_ns);

runtime/bin/snapshot_utils.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ static AppSnapshot* TryReadAppSnapshotElf(
201201
*isolate_data_buffer = nullptr,
202202
*isolate_instructions_buffer = nullptr;
203203
Dart_LoadedElf* handle = nullptr;
204-
#if !defined(HOST_OS_FUCHSIA)
205204
if (force_load_elf_from_memory) {
206-
#endif
207205
File* const file =
208206
File::Open(/*namespc=*/nullptr, script_name, File::kRead);
209207
if (file == nullptr) return nullptr;
@@ -218,13 +216,11 @@ static AppSnapshot* TryReadAppSnapshotElf(
218216
&isolate_data_buffer, &isolate_instructions_buffer);
219217
delete memory;
220218
file->Release();
221-
#if !defined(HOST_OS_FUCHSIA)
222219
} else {
223220
handle = Dart_LoadELF(script_name, file_offset, &error, &vm_data_buffer,
224221
&vm_instructions_buffer, &isolate_data_buffer,
225222
&isolate_instructions_buffer);
226223
}
227-
#endif
228224
if (handle == nullptr) {
229225
Syslog::PrintErr("Loading failed: %s\n", error);
230226
return nullptr;

runtime/platform/BUILD.gn

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ library_for_all_configs("libdart_platform") {
1717
extra_deps = []
1818

1919
if (is_fuchsia) {
20-
if (using_fuchsia_gn_sdk) {
21-
extra_deps += [ "$fuchsia_sdk_root/pkg/sys_cpp" ]
22-
} else if (using_fuchsia_sdk) {
20+
if (using_fuchsia_sdk) {
2321
extra_deps += [ "$fuchsia_sdk_root/pkg:sys_cpp" ]
2422
} else {
2523
extra_deps += [ "//sdk/lib/sys/cpp" ]

0 commit comments

Comments
 (0)