Issues with Static Libraries and gcc-arm-none-eabi Compiler #12300
-
Hello all! I am having an issue that's been driving me absolutely insane the last couple days. In fact, so much so that I made an entire example repo just for it here: I describe the issue in detail in the repo, but a summary here:
My eyes are bleeding from looking at As an aside, I don't necessarily care about making the HAL a static library, but this is the one sticking point I've had with meson I would love to get resolved. Since many open source projects using meson distribute themselves as a static library, figuring this out would unlock a lot. For instance, unity has meson support, but currently because of whatever is going on it fails spectacularly when run on target. I had to make the same hack (ditch static library, include the sources in a dependency manually) to get it running. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Haven't had a chance to fully look over your example yet, but have some experience with cross-compiling for embedded targets in a similar fashion. In your cross-file, are you setting |
Beta Was this translation helpful? Give feedback.
-
For anyone who stumbles upon this with a similar issue, what ended up being my issue (not an issue w/ Meson):
|
Beta Was this translation helpful? Give feedback.
Closing this because I've confirmed it's not a Meson specific issue, but just an issue I need to figure out w/ the
arm-none-eabi
compiler in regards to static libraries. Turns out the way I was compiling w/ CMake (usingPUBLIC
for my static library sources) was "sidestepping" the issue by still manually linking in the individual source object files into my final.elf
. Changing mytarget_sources
call to use thePRIVATE
keyword produces the same behavior (and an identical.map
file) as the behavior with Meson.