aboutsummaryrefslogtreecommitdiffstats
path: root/main/llvm/clang-3.6-musl-use-init-array.patch
blob: ae632aabf9685145770b29d41a34f08043e6cd70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index f789fd5..6d75b4b 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -2080,13 +2085,14 @@ void Generic_ELF::addClangTargetOptions(const ArgList &DriverArgs,
   const Generic_GCC::GCCVersion &V = GCCInstallation.getVersion();
   bool UseInitArrayDefault =
       getTriple().getArch() == llvm::Triple::aarch64 ||
       getTriple().getArch() == llvm::Triple::aarch64_be ||
       (getTriple().getOS() == llvm::Triple::Linux &&
        (!V.isOlderThan(4, 7, 0) ||
-        getTriple().getEnvironment() == llvm::Triple::Android));
+        getTriple().getEnvironment() == llvm::Triple::Android ||
+        getTriple().getEnvironment() == llvm::Triple::Musl));

   if (DriverArgs.hasFlag(options::OPT_fuse_init_array,
                          options::OPT_fno_use_init_array,
                          UseInitArrayDefault))
     CC1Args.push_back("-fuse-init-array");
 }