[LLVMbugs] [Bug 7856] New: -m32 broken on FreeBSD.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 9 17:58:57 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7856

           Summary: -m32 broken on FreeBSD.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: pawel.worach at gmail.com
                CC: llvmbugs at cs.uiuc.edu


This is how as and ld should be called:
$ /usr/local/clang+llvm-2.7-amd64-freebsd8/bin/clang -### -m32 a.c
clang version 1.1 (branches/release_27)
Target: i386-unknown-freebsd8.0
Thread model: posix
 "/usr/local/clang+llvm-2.7-amd64-freebsd8/bin/clang" "-cc1" "-triple"
"i386-unknown-freebsd8.0" "-S" "-disable-free" "-main-file-name" "a.c"
"-mrelocation-model" "static" "-mdisable-fp-elim" "-mconstructor-aliases"
"-target-cpu" "pentium4" "-resource-dir"
"/usr/local/clang+llvm-2.7-amd64-freebsd8/lib/clang/1.1" "-fmessage-length"
"80" "-fgnu-runtime" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-o"
"/tmp/cc-1caNk8.s" "-x" "c" "a.c"
 "/usr/bin/as" "--32" "-o" "/tmp/cc-JNwsqV.o" "/tmp/cc-1caNk8.s"
 "/usr/bin/ld" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "-m"
"elf_i386_fbsd" "-o" "a.out" "/usr/lib32/crt1.o" "/usr/lib32/crti.o"
"/usr/lib32/crtbegin.o" "/tmp/cc-JNwsqV.o" "-lgcc" "--as-needed" "-lgcc_s"
"--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed"
"/usr/lib32/crtend.o" "/usr/lib32/crtn.o"

This is what happens somewhere after r110006-110096 (probably r110025):
$ clang -### -m32 a.c 
clang version 2.8 (trunk 110620)
Target: x86_64-unknown-freebsd8.1
Thread model: posix
 "/usr/opt/llvm/bin/clang" "-cc1" "-triple" "x86_64-unknown-freebsd8.1" "-S"
"-disable-free" "-main-file-name" "a.c" "-mrelocation-model" "static"
"-mdisable-fp-elim" "-mconstructor-aliases" "-munwind-tables" "-target-cpu"
"x86-64" "-resource-dir" "/usr/opt/llvm/lib/clang/2.8" "-ferror-limit" "19"
"-fmessage-length" "80" "-fgnu-runtime" "-fdiagnostics-show-option"
"-fcolor-diagnostics" "-o" "/tmp/cc-oeEs98.s" "-x" "c" "a.c"
 "/usr/bin/as" "-o" "/tmp/cc-HD6JcU.o" "/tmp/cc-oeEs98.s"
 "/usr/bin/ld" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "-o"
"a.out" "/usr/lib/crt1.o" "/usr/lib/crti.o" "/usr/lib/crtbegin.o"
"/tmp/cc-HD6JcU.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc"
"/usr/lib/crtend.o" "/usr/lib/crtn.o"

Adding -ccc-host-triple i386-unknown-freebsd8.1 fixes target-cpu for -cc1 and
the --32 argument to as but ld still uses lib instead of lib32 and misses the
-m argument.

Also:
$  clang -m32 -c a.c 
clang: warning: argument unused during compilation: '-m32'

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list