GNOME Bugzilla – Bug 618754
G_GNUC_INTERNAL visibility("hidden") link error on DragonFly
Last modified: 2014-01-20 04:56:26 UTC
Created attachment 161152 [details] [review] Patch for glib to build on DragonFly Overview: G_GNUC_INTERNAL defined to be __attribute__((visibility("hidden"))) causes a link error on latest DragonFly Steps to Reproduce: On DragonFly 2.7-DEVELOPMENT DragonFly v2.7.3.40.ge20aa-DEVELOPMENT using gcc 4.1.2 for latest glib from git 63d74caabe6f7b85ad13cad922fff239911fb5a0 configure and build using autogen.sh with options such as "--disable-xattr --disable-selinux --disable-visibility --enable-debug=yes" Actual Results: /usr/libexec/binutils217/elf/ld: .libs/gthread.o: relocation R_X86_64_PC32 against `_g_mem_thread_init_noprivate_nomessage' can not be used when making a shared object; recompile with -fPIC /usr/libexec/binutils217/elf/ld: final link failed: Bad value Expected Results: Have patches to enable build, so possible on DragonFly. Additional Builds and Platforms: Extracted g_have_gnuc_visibility C code and it appeared to compile and work on DragonFly; however, did not try to link as part of a library. Additional Information: The following patch resolves the problem by simply defining G_GNUC_INTERNAL to be nothing, but is not optimal because it simply makes a special exception for DragonFly. The attached patch created from git format-patch includes both patches to enable latest glib to build on DragonFly. diff --git a/configure.in b/configure.in index 38288c3..51a1c07 100644 --- a/configure.in +++ b/configure.in @@ -3033,7 +3033,7 @@ _______EOF #define G_GNUC_INTERNAL __attribute__((visibility("hidden"))) #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) #define G_GNUC_INTERNAL __hidden -#elif defined (__GNUC__) && defined (G_HAVE_GNUC_VISIBILITY) +#elif defined (__GNUC__) && defined (G_HAVE_GNUC_VISIBILITY) && !defined(__DragonFly__) #define G_GNUC_INTERNAL __attribute__((visibility("hidden"))) #else #define G_GNUC_INTERNAL
I'm seeing this exact issue on NetBSD 5.1_RC2 (amd64) with GLib 2.25.8.
Please retry with a newer version of GLib, quite a few things have changed in the way we handle symbol visibility.