Attention is currently required from: laforge. pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-remsim/+/39020?usp=email )
Change subject: Makefile:am: Improve formatting and order of CFLAGS and LIBS ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: > Let me have a deeper look, maybe I did it the wrong way. It seems in general the linker searches from left to right, and notes unresolved symbols as it goes. So libs should be placed so that the library that needs symbols must be first, then the library that resolves the symbol. This is actually more important for static libraries than shared libraries, see: https://praveenv253.github.io/logs/2014/03/15/log-message-1.html https://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc Some distros like debian and ubuntu started passing -Wl,--as-needed by default, which then require the object files to be passed before the libraries. According to https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed "Importance of linking order" this is not much of a problem with autoamke since we properly use LDADD instead of LDFLAGS. See also: https://wiki.ubuntu.com/OneiricOcelot/ReleaseNotes#GCC_4.6_Toolchain https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-Wl.2C--as-needed https://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries So I think the problem is actually those places where we pass .o objects in LDADD. There, we need to put the .o files first, and then the libraries in the order mentioned above. I think it's good to always follow the same order always everywhere to avoid potential problems though. -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/39020?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: Ia766a09103d2216258a83cc98899e6cae4b0351d Gerrit-Change-Number: 39020 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <[email protected]> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <[email protected]> Gerrit-Attention: laforge <[email protected]> Gerrit-Comment-Date: Wed, 04 Dec 2024 16:33:03 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <[email protected]> Comment-In-Reply-To: pespin <[email protected]>
