[CMake] does cmake get dependencies between asm files? and when said so does it link them?

Ivan Sergio Borgonovo mail at webthatworks.it
Fri Nov 1 09:05:57 EDT 2013


On Fri, 1 Nov 2013 12:58:32 +0100
Alexander Neundorf <a.neundorf-work at gmx.net> wrote:

> On Friday 01 November 2013, Ivan Sergio Borgonovo wrote:
> > On Fri, 1 Nov 2013 11:37:10 +0100
> > 
> > Alexander Neundorf <a.neundorf-work at gmx.net> wrote:
> > > so crt0.x is the missing one, right ?
> > > Are you sure it is not compiled ?
> > 
> > Absolutely. Once I've added
> > add_dependencies(someotherasm crt0.x)
> > crt0.x got compiled BUT not linked.
> 
> Very strange.
> I'll see whether I can reproduce this.

If it was supposed to work right out of the box without fiddling with
it I'll try to add some more details and a bunch code sample.
All the code involved is part of atmel asf[1]
The 2 files involved are trampoline.x and crt0.x.

crt0.x define _stext

  .global _stext
  .type _stext, @function
_stext:


and trampoline.x uses it

lda.w   pc, _stext

I've a
add_library(crt0 crt0.x)
and a
target_link_libraries(... crt0)

But without some help[2] crt0 doesn't get compiled and linked

[1] I'm working on an older version then the one available on atmel
site but I think you can get the idea

[2]
add_dependencies(trampoline crt0.x)
make it compile
set_property(TARGET SAM3 APPEND PROPERTY LINK_LIBRARIES crt0)
make it link

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it



More information about the CMake mailing list