After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 618754 - G_GNUC_INTERNAL visibility("hidden") link error on DragonFly
G_GNUC_INTERNAL visibility("hidden") link error on DragonFly
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: build
2.25.x
Other other
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-05-16 01:18 UTC by David Shao
Modified: 2014-01-20 04:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for glib to build on DragonFly (1.46 KB, patch)
2010-05-16 01:18 UTC, David Shao
none Details | Review

Description David Shao 2010-05-16 01:18:30 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
Comment 1 Richard Hansen 2010-06-08 22:51:11 UTC
I'm seeing this exact issue on NetBSD 5.1_RC2 (amd64) with GLib 2.25.8.
Comment 2 Matthias Clasen 2014-01-20 04:56:26 UTC
Please retry with a newer version of GLib, quite a few things have changed in the way we handle symbol visibility.