forked from OSchip/llvm-project
Now that PIC generation on PPC32 is supported, hook up linking support
for NetBSD. llvm-svn: 213972
This commit is contained in:
parent
f6be4cb4cb
commit
c888757a2d
|
@ -2665,12 +2665,13 @@ NetBSD::GetCXXStdlibType(const ArgList &Args) const {
|
|||
|
||||
unsigned Major, Minor, Micro;
|
||||
getTriple().getOSVersion(Major, Minor, Micro);
|
||||
if (Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 40) || Major == 0) {
|
||||
if (Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 49) || Major == 0) {
|
||||
switch (getArch()) {
|
||||
case llvm::Triple::arm:
|
||||
case llvm::Triple::armeb:
|
||||
case llvm::Triple::thumb:
|
||||
case llvm::Triple::thumbeb:
|
||||
case llvm::Triple::ppc:
|
||||
case llvm::Triple::x86:
|
||||
case llvm::Triple::x86_64:
|
||||
return ToolChain::CST_Libcxx;
|
||||
|
|
|
@ -6897,12 +6897,13 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
unsigned Major, Minor, Micro;
|
||||
getToolChain().getTriple().getOSVersion(Major, Minor, Micro);
|
||||
bool useLibgcc = true;
|
||||
if (Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 40) || Major == 0) {
|
||||
if (Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 49) || Major == 0) {
|
||||
switch(getToolChain().getArch()) {
|
||||
case llvm::Triple::arm:
|
||||
case llvm::Triple::armeb:
|
||||
case llvm::Triple::thumb:
|
||||
case llvm::Triple::thumbeb:
|
||||
case llvm::Triple::ppc:
|
||||
case llvm::Triple::x86:
|
||||
case llvm::Triple::x86_64:
|
||||
useLibgcc = false;
|
||||
|
|
|
@ -43,6 +43,9 @@
|
|||
// RUN: %clang -no-canonical-prefixes -target sparc64--netbsd \
|
||||
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=SPARC64 %s
|
||||
// RUN: %clang -no-canonical-prefixes -target powerpc--netbsd \
|
||||
// RUN: -no-integrated-as --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=POWERPC %s
|
||||
|
||||
// RUN: %clang -no-canonical-prefixes -target x86_64--netbsd -static \
|
||||
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
|
||||
|
@ -80,6 +83,9 @@
|
|||
// RUN: %clang -no-canonical-prefixes -target sparc64--netbsd -static \
|
||||
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=S-SPARC64 %s
|
||||
// RUN: %clang -no-canonical-prefixes -target powerpc--netbsd -static \
|
||||
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=S-POWERPC %s
|
||||
|
||||
// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
|
||||
// X86_64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
|
||||
|
@ -190,6 +196,13 @@
|
|||
// SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
|
||||
// SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
|
||||
|
||||
// POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd"
|
||||
// POWERPC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
|
||||
// POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
|
||||
// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
|
||||
// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
|
||||
// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
|
||||
|
||||
// S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
|
||||
// S-X86_64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
|
||||
// S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
|
||||
|
@ -278,3 +291,10 @@
|
|||
// S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
|
||||
// S-SPARC64: "-lgcc_eh" "-lc" "-lgcc"
|
||||
// S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
|
||||
|
||||
// S-POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd"
|
||||
// S-POWERPC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
|
||||
// S-POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
|
||||
// S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
|
||||
// S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc"
|
||||
// S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
// RUN: %clangxx -no-canonical-prefixes -target sparc64--netbsd \
|
||||
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=SPARC64 %s
|
||||
// RUN: %clangxx -no-canonical-prefixes -target powerpc--netbsd \
|
||||
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=POWERPC %s
|
||||
|
||||
// RUN: %clangxx -no-canonical-prefixes -target x86_64--netbsd -static \
|
||||
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
|
||||
|
@ -65,6 +68,9 @@
|
|||
// RUN: %clangxx -no-canonical-prefixes -target sparc64--netbsd -static \
|
||||
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=S-SPARC64 %s
|
||||
// RUN: %clangxx -no-canonical-prefixes -target powerpc--netbsd -static \
|
||||
// RUN: --sysroot=%S/Inputs/basic_netbsd_tree %s -### 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=S-POWERPC %s
|
||||
|
||||
// X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
|
||||
// X86_64: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
|
||||
|
@ -141,6 +147,13 @@
|
|||
// SPARC64: "-lm" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
|
||||
// SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
|
||||
|
||||
// POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd"
|
||||
// POWERPC: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
|
||||
// POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
|
||||
// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
|
||||
// POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
|
||||
// POWERPC: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
|
||||
|
||||
// S-X86_64: clang{{.*}}" "-cc1" "-triple" "x86_64--netbsd"
|
||||
// S-X86_64: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
|
||||
// S-X86_64: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}crti.o"
|
||||
|
@ -215,3 +228,10 @@
|
|||
// S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lstdc++"
|
||||
// S-SPARC64: "-lm" "-lc" "-lgcc_eh" "-lc" "-lgcc"
|
||||
// S-SPARC64: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
|
||||
|
||||
// S-POWERPC: clang{{.*}}" "-cc1" "-triple" "powerpc--netbsd"
|
||||
// S-POWERPC: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
|
||||
// S-POWERPC: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o"
|
||||
// S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crti.o"
|
||||
// S-POWERPC: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++"
|
||||
// S-POWERPC: "-lm" "-lc" "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
|
||||
|
|
Loading…
Reference in New Issue