[LLVMbugs] [Bug 12026] New: Cross-compiling clang (symlinked) calls wrong toolchain and binutils

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 17 06:17:02 PST 2012


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

             Bug #: 12026
           Summary: Cross-compiling clang (symlinked) calls wrong
                    toolchain and binutils
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: derek.buitenhuis at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


How to reproduce: 

$ uname -a
Linux bbvm 3.2.0-1-amd64 #1 SMP Fri Feb 17 05:17:36 UTC 2012 x86_64 GNU/Linux

$ ./clang -v
clang version 3.1 (trunk 150810)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ ln -s clang x86_64-w64-mingw32-clang

$ ./x86_64-w64-mingw32-clang -v
clang version 3.1 (trunk 150810)
Target: x86_64-w64-mingw32
Thread model: posix

$ echo "int main(){ return 0; }" > test.c

$ ./x86_64-w64-mingw32-clang --sysroot=/usr/x86_64-w64-mingw32/ -c test.c
/tmp/test-RhNWlU.s: Assembler messages:
/tmp/test-RhNWlU.s:1: Error: unknown pseudo-op: `.def'
/tmp/test-RhNWlU.s:2: Error: unknown pseudo-op: `.scl'
/tmp/test-RhNWlU.s:3: Error: Missing symbol name in directive
/tmp/test-RhNWlU.s:3: Error: unrecognized symbol type "32"
/tmp/test-RhNWlU.s:4: Error: unknown pseudo-op: `.endef'
clang: error: assembler (via gcc) command failed with exit code 1 (use -v to
see invocation)

n$ ./x86_64-w64-mingw32-clang --sysroot=/usr/x86_64-w64-mingw32/ -c test.c -v
clang version 3.1 (trunk 150810)
Target: x86_64-w64-mingw32
Thread model: posix
 "/home/daemon404/bin/clang2/bin/clang" -cc1 -triple x86_64-w64-mingw32 -S
-disable-free -main-file-name test.c -mrelocation-model static
-mdisable-fp-elim -mconstructor-aliases -munwind-tables -target-cpu x86-64
-momit-leaf-frame-pointer -v -coverage-file /tmp/test-paSAh2.s -resource-dir
/home/daemon404/bin/clang2/bin/../lib/clang/3.1 -isysroot
/usr/x86_64-w64-mingw32/ -fmodule-cache-path /var/tmp/clang-module-cache
-fno-dwarf-directory-asm -fdebug-compilation-dir /home/daemon404/bin/clang2/bin
-ferror-limit 19 -fmessage-length 168 -mstackrealign -fno-use-cxa-atexit
-fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/test-paSAh2.s -x c test.c
clang -cc1 version 3.1 based upon LLVM 3.1svn default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/usr/x86_64-w64-mingw32//usr/local/include"
ignoring nonexistent directory
"/usr/x86_64-w64-mingw32//home/daemon404/bin/clang2/bin/../lib/clang/3.1/../../../i686-w64-mingw32/include"
ignoring nonexistent directory
"/usr/x86_64-w64-mingw32//home/daemon404/bin/clang2/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory
"/usr/x86_64-w64-mingw32//home/daemon404/bin/clang2/bin/../lib/clang/3.1/../../../include"
ignoring nonexistent directory "/usr/x86_64-w64-mingw32//mingw/include"
ignoring nonexistent directory "c:/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/daemon404/bin/clang2/bin/../lib/clang/3.1/include
 /usr/x86_64-w64-mingw32//usr/include
End of search list.
 "/usr/bin/gcc" --sysroot=/usr/x86_64-w64-mingw32/ -v -c -m64 -o test.o -x
assembler /tmp/test-paSAh2.s
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.2-14'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin
--enable-objc-gc --with-arch-32=i586 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.2 (Debian 4.6.2-14)
COLLECT_GCC_OPTIONS='-v' '-c' '-m64' '-o' 'test.o' '-mtune=generic'
'-march=x86-64'
 as --64 -o test.o /tmp/test-paSAh2.s
/tmp/test-paSAh2.s: Assembler messages:
/tmp/test-paSAh2.s:1: Error: unknown pseudo-op: `.def'
/tmp/test-paSAh2.s:2: Error: unknown pseudo-op: `.scl'
/tmp/test-paSAh2.s:3: Error: Missing symbol name in directive
/tmp/test-paSAh2.s:3: Error: unrecognized symbol type "32"
/tmp/test-paSAh2.s:4: Error: unknown pseudo-op: `.endef'
clang: error: assembler (via gcc) command failed with exit code 1 (use -v to
see invocation)

Problem:

Despite successfully detecting that it is being run from a prefix'd location
(x86_64-w64-mingw32-clang), it does not properly call the prefixed gcc or
binutils (i.e. x86_64-w64-mingw32-gcc or x86_64-w64-mingw32-ld).

-- 
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