svadev AT lists.siebelschool.illinois.edu
Subject: Svadev mailing list
List archive
Re: [svadev] clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
Chronological Thread
- From: John Criswell <jtcriswel AT gmail.com>
- To: Stefan.Scheruebl AT continental-corporation.com, svadev AT cs.uiuc.edu
- Subject: Re: [svadev] clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
- Date: Tue, 25 Nov 2014 09:34:14 -0500
- List-archive: <http://lists.cs.uiuc.edu/pipermail/svadev/>
- List-id: <svadev.cs.uiuc.edu>
Dear Stefan,
Hello *, If you want to look into why the Clang driver is calling GCC to link files together on Cygwin, I recommend looking at the file safecode/tools/clang/lib/Driver/Tools.cpp. This is the file where the Clang driver figures out which programs to run on each platform to compile and link programs. It typically re-executes clang (with the -cc1 option) to compile files and the ld program to link files. However, it appears that, on Cygwin, it is calling GCC to link files together. I would start by looking at gcc::Common::ConstructJob as that might be the default for when Clang doesn't know what else to do. However, I haven't looked at the issue thoroughly, so this is an educated guess. Regards, John Criswell On 11/10/14, 5:05 AM, Stefan.Scheruebl AT continental-corporation.com wrote: after compiling clang/safecode in cygwin (installed in home/uid04950/WORK/LLVM_INSTALL) I tried to compile the test program: #include "stdio.h" #include "stdlib.h" int main (void) { printf("Hallo Welt"); } $ echo $PATH /home/uid04950/WORK/LLVM_INSTALL/bin:/usr/local/bin:/usr/bin Compile command: clang -v -g -fmemsafety -integrated-as testcode.c -I/home/uid04950/WORK/LLVM_INSTALL/include -L/home/uid04950/WORK/LLVM_INSTALL/lib Result: clang version 3.2 (: http://llvm.org/svn/llvm-project/safecode/branches/release_32/tools/clang) (llvm/branches/release_32 ^/llvm/branches/release_32 212254) Target: i386-pc-cygwin Thread model: posix "/home/uid04950/WORK/LLVM_INSTALL/bin/clang" -cc1 -triple i386-pc-cygwin -emit-obj -mrelax-all -disable-free -main-file-name testcode.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.24.51.20140703 -momit-leaf-frame-pointer -v -g -resource-dir /home/uid04950/WORK/LLVM_INSTALL/bin/../lib/clang/3.2 -I /home/uid04950/WORK/LLVM_INSTALL/include -fmodule-cache-path /var/tmp/clang-module-cache -fdebug-compilation-dir /home/uid04950/WORK/LLVM_INSTALL -ferror-limit 19 -fmessage-length 0 -fmemsafety -mstackrealign -fno-use-cxa-atexit -fobjc-runtime=gcc -fdiagnostics-show-option -o /tmp/testcode-mlPHEr.o -x c testcode.c clang -cc1 version 3.2 based upon LLVM 3.2svn default target i386-pc-cygwin ignoring nonexistent directory "/usr/local/include" #include "..." search starts here: #include <...> search starts here: /home/uid04950/WORK/LLVM_INSTALL/include /home/uid04950/WORK/LLVM_INSTALL/bin/../lib/clang/3.2/include /usr/include/w32api /usr/include End of search list. "/usr/bin/gcc" -v -g -fmemsafety -I /home/uid04950/WORK/LLVM_INSTALL/include -L/home/uid04950/WORK/LLVM_INSTALL/lib -m32 -o a.out /tmp/testcode-mlPHEr.o Es werden eingebaute Spezifikationen verwendet. COLLECT_GCC=/usr/bin/gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.8.3/lto-wrapper.exe gcc: Fehler: nicht erkannte Kommandozeilenoption »-fmemsafety« Ziel: i686-pc-cygwin Konfiguriert mit: /cygdrive/i/szsz/tmpp/gcc4/gcc-4.8.3-2.i686/src/gcc-4.8.3/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc4/gcc-4.8.3-2.i686/src/gcc-4.8.3 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --disable-__cxa_atexit --with-dwarf2 --with-arch=i686 --with-tune=generic --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --enable-libada --enable-libjava --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --libexecdir=/usr/lib Thread-Modell: posix gcc-Version 4.8.3 (GCC) clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation) Because of the linker issue I tried to get an object file and link it afterwards manually: clang -c -v -g -fmemsafety -integrated-as testcode.c -I/home/uid04950/WORK/LLVM_INSTALL/include -L/home/uid04950/WORK/LLVM_INSTALL/lib Result: clang version 3.2 (: http://llvm.org/svn/llvm-project/safecode/branches/release_32/tools/clang) (llvm/branches/release_32 ^/llvm/branches/release_32 212254) Target: i386-pc-cygwin Thread model: posix clang: warning: argument unused during compilation: '-L/home/uid04950/WORK/LLVM_INSTALL/lib' "/home/uid04950/WORK/LLVM_INSTALL/bin/clang" -cc1 -triple i386-pc-cygwin -emit-obj -mrelax-all -disable-free -main-file-name testcode.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.24.51.20140703 -momit-leaf-frame-pointer -v -g -coverage-file /home/uid04950/WORK/LLVM_INSTALL/testcode.o -resource-dir /home/uid04950/WORK/LLVM_INSTALL/bin/../lib/clang/3.2 -I /home/uid04950/WORK/LLVM_INSTALL/include -fmodule-cache-path /var/tmp/clang-module-cache -fdebug-compilation-dir /home/uid04950/WORK/LLVM_INSTALL -ferror-limit 19 -fmessage-length 0 -fmemsafety -mstackrealign -fno-use-cxa-atexit -fobjc-runtime=gcc -fdiagnostics-show-option -o testcode.o -x c testcode.c clang -cc1 version 3.2 based upon LLVM 3.2svn default target i386-pc-cygwin ignoring nonexistent directory "/usr/local/include" #include "..." search starts here: #include <...> search starts here: /home/uid04950/WORK/LLVM_INSTALL/include /home/uid04950/WORK/LLVM_INSTALL/bin/../lib/clang/3.2/include /usr/include/w32api /usr/include End of search list. LINK command: gcc.exe -v testcode.o -L/home/uid04950/WORK/LLVM_INSTALL/lib Result: Es werden eingebaute Spezifikationen verwendet. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.8.3/lto-wrapper.exe Ziel: i686-pc-cygwin Konfiguriert mit: /cygdrive/i/szsz/tmpp/gcc4/gcc-4.8.3-2.i686/src/gcc-4.8.3/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc4/gcc-4.8.3-2.i686/src/gcc-4.8.3 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --disable-__cxa_atexit --with-dwarf2 --with-arch=i686 --with-tune=generic --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --enable-libada --enable-libjava --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --libexecdir=/usr/lib Thread-Modell: posix gcc-Version 4.8.3 (GCC) COMPILER_PATH=/usr/lib/gcc/i686-pc-cygwin/4.8.3/:/usr/lib/gcc/i686-pc-cygwin/4.8.3/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.8.3/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/bin/ LIBRARY_PATH=/usr/lib/gcc/i686-pc-cygwin/4.8.3/:/usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/lib/:/usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-L/home/uid04950/WORK/LLVM_INSTALL/lib' '-mtune=generic' '-march=i686' /usr/lib/gcc/i686-pc-cygwin/4.8.3/collect2.exe --wrap _Znwj --wrap _Znaj --wrap _ZdlPv --wrap _ZdaPv --wrap _ZnwjRKSt9nothrow_t --wrap _ZnajRKSt9nothrow_t --wrap _ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t -Bdynamic --dll-search-prefix=cyg --large-address-aware --tsaware /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../crt0.o /usr/lib/gcc/i686-pc-cygwin/4.8.3/crtbegin.o -L/home/uid04950/WORK/LLVM_INSTALL/lib -L/usr/lib/gcc/i686-pc-cygwin/4.8.3 -L/usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../../i686-pc-cygwin/lib -L/usr/lib/gcc/i686-pc-cygwin/4.8.3/../../.. testcode.o -lgcc_s -lgcc -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 -lgcc_s -lgcc /usr/lib/gcc/i686-pc-cygwin/4.8.3/../../../default-manifest.o /usr/lib/gcc/i686-pc-cygwin/4.8.3/crtend.o testcode.o:(.text+0x75): undefined reference to `boundscheckui_debug' testcode.o:(.text+0xca): undefined reference to `poolcheckui_debug' testcode.o:(.text+0x180): undefined reference to `pool_register_stack_debug' testcode.o:(.text+0x1f1): undefined reference to `fastlscheck_debug' testcode.o:(.text+0x29d): undefined reference to `pool_register_stack_debug' testcode.o:(.text+0x32e): undefined reference to `exactcheck2_debug' testcode.o:(.text+0x361): undefined reference to `__sc_fsparameter' testcode.o:(.text+0x3b6): undefined reference to `__sc_fscallinfo_debug' testcode.o:(.text+0x3c6): undefined reference to `pool_printf' testcode.o:(.text+0x413): undefined reference to `pool_unregister_stack_debug' testcode.o:(.text+0x45f): undefined reference to `pool_unregister_stack_debug' testcode.o:(.text+0x4a0): undefined reference to `pool_register_global' testcode.o:(.text+0x4de): undefined reference to `pool_init_runtime' collect2: Fehler: ld gab 1 als Ende-Status zurück $ nm lib/*.a|grep boundscheckui_debug 00000517 T _bb_boundscheckui_debug 00000623 T _boundscheckui_debug 000012b0 T _boundscheckui_debug $ find -name RuntimeChecks.cpp ./projects/safecode/old_runtime/BBRuntime/RuntimeChecks.cpp ./projects/safecode/old_runtime/DebugRuntime/RuntimeChecks.cpp ./projects/safecode/runtime/BBRuntime/RuntimeChecks.cpp ./projects/safecode/runtime/DebugRuntime/RuntimeChecks.cpp It seems that the linker does not get any information about the functions above which should be found in home/uid04950/WORK/LLVM_INSTALL/lib I think this problem is related with the safecode stuff but I don't what exactly is the root case for this behaviour. Does anybody has an idea about the root case or how to solve this issue? Stefan _______________________________________________ svadev mailing list svadev AT cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/svadev -- John Criswell Assistant Professor Department of Computer Science, University of Rochester http://www.cs.rochester.edu/u/criswell |
- [svadev] clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation), Stefan . Scheruebl, 11/10/2014
- Re: [svadev] clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation), Jonas Wagner, 11/18/2014
- [svadev] Antwort: Re: clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation), Stefan . Scheruebl, 11/18/2014
- Re: [svadev] clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation), Jonas Wagner, 11/21/2014
- [svadev] Antwort: Re: Re: clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation), Stefan . Scheruebl, 11/25/2014
- Re: [svadev] clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation), Jonas Wagner, 11/21/2014
- [svadev] Antwort: Re: clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation), Stefan . Scheruebl, 11/18/2014
- Re: [svadev] clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation), John Criswell, 11/25/2014
- Re: [svadev] clang: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation), Jonas Wagner, 11/18/2014
Archive powered by MHonArc 2.6.16.