[lttng-dev] [RELEASE] Babeltrace 2.0.0-pre1

Nathan Lynch nathan_lynch at mentor.com
Fri Jun 30 20:48:39 UTC 2017


Nathan Lynch <nathan_lynch at mentor.com> writes:
> Static linking still needs work, specifically case #3 from this comment:
>
> https://bugs.lttng.org/issues/1055#note-2
>
> Building on Fedora 25 with 'make LDFLAGS=-all-static' gets:
>
> ../lib/.libs/libbabeltrace.a(common.o): In function `bt_get_home_dir':
> /home/nathanl/src/babeltrace/tmp/native/all/common/../../../../common/common.c:138: warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
> /usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../lib64/libglib-2.0.a(libglib_2_0_la-gutils.o): In function `g_get_user_database_entry':
> (.text+0xdc): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
> /usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../lib64/libglib-2.0.a(libglib_2_0_la-gutils.o): In function `g_get_user_database_entry':
> (.text+0x114): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
> /usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/gcc/x86_64-redhat-linux/6.3.1/../../../../lib64/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
> collect2: error: ld returned 1 exit status
>
> The getpwuid and getpwnam_r warnings are raised due to code that seems
> intended to load plugins from the user's home directory; I wonder if
> that facility could made configurable.  Or is there another way to deal
> with this?

Just an update: in my investigation such warnings seem unavoidable when
statically linking glib2.  I think it still makes sense to have a
configuration option for the user plugin feature though.

> The STT_GNU_IFUNC strcmp error implicates export-dynamic, I think.
> Still looking into it.

I'm sending a patch to remove -export-dynamic; I think it's no longer
needed.


More information about the lttng-dev mailing list