diff options
author | Dan Albert <danalbert@google.com> | 2018-10-11 20:39:32 +0000 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2018-10-11 20:39:32 +0000 |
commit | 99ac6c8e89d94fc6bbdf3cb11f718f97b213b09f (patch) | |
tree | 1dfd99be77245dfbafac8621b74fd80729af8d6c /clang/lib/Driver/ToolChains/Linux.cpp | |
parent | cf41adaaa0bb0b4a156a1ce16012406d5cdc7991 (diff) | |
download | bcm5719-llvm-99ac6c8e89d94fc6bbdf3cb11f718f97b213b09f.tar.gz bcm5719-llvm-99ac6c8e89d94fc6bbdf3cb11f718f97b213b09f.zip |
[Driver] Fix --hash-style choice for Android.
Summary:
Android supports GNU style hashes as of Marshmallow, so we should be
generating both styles for pre-M targets and GNU hashes for newer
targets.
Reviewers: srhines, pirama
Reviewed By: srhines
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D53118
llvm-svn: 344293
Diffstat (limited to 'clang/lib/Driver/ToolChains/Linux.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/Linux.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp index 0db75f71f3e..fc511013cd0 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -264,15 +264,18 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) // and the MIPS ABI require .dynsym to be sorted in different ways. // .gnu.hash needs symbols to be grouped by hash code whereas the MIPS // ABI requires a mapping between the GOT and the symbol table. - // Android loader does not support .gnu.hash. + // Android loader does not support .gnu.hash until API 23. // Hexagon linker/loader does not support .gnu.hash - if (!IsMips && !IsAndroid && !IsHexagon) { + if (!IsMips && !IsHexagon) { if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsAlpineLinux() || - (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick)) + (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick) || + (IsAndroid && !Triple.isAndroidVersionLT(23))) ExtraOpts.push_back("--hash-style=gnu"); - if (Distro.IsDebian() || Distro.IsOpenSUSE() || Distro == Distro::UbuntuLucid || - Distro == Distro::UbuntuJaunty || Distro == Distro::UbuntuKarmic) + if (Distro.IsDebian() || Distro.IsOpenSUSE() || + Distro == Distro::UbuntuLucid || Distro == Distro::UbuntuJaunty || + Distro == Distro::UbuntuKarmic || + (IsAndroid && Triple.isAndroidVersionLT(23))) ExtraOpts.push_back("--hash-style=both"); } |