Boost logo

Boost-Build :

From: codex653 (brandonbraun653_at_[hidden])
Date: 2019-06-04 11:31:46

Hi all,

I've become quite frustrated over the past several days, not so much of an
issue with Boost but more of a "how do I do this" kind of problem. I've
gotten nowhere after many many hours digging through the source
files, so I come to you as my last resort.

I've got this fun embedded systems personal project where I am needing to
link together a whole bunch of static libraries. One of these libraries is
for FreeRTOS. FreeRTOS has this really awesome functionality where you can
implement callbacks for certain "oops" events, like stack overflows, malloc
ran out of memory, etc. I use these heavily in my projects as great way to
get notified when I screw up. Now here's the problem:

I use FreeRTOS on a wide variety of projects where the actual function hooks
are compiled into the top level lib/exe target. Basically I want different
behavior for these hooks depending on which project is running. Sounds good
right? Not quite so...the linker gets in this loop where my top target
depends on FreeRTOS, but FreeRTOS also depends on the top level target for
the hook declarations. Ultimately I am unable to link on a Unix system
(Ubuntu specifically) due to the ordering of the libraries. This is a well
known topic about I feel.

What I am trying (and miserably failing) to do is add the -Wl,--start-group
flag /before/ all the libraries I just compiled for my project are given to
the linker. For example, if I use the <link-flags> property,
will give me this kind of output:

<my-linker-executable> -o <output-location> <list-of-all-my-libs>
-Wl,--start-group <other-linked-libs> <rest-of-link-flags> ....and so on.

What I am trying to do is this:

<my-linker-executable> -o <output-location> -Wl,--start-group
<list-of-all-my-libs> <other-linked-libs> <rest-of-link-flags> ....

I know this works because I've manually copied the failing link command,
edited it to include my start-group flag as described, and it all linked
successfully. Is there some kind of flag or modification I can do to get
this in the right location?! I'm using a custom toolchain
(gcc_arm_none_eabi) and the requisite .jam file to initialize it, which is
literally just a copy-paste of gcc.jam with the "gcc" replaced with
"gcc_arm_none_eabi". I have tried to modify the "rule link bind LIBRARIES
{}" command, but that had no effect, despite it looking very similar to the
actual link command shown in the failure message.


Sent from:

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at