<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>226063</bug_id>
          
          <creation_ts>2008-06-12 13:15 0000</creation_ts>
          <short_desc>dev-lang/erlang fails to build with glibc 2.8</short_desc>
          <delta_ts>2008-06-13 19:32:01 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Development</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>225459</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>holger.hoffstaette@googlemail.com</reporter>
          <assigned_to>fauli@gentoo.org</assigned_to>
          <cc>lang-misc@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>holger.hoffstaette@googlemail.com</who>
            <bug_when>2008-06-12 13:15:40 0000</bug_when>
            <thetext>While trying to revbump erlang to 12.2.3 I encountered the following:

--snip--
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 &apos;my_sigaction&apos;:
hipe/hipe_x86_signal.c:221: warning: implicit declaration of function &apos;INIT&apos;
hipe/hipe_x86_signal.c:231: warning: implicit declaration of function &apos;__next_sigaction&apos;

..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&apos;:
hipe_x86_signal.c:(.text+0xa9): undefined reference to `INIT&apos;
hipe_x86_signal.c:(.text+0xff): undefined reference to `__next_sigaction&apos;
obj/i686-pc-linux-gnu/opt/smp/hipe_x86_signal.o: In function `hipe_signal_init&apos;:
hipe_x86_signal.c:(.text+0x118): undefined reference to `INIT&apos;
hipe_x86_signal.c:(.text+0x148): undefined reference to `INIT&apos;
hipe_x86_signal.c:(.text+0x163): undefined reference to `__next_sigaction&apos;
hipe_x86_signal.c:(.text+0x190): undefined reference to `INIT&apos;
hipe_x86_signal.c:(.text+0x1d9): undefined reference to `__next_sigaction&apos;
collect2: ld returned 1 exit status

--snip--

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 signal handler stuff. This also happens with 12.2.2 (just verified), so it is not a new problem in 12.2.3. I am building with a patch (1-liner) as we speak.


Reproducible: Always

Steps to Reproduce:
1. emerge glibc-2.8
2. emerge erlang
3. fail!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>holger.hoffstaette@googlemail.com</who>
            <bug_when>2008-06-12 13:24:26 0000</bug_when>
            <thetext>Created an attachment (id=156491)
fix for build against glibc-2.8

This is just a quick attempt, but it did the trick; build succeeds and works. Not happy with the fixed version numbers, as glibc 2.9 will likely hit the same problem.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>holger.hoffstaette@googlemail.com</who>
            <bug_when>2008-06-12 13:25:52 0000</bug_when>
            <thetext>I have also posted this to the erlang.bugs list; we&apos;ll see what the official recommendation is.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2008-06-12 13:57:06 0000</bug_when>
            <thetext>(In reply to comment #2)
&gt; I have also posted this to the erlang.bugs list; we&apos;ll see what the official
&gt; recommendation is.

 I will not apply the patch yet as I have the same uneasy feeling about it.
By the way, I haven&apos;t seen a mail from you on the erlang-bugs mailing list.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>holger.hoffstaette@googlemail.com</who>
            <bug_when>2008-06-12 14:04:43 0000</bug_when>
            <thetext>I read many lists via gmane and apparently postings to the erlang lists are eaten..which would explain why nobody ever answered my questions. :(
Will try nabble..
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2008-06-12 14:07:34 0000</bug_when>
            <thetext>(In reply to comment #4)
&gt; I read many lists via gmane and apparently postings to the erlang lists are
&gt; eaten..which would explain why nobody ever answered my questions. :(

 Give me the text and I will post it for you.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>holger.hoffstaette@googlemail.com</who>
            <bug_when>2008-06-12 14:15:35 0000</bug_when>
            <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; I read many lists via gmane and apparently postings to the erlang lists are
&gt; &gt; eaten..which would explain why nobody ever answered my questions. :(
&gt; 
&gt;  Give me the text and I will post it for you.

Much appreciated but I guess sooner or later I&apos;ll have to subscribe anyway, so that&apos;s what I just did (maybe they authorize gmane and subscribers). Jeez..I&apos;ve been using email since &apos;91 and this just keeps getting worse..
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2008-06-12 14:41:16 0000</bug_when>
            <thetext>Will commit 12B-3 soon, please test if that succeeds with glibc 2.8 even though it is not mentioned in the ChangeLog in any way.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>holger.hoffstaette@googlemail.com</who>
            <bug_when>2008-06-12 19:07:31 0000</bug_when>
            <thetext>(In reply to comment #7)
&gt; Will commit 12B-3 soon, please test if that succeeds with glibc 2.8 even though
&gt; it is not mentioned in the ChangeLog in any way.

I see it in portage but how would it suceed if the patch is not there?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2008-06-13 06:41:35 0000</bug_when>
            <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; Will commit 12B-3 soon, please test if that succeeds with glibc 2.8 even though
&gt; &gt; it is not mentioned in the ChangeLog in any way.
&gt; 
&gt; I see it in portage but how would it suceed if the patch is not there?

 Maybe it was fixed by upstream, so unlikely...I did not add the patch as I will wait for a reaction of the Erlang upstream.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>holger.hoffstaette@googlemail.com</who>
            <bug_when>2008-06-13 14:54:15 0000</bug_when>
            <thetext>Upstream response:
http://www.nabble.com/forum/ViewPost.jtp?post=17820804&amp;framed=y

As I suspected we can remove the minor version check for glibc; I&apos;ll update the patch asap.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>holger.hoffstaette@googlemail.com</who>
            <bug_when>2008-06-13 15:00:11 0000</bug_when>
            <thetext>Created an attachment (id=156639)
Official patch as confirmed by upstream

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2008-06-13 19:32:01 0000</bug_when>
            <thetext>Fixed, thanks.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>156491</attachid>
            <date>2008-06-12 13:24 0000</date>
            <desc>fix for build against glibc-2.8</desc>
            <filename>erlang-12.2.3-glibc28.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGVydHMvZW11bGF0b3IvaGlwZS9oaXBlX3g4Nl9zaWduYWwuYwkyMDA4LTA2LTEyIDE0OjE3
OjQ4LjgzMTM3MzU2NSArMDIwMAorKysgZXJ0cy9lbXVsYXRvci9oaXBlL2hpcGVfeDg2X3NpZ25h
bF9vay5jCTIwMDgtMDYtMTIgMTQ6NDM6MDUuMTMyMDY0ODA0ICswMjAwCkBAIC0zNCw3ICszNCw3
IEBACiAjZW5kaWYKICNpbmNsdWRlICJoaXBlX3NpZ25hbC5oIgogCi0jaWYgX19HTElCQ19fID09
IDIgJiYgKF9fR0xJQkNfTUlOT1JfXyA+PSAzICYmIF9fR0xJQkNfTUlOT1JfXyA8PSA3KQorI2lm
IF9fR0xJQkNfXyA9PSAyICYmIChfX0dMSUJDX01JTk9SX18gPj0gMyAmJiBfX0dMSUJDX01JTk9S
X18gPD0gOCkKIC8qIFNlZSBjb21tZW50IGJlbG93IGZvciBnbGliYyAyLjIuICovCiAjaWZuZGVm
IF9fVVNFX0dOVQogI2RlZmluZSBfX1VTRV9HTlUJCS8qIHRvIHVuLWhpZGUgUlRMRF9ORVhUICov
Cg==
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>156639</attachid>
            <date>2008-06-13 15:00 0000</date>
            <desc>Official patch as confirmed by upstream</desc>
            <filename>erlang-12.2.3-glibc28.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGVydHMvZW11bGF0b3IvaGlwZS9oaXBlX3g4Nl9zaWduYWwuYwkyMDA4LTA2LTEyIDE0OjE3
OjQ4LjgzMTM3MzU2NSArMDIwMAorKysgZXJ0cy9lbXVsYXRvci9oaXBlL2hpcGVfeDg2X3NpZ25h
bF9vay5jCTIwMDgtMDYtMTIgMTQ6NDM6MDUuMTMyMDY0ODA0ICswMjAwCkBAIC0zNCw3ICszNCw3
IEBACiAjZW5kaWYKICNpbmNsdWRlICJoaXBlX3NpZ25hbC5oIgogCi0jaWYgX19HTElCQ19fID09
IDIgJiYgKF9fR0xJQkNfTUlOT1JfXyA+PSAzICYmIF9fR0xJQkNfTUlOT1JfXyA8PSA3KQorI2lm
IF9fR0xJQkNfXyA9PSAyICYmIF9fR0xJQkNfTUlOT1JfXyA+PSAzCiAvKiBTZWUgY29tbWVudCBi
ZWxvdyBmb3IgZ2xpYmMgMi4yLiAqLwogI2lmbmRlZiBfX1VTRV9HTlUKICNkZWZpbmUgX19VU0Vf
R05VCQkvKiB0byB1bi1oaWRlIFJUTERfTkVYVCAqLwo=
</data>        

          </attachment>
    </bug>

</bugzilla>