]> granicus.if.org Git - clang/commitdiff
Always use --eh-frame-hdr on NetBSD, even for -static.
authorJoerg Sonnenberger <joerg@bec.de>
Thu, 13 Mar 2014 00:42:01 +0000 (00:42 +0000)
committerJoerg Sonnenberger <joerg@bec.de>
Thu, 13 Mar 2014 00:42:01 +0000 (00:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203742 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/netbsd.c

index cc944885ad443f2307b2e2ce4109d4786f4e8c1a..72f781d3cff1030209447925c7cd7ef26b7532dc 100644 (file)
@@ -6326,12 +6326,12 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
   if (!D.SysRoot.empty())
     CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
 
+  CmdArgs.push_back("--eh-frame-hdr");
   if (Args.hasArg(options::OPT_static)) {
     CmdArgs.push_back("-Bstatic");
   } else {
     if (Args.hasArg(options::OPT_rdynamic))
       CmdArgs.push_back("-export-dynamic");
-    CmdArgs.push_back("--eh-frame-hdr");
     if (Args.hasArg(options::OPT_shared)) {
       CmdArgs.push_back("-Bshareable");
     } else {
index 9cece62211511d280b6eee087217826d797ed69c..b300bf457797b72f2831e94c1205281931231b64 100644 (file)
 // SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
 
 // S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
-// S-X86_64: ld{{.*}}" "-Bstatic"
+// S-X86_64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
 // S-X86_64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
 
 // S-X86_64-7: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd7.0.0"
-// S-X86_64-7: ld{{.*}}" "-Bstatic"
+// S-X86_64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-X86_64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
 // S-X86_64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
 
 // S-X86_64-6: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd6.0.0"
-// S-X86_64-6: ld{{.*}}" "-Bstatic"
+// S-X86_64-6: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-X86_64-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
 // S-X86_64-6: "-lgcc_eh" "-lc" "-lgcc"
 // S-X86_64-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
 
 // S-AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd"
-// S-AARCH64: ld{{.*}}" "-Bstatic"
+// S-AARCH64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-AARCH64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
 // S-AARCH64: "-lgcc_eh" "-lc" "-lgcc"
 // S-AARCH64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
 
 // S-AARCH64-7: clang{{.*}}" "-cc1" "-triple" "aarch64--netbsd7.0.0"
-// S-AARCH64-7: ld{{.*}}" "-Bstatic"
+// S-AARCH64-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-AARCH64-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
 // S-AARCH64-7: "-lgcc_eh" "-lc" "-lgcc"
 // S-AARCH64-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
 
 // S-ARM: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd-eabi"
-// S-ARM: ld{{.*}}" "-Bstatic"
+// S-ARM: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-ARM: "-m" "armelf_nbsd_eabi"
 // S-ARM: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
 // S-ARM: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
 
 // S-ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd7.0.0-eabi"
-// S-ARM-7: ld{{.*}}" "-Bstatic"
+// S-ARM-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-ARM-7: "-m" "armelf_nbsd_eabi"
 // S-ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
 // S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
 
 // S-ARM-6: clang{{.*}}" "-cc1" "-triple" "armv5e--netbsd6.0.0-eabi"
-// S-ARM-6: ld{{.*}}" "-Bstatic"
+// S-ARM-6: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-ARM-6: "-m" "armelf_nbsd_eabi"
 // S-ARM-6: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-ARM-6: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
 // S-ARM-6: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
 
 // S-SPARC: clang{{.*}}" "-cc1" "-triple" "sparc--netbsd"
-// S-SPARC: ld{{.*}}" "-Bstatic"
+// S-SPARC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-SPARC: "-m" "elf32_sparc"
 // S-SPARC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
 // S-SPARC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
 
 // S-SPARC64: clang{{.*}}" "-cc1" "-triple" "sparc64--netbsd"
-// S-SPARC64: ld{{.*}}" "-Bstatic"
+// S-SPARC64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
 // S-SPARC64: "-m" "elf64_sparc"
 // S-SPARC64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
 // S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"