[1/3] build: resolve link failure in libosmogsm when --disable-talloc is used
diff mbox

Message ID 1412333824-18594-2-git-send-email-jengelh@inai.de
State Superseded
Headers show

Commit Message

Jan Engelhardt Oct. 3, 2014, 10:57 a.m. UTC
libosmogsm.so:lapd-core.c uses talloc_free unconditionally (like
libosmocore), but in the absence of the builtin talloc, does not link
to libtalloc.so (like libosmocore would). This causes linker failures
when programs using libosmogsm are being built. Correct this issue.

	   CCLD     osmo-arfcn
	../src/gsm/.libs/libosmogsm.so: undefined reference to `talloc_free'
	collect2: error: ld returned 1 exit status
	make[2]: *** [osmo-arfcn] Error 1
---
 src/gsm/Makefile.am | 3 +++
 1 file changed, 3 insertions(+)

Comments

Holger Freyther Oct. 3, 2014, 11:04 a.m. UTC | #1
On Fri, Oct 03, 2014 at 12:57:02PM +0200, Jan Engelhardt wrote:

Hi!

> +if !ENABLE_TALLOC
> +libosmogsm_la_LIBADD += -ltalloc
> +endif

please see my other mail. You assume that a libtalloc exists on the
system and that it is found in the library search paths. This is
not an improvement, it is a change that breaks in different ways for
different people.

As in 02.2013 and as of today. I really appreciate your work but I
can't take this patch.

holger
>
Jan Engelhardt Oct. 3, 2014, 11:16 a.m. UTC | #2
On Friday 2014-10-03 13:04, Holger Hans Peter Freyther wrote:
>On Fri, Oct 03, 2014 at 12:57:02PM +0200, Jan Engelhardt wrote:
>
>> +if !ENABLE_TALLOC
>> +libosmogsm_la_LIBADD += -ltalloc
>> +endif
>
>You assume that a libtalloc exists on the
>system and that it is found in the library search paths. This is
>not an improvement, it is a change that breaks in different ways for
>different people.

It is the same logic that was used for libosmocore_la_LIBADD.
It goes away with patch 2 anyway, so it should not hurt. Squash the two 
if need be.

Patch
diff mbox

diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am
index 828aa50..b0cdea2 100644
--- a/src/gsm/Makefile.am
+++ b/src/gsm/Makefile.am
@@ -24,5 +24,8 @@  libosmogsm_la_SOURCES = a5.c rxlev_stat.c tlv_parser.c comp128.c comp128v23.c \
 
 libosmogsm_la_LDFLAGS = $(LTLDFLAGS_OSMOGSM) -version-info $(LIBVERSION) -no-undefined
 libosmogsm_la_LIBADD = $(top_builddir)/src/libosmocore.la
+if !ENABLE_TALLOC
+libosmogsm_la_LIBADD += -ltalloc
+endif
 
 EXTRA_DIST = libosmogsm.map