[LLVMbugs] [Bug 20042] New: Driver program ignores *link_libgcc option in spec file
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sat Jun 14 15:57:33 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=20042
Bug ID: 20042
Summary: Driver program ignores *link_libgcc option in spec
file
Product: clang
Version: 3.4
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Driver
Assignee: unassignedclangbugs at nondot.org
Reporter: sstewartgallus00 at mylangara.bc.ca
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 12659
--> http://llvm.org/bugs/attachment.cgi?id=12659&action=edit
Spec file
Arguable, it's silly to expect compatibility between GCC and Clang when working
at such a low level but it might be useful to add this feature.
I'm trying to cross compile sources on Linux to Windows and want to link with
the correct startup and exit files.
To do so, I put the following option in my spec file:
*link_libgcc:
-L/usr/lib/gcc/i686-w64-mingw32/4.6
This should link with the Mingw startup and exit files but Clang ignores this
option.
The full script and spec file I use to compile is attached.
The error is as follows:
> i686-w64-mingw32-clang -v ~/mine/documents/public/programming/snippets/hello_world/hello.c
clang version 3.4 (tags/RELEASE_34/final)
Target: i686-w64-mingw32
Thread model: posix
Found candidate GCC installation:
/home/sstewartgallus/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.9.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6.3
Found candidate GCC installation: /usr/lib/gcc/i686-w64-mingw32/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.5.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-w64-mingw32/4.6
Selected GCC installation: /usr/lib/gcc/i686-w64-mingw32/4.6
"/home/sstewartgallus/local/bin/clang" -cc1 -triple i686-w64-mingw32 -emit-obj
-mrelax-all -disable-free -main-file-name hello.c -mrelocation-model static
-mdisable-fp-elim -fmath-errno -mconstructor-aliases -target-cpu pentium4
-target-linker-version 2.22 -v -resource-dir
/home/sstewartgallus/local/bin/../lib/clang/3.4 -D gnu_scanf=__scanf__ -D
gnu_printf=__printf__ -I /usr/i686-w64-mingw32/include
-I/home/sstewartgallus/local/include -fdebug-compilation-dir
/home/sstewartgallus/mine/documents/public/programming/snippets/scripts
-ferror-limit 19 -fmessage-length 98 -mstackrealign -fno-use-cxa-atexit
-fobjc-runtime=gcc -fdiagnostics-show-option -vectorize-slp -o
/tmp/hello-043a92.o -x c
/home/sstewartgallus/mine/documents/public/programming/snippets/hello_world/hello.c
clang -cc1 version 3.4 based upon LLVM 3.4 default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory
"/home/sstewartgallus/local/bin/../lib/clang/3.4/../../../i686-w64-mingw32/include"
ignoring nonexistent directory
"/home/sstewartgallus/local/bin/../lib/clang/3.4/../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
ignoring duplicate directory "/home/sstewartgallus/local/include"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
/usr/i686-w64-mingw32/include
/usr/local/include
/home/sstewartgallus/local/bin/../lib/clang/3.4/include
/home/sstewartgallus/local/include
/usr/include
End of search list.
/home/sstewartgallus/mine/documents/public/programming/snippets/hello_world/hello.c:131:2:
warning:
No method of setting the process not dumpable is defined for this
platform [-W#warnings]
#warning No method of setting the process not dumpable is defined for this
platform
^
1 warning generated.
"/home/sstewartgallus/local/bin/gcc"
-specs=/home/sstewartgallus/mine/documents/public/programming/snippets/scripts/i686-w64-mingw32.spec
-I /usr/i686-w64-mingw32/include -D gnu_scanf=__scanf__ -D
gnu_printf=__printf__ -fno-builtin-_setjmp -v -m32 -o a.out /tmp/hello-043a92.o
Using built-in specs.
Reading specs from
/home/sstewartgallus/mine/documents/public/programming/snippets/scripts/i686-w64-mingw32.spec
COLLECT_GCC=/home/sstewartgallus/local/bin/gcc
COLLECT_LTO_WRAPPER=/home/sstewartgallus/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/sstewartgallus/others/src/gcc-4.9.0/configure
--disable-multilib
Thread model: posix
gcc version 4.9.0 (GCC)
COMPILER_PATH=/home/sstewartgallus/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/:/home/sstewartgallus/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/:/home/sstewartgallus/local/libexec/gcc/x86_64-unknown-linux-gnu/:/home/sstewartgallus/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/:/home/sstewartgallus/local/lib/gcc/x86_64-unknown-linux-gnu/
LIBRARY_PATH=/home/sstewartgallus/local/lib/../lib/:/home/sstewartgallus/.cabal/lib/../lib/:/home/sstewartgallus/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/:/home/sstewartgallus/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/home/sstewartgallus/local/lib/:/home/sstewartgallus/.cabal/lib/:/home/sstewartgallus/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-specs=/home/sstewartgallus/mine/documents/public/programming/snippets/scripts/i686-w64-mingw32.spec'
'-I' '/usr/i686-w64-mingw32/include' '-D' 'gnu_scanf=__scanf__' '-D'
'gnu_printf=__printf__' '-fno-builtin-_setjmp' '-v' '-m32' '-o' 'a.out'
'-mtune=generic' '-march=x86-64'
i686-w64-mingw32-ld -m i386pe -Bdynamic -o a.out crt2.o
/home/sstewartgallus/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/crtbegin.o
-L/usr/lib/gcc/i686-w64-mingw32/4.6 /tmp/hello-043a92.o -lmingw32 -lgcc_eh
-lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32
-lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt
/home/sstewartgallus/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/crtend.o
i686-w64-mingw32-ld: cannot find crt2.o: No such file or directory
/home/sstewartgallus/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/crtbegin.o:
file not recognized: File format not recognized
clang: error: linker (via gcc) command failed with exit code 1 (use -v to see
invocation)
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140614/4e2602b5/attachment.html>
More information about the llvm-bugs
mailing list