Attention is currently required from: neels, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-pfcp/+/31741 )
Change subject: build: fix linking gen__pfcp_ies_auto to use build-tree libosmo-gtlv ......................................................................
Patch Set 3:
(1 comment)
File src/libosmo-pfcp/Makefile.am:
https://gerrit.osmocom.org/c/libosmo-pfcp/+/31741/comment/a1d54c06_39d8ed10 PS1, Line 68: gen__pfcp_ies_auto_LDFLAGS
I presume LDFLAGS and LDADD are the same thing, one replaces the earlier LDFLAGS and the other doesn't replace but just append?
No, these are different things. The `LDFLAGS` is for stuff like: `-Wl,--wrap=foo`, `-version-info`, `-no-undefined`, `-no-install`, etc. The `LDADD` is for libraries. As I said above, the key difference is that the `LDFLAGS` appears first in the linker's command line, while the `LDADD` appears last.
Since AM_LDFLAGS include LIBOSMOCORE_LIBS, then the local lib is appended by LDADD after libosmocore, which then fails. By using LDFLAGS, not LDADD, the order is being fixed, because no other libs are listed before libosmo-gtlv.a.
`AM_LDFLAGS` shall never contain `*_LIBS`, since it ends up first in the linker's command line. The actual fix is to not have `*_LIBS` in `AM_LDFLAGS`.