[CMake] assembler with non standard extension with gcc compiler

Alexander Neundorf a.neundorf-work at gmx.net
Fri Nov 1 06:37:10 EDT 2013


On Thursday 31 October 2013, Ivan Sergio Borgonovo wrote:
> On Thu, 31 Oct 2013 21:17:11 +0100
> 
> Alexander Neundorf <a.neundorf-work at gmx.net> wrote:
> > On Thursday 31 October 2013, Ivan Sergio Borgonovo wrote:
> > > On Thu, 31 Oct 2013 18:01:29 +0100
> > > 
> > > Alexander Neundorf <a.neundorf-work at gmx.net> wrote:
> > > > Did you try setting the source file property "LANGUAGE" to "ASM"
> > > > for these files ?
> > > > http://www.cmake.org/cmake/help/v2.8.12/cmake.html#prop_sf:LANGUAGE
> > > 
> > > Thanks, that made the trick but I ran into another problem:
> > > 
> > > One of those asm file is somehow being ignored by cmake.
> > > 
> > > I can find the right commands greping in the build dir but they are
> > 
> > > not executed during make:
> > can you post a bit more from your cmake files, or maybe a complete
> > minimal example ?
> 
> It was automatically generated by a python script.
> The schema is:
> 
> main CMakeLists.txt
> 
> [list of include_directories()]
> 
> [list of add_subdirectory()]
> 
> add_executable(project main.c)
> 
> target_link_libraries(project [list of targets])
> 
> In each dir I've a CMakeLists.txt consisting of:
> 
> add_library(target STATIC source)
> # for asm source only:
> set_source_files_properties(source PROPERTIES LANGUAGE ASM)
> SET_TARGET_PROPERTIES(target PROPERTIES LINKER_LANGUAGE ASM)
> 
> All asm files get compiled and linked with the exception of one.
> 
> The only difference I can spot is that others contains global symbols
> that are referenced in C files[1] or in the linker options[2] while the
> only one that doesn't get compiled and linked contains symbols that are
> referenced just in another ASM file[3].


so crt0.x is the missing one, right ?
Are you sure it is not compiled ?
(let's just use "compile" although an assembler file is not actually 
"compiled")

Or is just the symbol missing when linking ?

If crt0.x is listed as a source file, I see no reason why this one file should 
not be compiled.

I would guess that it is compiled, but the object file is not included by the 
linker because nobody else references anything from it.

Can you post the complete linker command ?

Alex


More information about the CMake mailing list