Wanted to bring this up for discussion on dev@ list. This is a hack to have these symbols included. We think we ran into this error because of linker ordering issues: testutil was always after the other packages, but when we added util, and tests on the util package, we finally had a package that included testutil, that was after it in the linker order. This meant the linker discarded these symbols, before seeing that they were being used.
We should pass the linker the resolve circular dependencies option on sim in order to avoid this specific issues. However, I think we also should look at having a special section in our linker files, for symbols that we always want included that isn't .data? That way you're not required to assign these variables at compile time in order to have them used. Thoughts? On Tue, Nov 10, 2015 at 6:45 PM, <[email protected]> wrote: > ensure that tu_suite_name and tu_suite_faiiled don't get removed by linker. > > > Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo > Commit: > http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/2a061408 > Tree: > http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/2a061408 > Diff: > http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/2a061408 > > Branch: refs/heads/master > Commit: 2a06140858a145fe1e1ea46e930990e8d288d8f7 > Parents: 8895970 > Author: Sterling Hughes <[email protected]> > Authored: Tue Nov 10 18:43:52 2015 -0800 > Committer: Sterling Hughes <[email protected]> > Committed: Tue Nov 10 18:45:26 2015 -0800 > > ---------------------------------------------------------------------- > libs/testutil/src/suite.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > ---------------------------------------------------------------------- > > > http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/2a061408/libs/testutil/src/suite.c > ---------------------------------------------------------------------- > diff --git a/libs/testutil/src/suite.c b/libs/testutil/src/suite.c > index b6decb0..a6f2126 100644 > --- a/libs/testutil/src/suite.c > +++ b/libs/testutil/src/suite.c > @@ -18,8 +18,8 @@ > #include "testutil/testutil.h" > #include "testutil_priv.h" > > -const char *tu_suite_name; > -int tu_suite_failed; > +const char *tu_suite_name = 0; > +int tu_suite_failed = 0; > > static void > tu_suite_set_name(const char *name) >
