<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Aye aye.<div><br></div><div>-bw</div><div><br><div style=""><div>On Dec 6, 2013, at 5:22 PM, Brad Smith <<a href="mailto:brad@comstyle.com">brad@comstyle.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On 06/12/13 7:57 PM, Joerg Sonnenberger wrote:<br><blockquote type="cite">Author: joerg<br>Date: Fri Dec 6 18:57:46 2013<br>New Revision: 196630<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=196630&view=rev">http://llvm.org/viewvc/llvm-project?rev=196630&view=rev</a><br>Log:<br>Pass correct flags to assembler and linker for OpenBSD on AMD64, PowerPC<br>and MIPS64. From Brad Smith.<br><br>Modified:<br> cfe/trunk/lib/Driver/Tools.cpp<br> cfe/trunk/test/Driver/openbsd.c<br></blockquote><br>Please commit this to the 3.4 branch.<br><br><blockquote type="cite">Modified: cfe/trunk/lib/Driver/Tools.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=196630&r1=196629&r2=196630&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=196630&r1=196629&r2=196630&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>+++ cfe/trunk/lib/Driver/Tools.cpp Fri Dec 6 18:57:46 2013<br>@@ -5430,6 +5430,40 @@ void openbsd::Assemble::ConstructJob(Com<br> const char *LinkingOutput) const {<br> ArgStringList CmdArgs;<br><br>+ // When building 32-bit code on OpenBSD/amd64, we have to explicitly<br>+ // instruct as in the base system to assemble 32-bit code.<br>+ if (getToolChain().getArch() == llvm::Triple::x86)<br>+ CmdArgs.push_back("--32");<br>+ else if (getToolChain().getArch() == llvm::Triple::ppc) {<br>+ CmdArgs.push_back("-mppc");<br>+ CmdArgs.push_back("-many");<br>+ } else if (getToolChain().getArch() == llvm::Triple::mips64 ||<br>+ getToolChain().getArch() == llvm::Triple::mips64el) {<br>+ StringRef CPUName;<br>+ StringRef ABIName;<br>+ getMipsCPUAndABI(Args, getToolChain().getTriple(), CPUName, ABIName);<br>+<br>+ CmdArgs.push_back("-mabi");<br>+ CmdArgs.push_back(getGnuCompatibleMipsABIName(ABIName).data());<br>+<br>+ if (getToolChain().getArch() == llvm::Triple::mips64)<br>+ CmdArgs.push_back("-EB");<br>+ else<br>+ CmdArgs.push_back("-EL");<br>+<br>+ Arg *LastPICArg = Args.getLastArg(options::OPT_fPIC, options::OPT_fno_PIC,<br>+ options::OPT_fpic, options::OPT_fno_pic,<br>+ options::OPT_fPIE, options::OPT_fno_PIE,<br>+ options::OPT_fpie, options::OPT_fno_pie);<br>+ if (LastPICArg &&<br>+ (LastPICArg->getOption().matches(options::OPT_fPIC) ||<br>+ LastPICArg->getOption().matches(options::OPT_fpic) ||<br>+ LastPICArg->getOption().matches(options::OPT_fPIE) ||<br>+ LastPICArg->getOption().matches(options::OPT_fpie))) {<br>+ CmdArgs.push_back("-KPIC");<br>+ }<br>+ }<br>+<br> Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,<br> options::OPT_Xassembler);<br><br>@@ -5463,6 +5497,11 @@ void openbsd::Link::ConstructJob(Compila<br> // handled somewhere else.<br> Args.ClaimAllArgs(options::OPT_w);<br><br>+ if (getToolChain().getArch() == llvm::Triple::mips64)<br>+ CmdArgs.push_back("-EB");<br>+ else if (getToolChain().getArch() == llvm::Triple::mips64el)<br>+ CmdArgs.push_back("-EL");<br>+<br> if ((!Args.hasArg(options::OPT_nostdlib)) &&<br> (!Args.hasArg(options::OPT_shared))) {<br> CmdArgs.push_back("-e");<br><br>Modified: cfe/trunk/test/Driver/openbsd.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/openbsd.c?rev=196630&r1=196629&r2=196630&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/openbsd.c?rev=196630&r1=196629&r2=196630&view=diff</a><br>==============================================================================<br>--- cfe/trunk/test/Driver/openbsd.c (original)<br>+++ cfe/trunk/test/Driver/openbsd.c Fri Dec 6 18:57:46 2013<br>@@ -17,6 +17,10 @@<br> // RUN: | FileCheck --check-prefix=CHECK-LD-T %s<br> // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -Z %s -### 2>&1 \<br> // RUN: | FileCheck --check-prefix=CHECK-LD-Z %s<br>+// RUN: %clang -no-canonical-prefixes -target mips64-unknown-openbsd %s -### 2>&1 \<br>+// RUN: | FileCheck --check-prefix=CHECK-MIPS64-LD %s<br>+// RUN: %clang -no-canonical-prefixes -target mips64el-unknown-openbsd %s -### 2>&1 \<br>+// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s<br> // CHECK-LD-R: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"<br> // CHECK-LD-R: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-r" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"<br> // CHECK-LD-S: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"<br>@@ -25,3 +29,27 @@<br> // CHECK-LD-T: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-t" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"<br> // CHECK-LD-Z: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"<br> // CHECK-LD-Z: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-Z" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"<br>+// CHECK-MIPS64-LD: clang{{.*}}" "-cc1" "-triple" "mips64-unknown-openbsd"<br>+// CHECK-MIPS64-LD: ld{{.*}}" "-EB" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"<br>+// CHECK-MIPS64EL-LD: clang{{.*}}" "-cc1" "-triple" "mips64el-unknown-openbsd"<br>+// CHECK-MIPS64EL-LD: ld{{.*}}" "-EL" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o"<br>+<br>+// Check passing options to the assembler for various OpenBSD targets<br>+// RUN: %clang -target amd64-pc-openbsd -m32 -### -no-integrated-as -c %s 2>&1 \<br>+// RUN: | FileCheck -check-prefix=CHECK-AMD64-M32 %s<br>+// RUN: %clang -target powerpc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \<br>+// RUN: | FileCheck -check-prefix=CHECK-POWERPC %s<br>+// RUN: %clang -target mips64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \<br>+// RUN: | FileCheck -check-prefix=CHECK-MIPS64 %s<br>+// RUN: %clang -target mips64-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \<br>+// RUN: | FileCheck -check-prefix=CHECK-MIPS64-PIC %s<br>+// RUN: %clang -target mips64el-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \<br>+// RUN: | FileCheck -check-prefix=CHECK-MIPS64EL %s<br>+// RUN: %clang -target mips64el-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \<br>+// RUN: | FileCheck -check-prefix=CHECK-MIPS64EL-PIC %s<br>+// CHECK-AMD64-M32: as{{.*}}" "--32"<br>+// CHECK-POWERPC: as{{.*}}" "-mppc" "-many"<br>+// CHECK-MIPS64: as{{.*}}" "-mabi" "64" "-EB"<br>+// CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC"<br>+// CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL"<br>+// CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC"<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br><br></blockquote><br><br>--<span class="Apple-converted-space"> </span><br>This message has been scanned for viruses and<br>dangerous content by MailScanner, and is<br>believed to be clean.</div></blockquote></div><br></div></body></html>