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

Christian Faulhammer opfer@REDACTED
Thu Jun 12 16:24:36 CEST 2008


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.

This compilation warning:

i686-pc-linux-gnu-gcc  -pipe -march=pentium4 -mfpmath=sse -O3 
-fomit-frame-pointer
-I/var/tmp/portage/dev-lang/erlang-12.2.3/work/otp_src_R1
2B-3/erts/i686-pc-linux-gnu  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_GNU_SOURCE -DERTS_SMP -DHAVE_CONFIG_H -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wdeclaration-after-statement -DUSE_THREADS
-D_THREAD_SAFE -D_REENTRANT -D_POSIX_THREAD_SAFE_FUNCTIONS  -Ibeam
-Isys/un ix -Isys/common -Ii686-pc-linux-gnu/opt/smp
-Ii686-pc-linux-gnu -Izlib -Ipcre -Ihipe -I../include/internal
-I../include/internal/i686-pc-linux-gnu -c hipe/hipe_x86_signal.c -o
obj/i686-pc-linux-gnu/opt/smp/hipe_x86_signal.o hipe/hipe_x86_signal.c:
In function 'my_sigaction': hipe/hipe_x86_signal.c:221: warning:
implicit declaration of function 'INIT' hipe/hipe_x86_signal.c:231:
warning: implicit declaration of function '__next_sigaction'

..then of course fails at link time:

i686-pc-linux-gnu-gcc -o 
/var/tmp/portage/dev-lang/erlang-12.2.3/work/otp_src_R12B-3/bin/i686-pc-linux-gnu/beam.smp 
\
          -Wl,-O1,--as-needed,-z,now  -Wl,-export-dynamic 
obj/i686-pc-linux-gnu/opt/smp/erl_main.o 
obj/i686-pc-linux-gnu/opt/smp/preload.o 
obj/i686-pc-linux-gnu/opt/smp/erl_pbifs.o 
obj/i686-pc-linux-gnu/opt/smp/benchmark.o 
obj/i686-pc-linux-gnu/opt/smp/erl_alloc.o 
obj/i686-pc-linux-gnu/opt/smp/erl_mtrace.o 
obj/i686-pc-linux-gnu/opt/smp/erl_alloc_util.o 
obj/i686-pc-linux-gnu/opt/smp/erl_goodfit_alloc.o 
obj/i686-pc-linux-gnu/opt/smp/erl_bestfit_alloc.o 
obj/i686-pc-linux-gnu/opt/smp/erl_afit_alloc.o 
obj/i686-pc-linux-gnu/opt/smp/erl_instrument.o 
obj/i686-pc-linux-gnu/opt/smp/erl_init.o 
obj/i686-pc-linux-gnu/opt/smp/erl_atom_table.o 
obj/i686-pc-linux-gnu/opt/smp/erl_bif_table.o 
obj/i686-pc-linux-gnu/opt/smp/erl_bif_ddll.o 
obj/i686-pc-linux-gnu/opt/smp/erl_bif_guard.o 
obj/i686-pc-linux-gnu/opt/smp/erl_bif_info.o 
obj/i686-pc-linux-gnu/opt/smp/erl_bif_op.o 
obj/i686-pc-linux-gnu/opt/smp/erl_bif_os.o 
obj/i686-pc-linux-gnu/opt/smp/erl_bif_lists.o 
obj/i686-pc-linux-gnu/opt/smp/erl_bif_trace.o 
obj/i686-pc-linux-gnu/opt/smp/erl_bif_wrap.o 
obj/i686-pc-linux-gnu/opt/smp/erl_trace.o 
obj/i686-pc-linux-gnu/opt/smp/copy.o
obj/i686-pc-linux-gnu/opt/smp/utils.o
obj/i686-pc-linux-gnu/opt/smp/bif.o obj/i686-pc-linux-gnu/opt/smp/io.o 
obj/i686-pc-linux-gnu/opt/smp/erl_printf_term.o 
obj/i686-pc-linux-gnu/opt/smp/erl_debug.o 
obj/i686-pc-linux-gnu/opt/smp/erl_md5.o 
obj/i686-pc-linux-gnu/opt/smp/erl_message.o 
obj/i686-pc-linux-gnu/opt/smp/erl_process.o 
obj/i686-pc-linux-gnu/opt/smp/erl_process_dict.o 
obj/i686-pc-linux-gnu/opt/smp/erl_process_lock.o 
obj/i686-pc-linux-gnu/opt/smp/erl_port_task.o 
obj/i686-pc-linux-gnu/opt/smp/erl_arith.o 
obj/i686-pc-linux-gnu/opt/smp/time.o 
obj/i686-pc-linux-gnu/opt/smp/erl_time_sup.o 
obj/i686-pc-linux-gnu/opt/smp/external.o 
obj/i686-pc-linux-gnu/opt/smp/dist.o 
obj/i686-pc-linux-gnu/opt/smp/binary.o 
obj/i686-pc-linux-gnu/opt/smp/erl_db.o 
obj/i686-pc-linux-gnu/opt/smp/erl_db_util.o 
obj/i686-pc-linux-gnu/opt/smp/erl_db_hash.o 
obj/i686-pc-linux-gnu/opt/smp/erl_db_tree.o 
obj/i686-pc-linux-gnu/opt/smp/fix_alloc.o 
obj/i686-pc-linux-gnu/opt/smp/big.o 
obj/i686-pc-linux-gnu/opt/smp/hash.o
obj/i686-pc-linux-gnu/opt/smp/index.o
obj/i686-pc-linux-gnu/opt/smp/atom.o
obj/i686-pc-linux-gnu/opt/smp/module.o
obj/i686-pc-linux-gnu/opt/smp/export.o
obj/i686-pc-linux-gnu/opt/smp/register.o
obj/i686-pc-linux-gnu/opt/smp/break.o
obj/i686-pc-linux-gnu/opt/smp/erl_async.o
obj/i686-pc-linux-gnu/opt/smp/erl_lock_check.o
obj/i686-pc-linux-gnu/opt/smp/erl_gc.o
obj/i686-pc-linux-gnu/opt/smp/erl_nmgc.o
obj/i686-pc-linux-gnu/opt/smp/erl_posix_str.o
obj/i686-pc-linux-gnu/opt/smp/erl_bits.o
obj/i686-pc-linux-gnu/opt/smp/erl_math.o
obj/i686-pc-linux-gnu/opt/smp/erl_fun.o
obj/i686-pc-linux-gnu/opt/smp/erl_bif_port.o
obj/i686-pc-linux-gnu/opt/smp/erl_term.o
obj/i686-pc-linux-gnu/opt/smp/erl_node_tables.o
obj/i686-pc-linux-gnu/opt/smp/erl_monitors.o
obj/i686-pc-linux-gnu/opt/smp/erl_process_dump.o
obj/i686-pc-linux-gnu/opt/smp/erl_obsolete.o
obj/i686-pc-linux-gnu/opt/smp/erl_bif_timer.o
obj/i686-pc-linux-gnu/opt/smp/erl_drv_thread.o
obj/i686-pc-linux-gnu/opt/smp/erl_bif_chksum.o
obj/i686-pc-linux-gnu/opt/smp/erl_bif_re.o
obj/i686-pc-linux-gnu/opt/smp/beam_emu.o
obj/i686-pc-linux-gnu/opt/smp/beam_opcodes.o
obj/i686-pc-linux-gnu/opt/smp/beam_load.o
obj/i686-pc-linux-gnu/opt/smp/beam_bif_load.o
obj/i686-pc-linux-gnu/opt/smp/beam_debug.o
obj/i686-pc-linux-gnu/opt/smp/beam_bp.o
obj/i686-pc-linux-gnu/opt/smp/beam_catches.o
obj/i686-pc-linux-gnu/opt/smp/sys.o
obj/i686-pc-linux-gnu/opt/smp/driver_tab.o
obj/i686-pc-linux-gnu/opt/smp/unix_efile.o
obj/i686-pc-linux-gnu/opt/smp/gzio.o
obj/i686-pc-linux-gnu/opt/smp/elib_malloc.o
obj/i686-pc-linux-gnu/opt/smp/elib_memmove.o
obj/i686-pc-linux-gnu/opt/smp/sys_float.o
obj/i686-pc-linux-gnu/opt/smp/sys_time.o
obj/i686-pc-linux-gnu/opt/smp/erl_poll.kp.o
obj/i686-pc-linux-gnu/opt/smp/erl_check_io.kp.o
obj/i686-pc-linux-gnu/opt/smp/erl_poll.nkp.o
obj/i686-pc-linux-gnu/opt/smp/erl_check_io.nkp.o
obj/i686-pc-linux-gnu/opt/smp/erl_mseg.o
obj/i686-pc-linux-gnu/opt/smp/erl_unix_sys_ddll.o
obj/i686-pc-linux-gnu/opt/smp/erl_mtrace_sys_wrap.o
obj/i686-pc-linux-gnu/opt/smp/hipe_bif0.o
obj/i686-pc-linux-gnu/opt/smp/hipe_bif1.o
obj/i686-pc-linux-gnu/opt/smp/hipe_bif2.o
obj/i686-pc-linux-gnu/opt/smp/hipe_debug.o
obj/i686-pc-linux-gnu/opt/smp/hipe_gc.o
obj/i686-pc-linux-gnu/opt/smp/hipe_mode_switch.o
obj/i686-pc-linux-gnu/opt/smp/hipe_native_bif.o
obj/i686-pc-linux-gnu/opt/smp/hipe_stack.o
obj/i686-pc-linux-gnu/opt/smp/hipe_x86.o
obj/i686-pc-linux-gnu/opt/smp/hipe_x86_glue.o
obj/i686-pc-linux-gnu/opt/smp/hipe_x86_bifs.o
obj/i686-pc-linux-gnu/opt/smp/hipe_x86_signal.o
obj/i686-pc-linux-gnu/opt/smp/hipe_x86_stack.o
obj/i686-pc-linux-gnu/opt/smp/efile_drv.o
obj/i686-pc-linux-gnu/opt/smp/inet_drv.o
obj/i686-pc-linux-gnu/opt/smp/zlib_drv.o
obj/i686-pc-linux-gnu/opt/smp/ram_file_drv.o
obj/i686-pc-linux-gnu/opt/smp/ttsl_drv.o -lutil -ldl -lm   -lncurses
-L../lib/internal/i686-pc-linux-gnu /var/tmp/portage/dev-lang/erlang-12.2.3/work/otp_src_R12B-3/erts/obj/i686-pc-linux-gnu/libz.a 
/var/tmp/portage/dev-lang/erlang-12.2.3/work/otp_src_R12B-3/erts/emulator/obj/i686-pc-linux-gnu/opt/libepcre.a 
-lethread -lpthread -lerts_internal_r -lrt
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.

Holger

-- 
Christian Faulhammer, Gentoo Lisp project
<URL:http://www.gentoo.org/proj/en/lisp/>, #gentoo-lisp on FreeNode

<URL:http://www.faulhammer.org/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20080612/411b98b4/attachment.bin>


More information about the erlang-bugs mailing list