Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 194387 - sys-libs/uclibc++-0.2.2 fails to link on uclibc due to undefined reference to `___tls_get_addr'
Summary: sys-libs/uclibc++-0.2.2 fails to link on uclibc due to undefined reference to...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-01 14:06 UTC by Natanael Copa
Modified: 2009-04-28 20:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
uclibc++-0.2.2.ebuild (uclibc++-0.2.2.ebuild,1.61 KB, text/plain)
2007-10-01 14:12 UTC, Natanael Copa
Details
uclibc++-0.2.2.ebuild (uclibc++-0.2.2.ebuild,1.58 KB, text/plain)
2007-10-01 19:52 UTC, Natanael Copa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Natanael Copa 2007-10-01 14:06:34 UTC
i386-gentoo-linux-uclibc-gcc -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,defs -nodefaultlibs -shared -Wl,-soname,libuClibc++.so.0 `echo ""`  -o libuClibc++-0.2.2.so algorithm.o associative_base.o bitset.o char_traits.o complex.o del_op.o del_opnt.o del_opv.o del_opvnt.o deque.o eh_alloc.o eh_globals.o exception.o fstream.o func_exception.o iomanip.o ios.o iostream.o istream.o iterator.o limits.o list.o locale.o map.o new_handler.o new_op.o new_opnt.o new_opv.o new_opvnt.o numeric.o ostream.o queue.o set.o sstream.o stack.o stdexcept.o streambuf.o string.o utility.o valarray.o vector.o abi/abi.o abi/libsupc/cp-demangle.o abi/libsupc/eh_aux_runtime.o abi/libsupc/eh_catch.o abi/libsupc/eh_exception.o abi/libsupc/eh_personality.o abi/libsupc/eh_term_handler.o abi/libsupc/eh_terminate.o abi/libsupc/eh_throw.o abi/libsupc/eh_type.o abi/libsupc/eh_unex_handler.o abi/libsupc/guard.o abi/libsupc/tinfo.o abi/libsupc/tinfo2.o abi/libsupc/vec.o abi/libsupc/vterminate.o abi/libgcc_eh/gthr-gnat.o abi/libgcc_eh/unwind-c.o abi/libgcc_eh/unwind-dw2-fde.o abi/libgcc_eh/unwind-dw2.o abi/libgcc_eh/unwind-sjlj.o  -L/usr/lib/gcc/i386-gentoo-linux-uclibc/3.4.6/ -lc -lgcc
i386-gentoo-linux-uclibc-ranlib libuClibc++.a
eh_globals.o: In function `__cxa_get_globals':
eh_globals.cpp:(.text+0x27): undefined reference to `___tls_get_addr'
collect2: ld returned 1 exit status
make[1]: *** [libuClibc++-0.2.2.so] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-libs/uclibc++-0.2.2/work/uClibc++-0.2.2/src'
make: *** [all] Error 2
Comment 1 Natanael Copa 2007-10-01 14:12:10 UTC
Created attachment 132311 [details]
uclibc++-0.2.2.ebuild

The current set_config stuff does currently absolutely nothing since "make oldconfig" is never run.

The attatched ebuild changes the syntax on set_config. New syntax is:

  set_config <variable> <value>

If value is "" or "n" the variable is disabled. Value does not need to exist in IUSE as it did before.

--- /usr/portage/sys-libs/uclibc++/uclibc++-0.2.2.ebuild        2007-09-15 02:57:12 +0000
+++ uclibc++-0.2.2.ebuild       2007-10-01 13:53:11 +0000
@@ -27,26 +27,34 @@
 S=${WORKDIR}/uClibc++-${PV}
 
 set_config() {
-       sed -i \
-               -e "s:^# $2 is not set$:GO_HERE:" \
-               -e "s:^$2=.*$:GO_HERE:" \
-               .config
        local val
-       if [[ -z $1 ]] || use $1 ; then
-               val="$2=${3:-y}"
+       if [[ -n $2 && $2 != "n" ]]; then
+               val="$1=${2:-y}"
+               einfo "Enabling $1"
        else
-               val="# $2 is not set"
+               val="# $1 is not set"
+               einfo "Disabling $1"
        fi
-       sed -i -e "s:^GO_HERE$:${val}:" .config
+       sed -i \
+               -e "s:^# $1 is not set$:${val}:" \
+               -e "s:^$1=.*$:${val}:" \
+               .config
 }
+
 src_unpack() {
        unpack ${A}
        cd "${S}"
        sed -i -e "s: -Wl,-s$: ${LDFLAGS}:" src/Makefile
        emake -j1 -s defconfig > /dev/null || die "defconfig failed"
-       set_config "" UCLIBCXX_RUNTIME_PREFIX "\"/usr/${CTARGET}\""
-       set_config "" BUILD_STATIC_LIB
-       set_config static BUILD_ONLY_STATIC_LIB
+       set_config UCLIBCXX_RUNTIME_PREFIX "\"/usr/${CTARGET}\""
+       set_config BUILD_STATIC_LIB y
+       if use static; then
+               set_config BUILD_ONLY_STATIC_LIB y
+       fi
+       if use elibc_uclibc; then
+               set_config UCLIBCXX_HAS_TLS n
+       fi
+       emake oldconfig
 }
 
 src_compile() {
Comment 2 SpanKY gentoo-dev 2007-10-01 15:51:34 UTC

*** This bug has been marked as a duplicate of bug 148621 ***
Comment 3 Natanael Copa 2007-10-01 19:52:04 UTC
Created attachment 132334 [details]
uclibc++-0.2.2.ebuild

--- /usr/portage/sys-libs/uclibc++/uclibc++-0.2.2.ebuild        2007-09-15 02:57:12 +0000
+++ uclibc++-0.2.2.ebuild       2007-10-01 19:35:29 +0000
@@ -27,26 +27,32 @@
 S=${WORKDIR}/uClibc++-${PV}
 
 set_config() {
-       sed -i \
-               -e "s:^# $2 is not set$:GO_HERE:" \
-               -e "s:^$2=.*$:GO_HERE:" \
-               .config
        local val
-       if [[ -z $1 ]] || use $1 ; then
-               val="$2=${3:-y}"
+       sed -i -e "/$1/d" .config
+       if [[ -n $2 && $2 != "n" ]]; then
+               val="$1=${2:-y}"
+               einfo "Enabling $1"
        else
-               val="# $2 is not set"
+               val="# $1 is not set"
+               einfo "Disabling $1"
        fi
-       sed -i -e "s:^GO_HERE$:${val}:" .config
+       echo "$val" >> .config
 }
+
 src_unpack() {
        unpack ${A}
        cd "${S}"
        sed -i -e "s: -Wl,-s$: ${LDFLAGS}:" src/Makefile
        emake -j1 -s defconfig > /dev/null || die "defconfig failed"
-       set_config "" UCLIBCXX_RUNTIME_PREFIX "\"/usr/${CTARGET}\""
-       set_config "" BUILD_STATIC_LIB
-       set_config static BUILD_ONLY_STATIC_LIB
+       set_config UCLIBCXX_RUNTIME_PREFIX "\"/usr/${CTARGET}\""
+       set_config BUILD_STATIC_LIB y
+       if use static; then
+               set_config BUILD_ONLY_STATIC_LIB y
+       fi
+       if use elibc_uclibc; then
+               set_config UCLIBCXX_HAS_TLS n
+       fi
+       emake oldconfig
 }
 
 src_compile() {
Comment 4 Natanael Copa 2007-10-01 19:52:37 UTC
Please commit the ebuild. The ebuild in portage is broken. It will only compile uclibc++ with the defaults. The static useflag is broken (since the ebuild never runs make oldconfig).

By simply disabling the TLS in the config it will work *now*.

Please!
Comment 5 solar (RETIRED) gentoo-dev 2007-10-01 22:48:49 UTC
till the next release of uclibc@gentoo this has been bumped as -r1
Comment 6 Bertrand Jacquin 2009-04-28 20:21:50 UTC
uclibc++-0.2.2-r1.ebuild should have elibc_uclibc in IUSE since it doesn't work either.