[CMake] set custom linker in linux

Yngve Inntjore Levinsen yngve.levinsen at gmail.com
Fri Jun 24 04:00:21 EDT 2011


Ah, that's a different problem. I believe you need to write a specific toolchain file in your case, since your compiler creates binaries which does not work on your own platform (?).
See e.g. here:
http://www.cmake.org/pipermail/cmake/2008-July/022868.html

Others might want to correct me if I'm wrong..

Cheers,
Yngve

 Fredag 24 juni 2011 09.51.14 skrev gekso :
> Doesn't work.. What I have is:
> 
> # export CC=i686-android-linux-gcc
> # export CXX=i686-android-linux-gcc
> 
> << skipped long paths to compiler >>
> 
>  The C compiler  "....i686-android-linux-gcc"  is not able to compile a
> simple test program.
>   It fails with the following output:  Change Dir: .../CMakeFiles/CMakeTmp
> 
>    Run Build Command:/usr/bin/make "cmTryCompileExec/fast"
> 
>  /usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
>  CMakeFiles/cmTryCompileExec.dir/build
> 
>  make[1]: Entering directory  `....CMakeFiles/CMakeTmp'
>  ..../cmake-2.8.4/bin/cmake -E  cmake_progress_report
>  ..../CMakeFiles/CMakeTmp/CMakeFiles  1
> 
>   Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o
>    .../i686-android-linux-gcc -o
> CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o
> -c.../CMakeFiles/CMakeTmp/testCCompiler.c
> 
>   Linking C executable cmTryCompileExec
>   ..../cmake-2.8.4/bin/cmake -E  cmake_link_script
> CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
>     .../i686-android-linux-gcc
>  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o cmTryCompileExec
>  -rdynamic
> 
> .../i686-android-linux-4.4.3/bin/../lib/gcc/i686-android-linux/4.4.3/../../../../i686-android-linux/bin/ld:
>  crt1.o: No such file: No such file or directory
>   collect2: ld returned 1 exit status
> 
> May be I can add -lc to linker command line?
> 
> 2011/6/23 Yngve Inntjore Levinsen <yngve.levinsen at gmail.com>:
> > Torsdag 23 juni 2011 13.34.24 skrev gekso :
> >
> >> Hello! Please, help to to set custom linker. I use gcc1/g++1 instead
> >
> >> of basic gcc/g++ on system.
> >
> >> I've tried to export CC/CXX, but I need to change linker from "ld" to
> >
> >> "g++1". Is it possible?
> >
> >> _______________________________________________
> >
> >> Powered by www.kitware.com
> >
> >>
> >
> >> Visit other Kitware open-source projects at
> >> http://www.kitware.com/opensource/opensource.html
> >
> >>
> >
> >> Please keep messages on-topic and check the CMake FAQ at:
> >> http://www.cmake.org/Wiki/CMake_FAQ
> >
> >>
> >
> >> Follow this link to subscribe/unsubscribe:
> >
> >> http://www.cmake.org/mailman/listinfo/cmake
> >
> >>
> >
> > Hi,
> >
> > Try:
> > set(CMAKE_LINKER g++1)
> >
> > I think it should work (or something similar), but haven't tested..
> >
> > Cheers,
> >
> > Yngve
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/listinfo/cmake
> >
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110624/07c81f29/attachment.htm>


More information about the CMake mailing list