Nathan Lynch <[email protected]> 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. _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
