[erlang-bugs] Build failure with glibc 2.8 (incl. proposed patch)

Mikael Pettersson mikpe@REDACTED
Fri Jun 13 12:40:26 CEST 2008


Christian Faulhammer writes:
 > Hi,
 > 
 > I forward this for a user who reported the problem on the Gentoo bug
 > tracker: http://bugs.gentoo.org/show_bug.cgi?id=226063
 > 
 > 
 > -------- Original Message --------
 > Subject: Build failure with glibc 2.8 (incl. proposed patch)
 > Date: Thu, 12 Jun 2008 15:53:52 +0200
 > From: Holger Hoffstaette <holger@REDACTED>
 > Organization: The Fists of the White Lotus
 > Newsgroups: gmane.comp.lang.erlang.patches
 > 
 > Hi!
 > 
 > Apologies if this shows up twice, but the bugs list apparently does not
 > like me. :(
 > 
 > I wrote:
 > 
 > Trying to build 12B3 on Gentoo. Glad to see that Christian Faulhammer's
 > patch for ssl and --as-needed was incorporated and works, but
 > now something new came up when building with libtool 2.2.4 and glibc-2.8
 > (2.8_p20080602), either of which may be the culprit though I suspect
 > glibc. This will likely affect Fedora too, which has the same glibc.
...
 > obj/i686-pc-linux-gnu/opt/smp/hipe_x86_signal.o: In function
 > `sigaction': hipe_x86_signal.c:(.text+0xa9): undefined reference to
 > `INIT' hipe_x86_signal.c:(.text+0xff): undefined reference to
 > `__next_sigaction' obj/i686-pc-linux-gnu/opt/smp/hipe_x86_signal.o: In
 > function `hipe_signal_init':
 > hipe_x86_signal.c:(.text+0x118): undefined reference to `INIT'
 > hipe_x86_signal.c:(.text+0x148): undefined reference to `INIT'
 > hipe_x86_signal.c:(.text+0x163): undefined reference to
 > `__next_sigaction' hipe_x86_signal.c:(.text+0x190): undefined reference
 > to `INIT' hipe_x86_signal.c:(.text+0x1d9): undefined reference to
 > `__next_sigaction' collect2: ld returned 1 exit status
 > 
 >  From a quick look at the source of hipe_x86_signal.c it seems
 > that the glibc version checks miss defining/overriding the correct INIT
 > and __sigaction. Suggestions? If someone tells me what to try I will be
 > happy to produce a patch. :)
 > 
 > --snip--
 > 
 > I verified that this also happens with R12-2, so it is not a new bug.
 > 
 > After analyzing the #ifdef zoo a bit more I tried to simply bump the
 > glibc version check from 2.7 to 2.8, and lo! it builds & works. Patch:
 > 
 > ---------------------------- patch -----------------------------
 > 
 > --- erts/emulator/hipe/hipe_x86_signal.c	2008-06-12
 > 14:17:48.831373565 +0200 +++
 > erts/emulator/hipe/hipe_x86_signal_ok.c	2008-06-12
 > 14:43:05.132064804 +0200 @@ -34,7 +34,7 @@
 >   #endif
 >   #include "hipe_signal.h"
 > 
 > -#if __GLIBC__ == 2 && (__GLIBC_MINOR__ >= 3 && __GLIBC_MINOR__ <= 7)
 > +#if __GLIBC__ == 2 && (__GLIBC_MINOR__ >= 3 && __GLIBC_MINOR__ <= 8)
 >   /* See comment below for glibc 2.2. */
 >   #ifndef __USE_GNU
 >   #define __USE_GNU		/* to un-hide RTLD_NEXT */
 > 
 > ---------------------------- patch -----------------------------
 > 
 > I'm not too happy with the hardcoded version as this will probably
 > happen again with glibc 2.9, but for now this does the trick.

It's not a bug, it's a deliberate version check to prevent building
against unverified glibc versions. In the past, running the wrong
code on early glibc versions could result in obscure runtime failures.

However, since glibc-2.3 there have been no relevant changes in
this area, and now the version check while correct causes more
problems than it solves. So I'll probably loosen the check to
just be ">= 2.3".

/Mikael



More information about the erlang-bugs mailing list