Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
Google Inc.
Jim Simon <[email protected]>
The Fuchsia Authors
Hidenori Matsubayashi <[email protected]>
8 changes: 6 additions & 2 deletions build/config/sysroot.gni
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ if (current_toolchain == default_toolchain && target_sysroot != "") {
} else if (is_linux && !is_chromeos) {
if (current_cpu == "mipsel") {
sysroot = rebase_path("//mipsel-sysroot/sysroot")
} else if (use_default_linux_sysroot && !is_fuchsia && current_cpu == "x64") {
sysroot = rebase_path("//build/linux/debian_sid_amd64-sysroot")
} else if (use_default_linux_sysroot && !is_fuchsia) {
if (current_cpu == "x64") {
sysroot = rebase_path("//build/linux/debian_sid_amd64-sysroot")
} else {
sysroot = rebase_path("//build/linux/debian_sid_arm64-sysroot")
}
assert(
exec_script("//build/dir_exists.py", [ sysroot ], "string") == "True",
"Missing sysroot ($sysroot). To fix, run: build/linux/sysroot_scripts/install-sysroot.py --arch=$current_cpu")
Expand Down
2 changes: 1 addition & 1 deletion build/toolchain/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ gcc_toolchain("clang_arm64") {
nm = "nm"
ar = "ar"
ld = cxx
strip = "strip"
strip = "${compiler_prefix}$prefix/llvm-strip"
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g Sep 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed? Also, what are the implications for x64 for changing from strip to llvm-strip?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your response.

Why is this needed?

This is to fix the following error. We have to use the binaries under buildtools/linux-x64/clang/bin/. I think that originally wrong. dart-sdk is helpful. I guess it's better to modify readelf, nm, and ar as well...

[4439/6380] LINK ./font-subset
FAILED: font-subset exe.unstripped/font-subset
../../buildtools/linux-x64/clang/bin/clang++ -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -pthread --target=aarch64-linux-gnu --sysroot=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot -L/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/local/lib/aarch64-linux-gnu\ -Wl,-rpath-link=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/local/lib/aarch64-linux-gnu\ -L/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/lib/aarch64-linux-gnu\ -Wl,-rpath-link=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/lib/aarch64-linux-gnu\ -L/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/lib/aarch64-linux-gnu\ -Wl,-rpath-link=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/lib/aarch64-linux-gnu -Wl,-O2 -Wl,--gc-sections -Wl,--as-needed -Wl,-rpath=\$ORIGIN/ -Wl,-rpath-link= -Wl,--disable-new-dtags  -o ./exe.unstripped/font-subset -Wl,--build-id=sha1 -Wl,--start-group @./font-subset.rsp  -Wl,--end-group  -ldl  && strip --strip-unneeded -o ./font-subset ./exe.unstripped/font-subset
strip: Unable to recognise the format of the input file `./exe.unstripped/font-subset'
[4444/6380] LINK ./dart_precompiled_runtime_product
FAILED: dart_precompiled_runtime_product exe.unstripped/dart_precompiled_runtime_product
../../buildtools/linux-x64/clang/bin/clang++ -rdynamic -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -pthread --target=aarch64-linux-gnu --sysroot=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot -L/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/local/lib/aarch64-linux-gnu\ -Wl,-rpath-link=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/local/lib/aarch64-linux-gnu\ -L/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/lib/aarch64-linux-gnu\ -Wl,-rpath-link=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/lib/aarch64-linux-gnu\ -L/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/lib/aarch64-linux-gnu\ -Wl,-rpath-link=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/lib/aarch64-linux-gnu -Wl,-O2 -Wl,--gc-sections -Wl,--as-needed -Wl,-rpath=\$ORIGIN/ -Wl,-rpath-link= -Wl,--disable-new-dtags  -o ./exe.unstripped/dart_precompiled_runtime_product -Wl,--build-id=sha1 -Wl,--start-group @./dart_precompiled_runtime_product.rsp  -Wl,--end-group  -ldl -lpthread  && strip --strip-unneeded -o ./dart_precompiled_runtime_product ./exe.unstripped/dart_precompiled_runtime_product
strip: Unable to recognise the format of the input file `./exe.unstripped/dart_precompiled_runtime_product'
[4446/6380] LINK ./gen_snapshot_product
FAILED: gen_snapshot_product exe.unstripped/gen_snapshot_product
../../buildtools/linux-x64/clang/bin/clang++ -rdynamic -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro -Wl,-z,defs -pthread --target=aarch64-linux-gnu --sysroot=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot -L/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/local/lib/aarch64-linux-gnu\ -Wl,-rpath-link=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/local/lib/aarch64-linux-gnu\ -L/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/lib/aarch64-linux-gnu\ -Wl,-rpath-link=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/lib/aarch64-linux-gnu\ -L/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/lib/aarch64-linux-gnu\ -Wl,-rpath-link=/root/flutter_work/build_engine/src/build/linux/debian_sid_arm64-sysroot/usr/lib/aarch64-linux-gnu -Wl,-O2 -Wl,--gc-sections -Wl,--as-needed -Wl,-rpath=\$ORIGIN/ -Wl,-rpath-link= -Wl,--disable-new-dtags  -o ./exe.unstripped/gen_snapshot_product -Wl,--build-id=sha1 -Wl,--start-group @./gen_snapshot_product.rsp  -Wl,--end-group  -ldl -lpthread  && strip --strip-unneeded -o ./gen_snapshot_product ./exe.unstripped/gen_snapshot_product
strip: Unable to recognise the format of the input file `./exe.unstripped/gen_snapshot_product'
[4452/6380] CXX clang_x64/obj/third_party/dart/runtime/lib/libdart_lib_jit.ffi_dynamic_library.o
ninja: build stopped: subcommand failed.

Also, what are the implications for x64 for changing from string to llvm-strip?

No implications for x64 because clang_x64 is used for self-building for x64, and the commands installed on a Host are used.

cc_toolchain("clang_x64") {
  if (use_clang_type_profiler) {
    prefix = rebase_path("//third_party/llvm-allocated-type/Linux_x64/bin",
                         root_build_dir)
  } else {
    prefix = rebase_path("//buildtools/linux-x64/clang/bin", root_build_dir)
  }
  cc = "${compiler_prefix}$prefix/clang"
  cxx = "${compiler_prefix}$prefix/clang++"

  readelf = "readelf"
  nm = "nm"
  ar = "ar"
  ld = cxx
  strip = "strip"

  toolchain_cpu = "x64"
  toolchain_os = "linux"
  is_clang = true
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No implications for x64 because clang_x64 is used for self-building for x64

Sorry, I didn't expand the context to see that it was in an arm-specific path.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dart-sdk is helpful

Interestingly they don't seem to use llvm-strip though; they just do prefixing in that file. Do you know why it's different?

Copy link
Member Author

@HidenoriMatsubayashi HidenoriMatsubayashi Sep 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartmorgan

Thank you so much.

First of all, strip command is for x86_64. So, we should use another command for ARM64. dart-sdk uses llvm-objcopy. (source code)

I should have used llvm_objcopy. In addition, "build / toolchain / gcc_toolchain.gni" needed to be modified.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified it to use llvm_objcopy for now.

Copy link
Member Author

@HidenoriMatsubayashi HidenoriMatsubayashi Sep 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartmorgan

I fixed. Could you review the source code when you have time?


toolchain_cpu = "arm64"
toolchain_os = "linux"
Expand Down