[PATCH] build: resolve link failure in libosmogsm when --disable-talloc is used
The link stage fails at some point. libosmogsm.so:lapd-core.c uses talloc_free, but does not link to libtalloc.so. Correct this. 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(+) diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index b72a8d4..237e134 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -23,5 +23,8 @@ libosmogsm_la_SOURCES = a5.c rxlev_stat.c tlv_parser.c comp128.c gsm_utils.c \ libosmogsm_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libosmogsm.map -version-info $(LIBVERSION) libosmogsm_la_LIBADD = $(top_builddir)/src/libosmocore.la +if !ENABLE_TALLOC +libosmogsm_la_LIBDADD = -ltalloc +endif EXTRA_DIST = libosmogsm.map -- 1.7.10.4
On Sun, Feb 17, 2013 at 08:42:55PM +0100, Jan Engelhardt wrote: Hi,
The link stage fails at some point. libosmogsm.so:lapd-core.c uses talloc_free, but does not link to libtalloc.so. Correct this.
Disabling talloc is only supported for the OsmocomBB use case. I understand that many distributions ship a standalone libtalloc by now and we should find ways to support it but your patch doesn't look like the solution to the problem. E.g. a solution would include: * Detecting the system talloc * Not installing the osmocom/core/talloc.h or finding a header file that will just include_next talloc.h for the real talloc. This is important as there is no gurantee that osmocom/core/talloc.h and talloc.h are compatible with each other. thanks holger
Jan Engelhardt wrote:
diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index b72a8d4..237e134 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -23,5 +23,8 @@ libosmogsm_la_SOURCES = a5.c rxlev_stat.c tlv_parser.c comp128.c gsm_utils.c \
libosmogsm_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libosmogsm.map -version-info $(LIBVERSION) libosmogsm_la_LIBADD = $(top_builddir)/src/libosmocore.la +if !ENABLE_TALLOC +libosmogsm_la_LIBDADD = -ltalloc +endif
It seems wrong to use libtalloc when --disable-talloc is used? Why not fix the code to not use talloc_free() instead? And another thing, was there only an error about talloc_free()? That would mean an imbalance in the code which should be fixed.. //Peter
participants (3)
-
Holger Hans Peter Freyther -
Jan Engelhardt -
Peter Stuge