diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2015-02-24 18:23:53 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2015-02-24 18:23:53 +0800 |
commit | 3e71beb97ae6f5c83c478c4166dfffbc4c0dfe3c (patch) | |
tree | 835af0eb8fb1663fb102ecd103d7dfada3924ef8 /build | |
parent | 81696d2de5b29f6c3c160b4c949c48e0002559d2 (diff) | |
download | ndk-3e71beb97ae6f5c83c478c4166dfffbc4c0dfe3c.tar.gz |
Enable ld.gold for aarch64
Also compile all ld.gold with --enable-threads which adds two
options
--threads Run the linker multi-threaded
--no-threads Do not run the linker multi-threaded [default]
Change-Id: I6fd6fc9715e87bfa4984d9fad45b17dfd3198e4f
Diffstat (limited to 'build')
-rwxr-xr-x | build/tools/build-gcc.sh | 21 | ||||
-rw-r--r-- | build/tools/dev-defaults.sh | 2 | ||||
-rw-r--r-- | build/tools/prebuilt-common.sh | 1 |
3 files changed, 18 insertions, 6 deletions
diff --git a/build/tools/build-gcc.sh b/build/tools/build-gcc.sh index 79e1df6db..52b89eff3 100755 --- a/build/tools/build-gcc.sh +++ b/build/tools/build-gcc.sh @@ -326,15 +326,20 @@ esac # Disable libsanitizer (which depends on libstdc++ built separately) for now EXTRA_CONFIG_FLAGS=$EXTRA_CONFIG_FLAGS" --disable-libsanitizer" -# Enable Gold as default +# Enable Gold case "$TOOLCHAIN" in - # Note that only ARM and X86 >= GCC 4.6 are supported + # Note that only ARM/X86 >= GCC 4.6 and AARCH64 >= GCC 4.9 are supported mips*) ;; *-4.4.3) ;; + aarch64*) + # Enable ld.gold but ld.bfd remain the default + EXTRA_CONFIG_FLAGS=$EXTRA_CONFIG_FLAGS" --enable-gold --enable-ld=default --enable-threads" + ;; *) - EXTRA_CONFIG_FLAGS=$EXTRA_CONFIG_FLAGS" --enable-gold=default" + # Enable ld.gold as default + EXTRA_CONFIG_FLAGS=$EXTRA_CONFIG_FLAGS" --enable-gold=default --enable-threads" ;; esac @@ -648,7 +653,15 @@ do_relink_bin () { do_relink_bin c++ g++ do_relink_bin gcc-$GCC_VERSION gcc # symlink ld to either ld.gold or ld.bfd -do_relink_bin ld ld.gold ld.bfd +case "$TOOLCHAIN" in + aarch64*) + # Don't make ld.gold as default for now because it's new + do_relink_bin ld ld.bfd ld.gold + ;; + *) + do_relink_bin ld ld.gold ld.bfd + ;; +esac # copy SOURCES file if present if [ -f "$SRC_DIR/SOURCES" ]; then diff --git a/build/tools/dev-defaults.sh b/build/tools/dev-defaults.sh index 4e348a516..b849743fb 100644 --- a/build/tools/dev-defaults.sh +++ b/build/tools/dev-defaults.sh @@ -269,7 +269,7 @@ get_toolchain_name_list_for_arch () get_default_binutils_version_for_gcc () { case $1 in - mips*) echo "2.25";; + mips*|aarch64*) echo "2.25";; *-4.6) echo "2.21";; *-4.4.3) echo "2.19";; x86*-4.7) echo "2.23";; # Use 2.23 to get x32 support in ld.gold diff --git a/build/tools/prebuilt-common.sh b/build/tools/prebuilt-common.sh index 90ef1e210..2ce2958af 100644 --- a/build/tools/prebuilt-common.sh +++ b/build/tools/prebuilt-common.sh @@ -1093,7 +1093,6 @@ parse_toolchain_name () ABI="arm64-v8a" ABI_CONFIGURE_TARGET="aarch64-linux-android" # Note: --disable-gold because gold doesn't support aarch64 yet - ABI_CONFIGURE_EXTRA_FLAGS="--disable-gold" ;; x86-*) ARCH="x86" |