[CMake] Linker Flags

Reinhard Thies Reinhard.Thies at web.de
Wed Nov 24 06:05:49 EST 2010


Hi all,

i am trying to crosscompile one of my projects. Iam using some linker flags 
for that:

SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m5307 -Wl,-elf2flt -Os 
-lc")                            

The following link command will be generated, but I need the -lc option at the 
end of the line.

/usr/bin/cmake -E cmake_link_script CMakeFiles/ethgate.dir/link.txt --
verbose=1                                
/usr/local/bin/m68k-elf-gcc     -m5307 -Wl,-elf2flt -Os -lc 
CMakeFiles/ethgate.dir/src/ethgate.c.o 
CMakeFiles/ethgate.dir/src/serveritf.c.o 
CMakeFiles/ethgate.dir/src/ident_service.c.o 
CMakeFiles/ethgate.dir/src/dbgitf.c.o CMakeFiles/ethgate.dir/src/debug.c.o  -o 
ethgate -rdynamic

This command works but the above one doesn't.

/usr/local/bin/m68k-elf-gcc     -m5307 -Wl,-elf2flt -Os 
CMakeFiles/ethgate.dir/src/ethgate.c.o 
CMakeFiles/ethgate.dir/src/serveritf.c.o 
CMakeFiles/ethgate.dir/src/ident_service.c.o 
CMakeFiles/ethgate.dir/src/dbgitf.c.o CMakeFiles/ethgate.dir/src/debug.c.o  -o 
ethgate -lc

So what do I have to change to get that command. And how can I remove -
rdynamic ?

Many thanks for any help.

-- 
Danke & Gruss
Reinhard


More information about the CMake mailing list