Bug 7424 - undefined reference to `__builtin_thread_pointer'
Summary: undefined reference to `__builtin_thread_pointer'
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2014.08
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
: 7921 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-09-10 18:09 UTC by reddi
Modified: 2016-08-31 19:47 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:


Attachments
attached config file (17.42 KB, application/octet-stream)
2014-09-10 19:18 UTC, reddi
Details
attached config file (40.24 KB, text/plain)
2014-09-11 02:51 UTC, reddi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description reddi 2014-09-10 18:09:50 UTC
/usr/bin/make -j1  HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" silentoldconfig
make[1]: Entering directory `/home/anu/elinux/buildroot-2014.08'
BR2_DEFCONFIG='' KCONFIG_AUTOCONFIG=/home/anu/elinux/buildroot-2014.08/output/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/home/anu/elinux/buildroot-2014.08/output/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/home/anu/elinux/buildroot-2014.08/output/build/buildroot-config/tristate.config BR2_CONFIG=/home/anu/elinux/buildroot-2014.08/.config BR2_EXTERNAL=support/dummy-external /home/anu/elinux/buildroot-2014.08/output/build/buildroot-config/conf --silentoldconfig Config.in
make[1]: Leaving directory `/home/anu/elinux/buildroot-2014.08'
>>> uclibc 0.9.33.2 Building
/usr/bin/make -j9 -C /home/anu/elinux/buildroot-2014.08/output/build/uclibc-0.9.33.2 ARCH="arm" CROSS_COMPILE="/home/anu/elinux/cross_compiler/usr/bin/arm-raspberry-linux-uclibcgnueabihf-" UCLIBC_EXTRA_CFLAGS=" " HOSTCC="/usr/bin/gcc" PREFIX= DEVEL_PREFIX=/ RUNTIME_PREFIX=/ all
make[1]: Entering directory `/home/anu/elinux/buildroot-2014.08/output/build/uclibc-0.9.33.2'
  LD ld-uClibc-0.9.33.2.so
ldso/ldso/ld-uClibc_so.a(ldso.oS): In function `_dl_nothread_init_static_tls':
ldso.c:(.text+0xf00): undefined reference to `__builtin_thread_pointer'
collect2: error: ld returned 1 exit status
make[1]: *** [lib/ld-uClibc.so] Error 1
make[1]: Leaving directory `/home/anu/elinux/buildroot-2014.08/output/build/uclibc-0.9.33.2'
make: *** [/home/anu/elinux/buildroot-2014.08/output/build/uclibc-0.9.33.2/.stamp_built] Error 2
Comment 1 reddi 2014-09-10 18:16:37 UTC
Hi,

please help me out how to resolve this issue.

Thanks
R
Comment 2 Thomas Petazzoni 2014-09-10 18:27:19 UTC
See http://buildroot.org/downloads/manual/manual.html#reporting-bugs. If you don't provide your Buildroot .config file, there's no way for us to understand what configuration you are building, and no way to reproduce your build.

Also, could you make sure to restart the build from scratch by doing "make clean; make". Your report very much looks like a change in the toolchain configuration, without doing a full rebuild. See http://buildroot.org/downloads/manual/manual.html#full-rebuild.
Comment 3 reddi 2014-09-10 19:18:22 UTC
Created attachment 5654 [details]
attached config file
Comment 4 reddi 2014-09-10 19:21:10 UTC
Hi,

Thanks for the early response. i have used "make clean;make" but still i am not able to solve this issue. please let me know if i need to change anything config.

please find the attached config file.
Comment 5 Gustavo Zacarias 2014-09-10 20:19:33 UTC
We need the ".config" file, not Config.in which is a part of buildroot itself.
Comment 6 reddi 2014-09-11 02:51:01 UTC
Created attachment 5660 [details]
attached config file

Hi,

PLease find the attached config file. please let me know if you need further info.

Thanks 
R
Comment 7 Thomas Petazzoni 2014-09-11 21:38:24 UTC
Did you customize your uClibc configuration using "make uclibc-menuconfig" ?
Comment 8 Thomas De Schampheleire 2014-10-20 19:15:24 UTC
Do you still see this problem?
If so, could you answer the question raised in comment #7 and provide your uclibc configuration file too? Thanks.
Comment 9 Thomas Petazzoni 2014-10-26 20:50:40 UTC
I'm able to reproduce the problem, with the config provided by the bug submitter. The corresponding defconfig is:

BR2_arm=y
BR2_arm1176jzf_s=y
BR2_ARM_EABIHF=y
BR2_TOOLCHAIN_BUILDROOT_VENDOR="raspberry"
BR2_KERNEL_HEADERS_3_16=y
BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y
BR2_TOOLCHAIN_BUILDROOT_INET_IPV6=y
BR2_TOOLCHAIN_BUILDROOT_INET_RPC=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
BR2_BINUTILS_VERSION_2_24=y
BR2_GCC_VERSION_4_9_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
# BR2_GCC_ENABLE_TLS is not set
BR2_INIT_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
# BR2_TARGET_ROOTFS_TAR is not set

Most likely, the problem is due to "# BR2_GCC_ENABLE_TLS is not set".
Comment 10 Thomas Petazzoni 2014-10-26 21:01:42 UTC
I confirm, re-enabling TLS support makes the build success.
Comment 11 Thomas Petazzoni 2015-06-03 01:30:23 UTC
*** Bug 7921 has been marked as a duplicate of this bug. ***
Comment 12 Alex Potapenko 2015-09-03 16:41:31 UTC
I have encountered the same issue with Buildroot-2015-08. After some investigation, I found out that
BR2_PTHREADS_NATIVE=y
Switches on
UCLIBC_HAS_THREADS_NATIVE=y
uclibc config, which automatically triggers
UCLIBC_HAS_TLS=y

So, if gcc is built without tls, this leads to the error from this ticket. After switching threads to something different uclibc builds fine without tls in gcc. I thinks, these two options (BR2_PTHREADS_NATIVE and BR2_GCC_ENABLE_TLS) should be connected, since tls has to either be enabled in both gcc and uclibc, or likewise disabled in both.
Comment 13 Alex Potapenko 2015-09-03 16:48:28 UTC
I have encountered the same issue with Buildroot-2015-08. After some investigation, I found out that
BR2_PTHREADS_NATIVE=y
Switches on
UCLIBC_HAS_THREADS_NATIVE=y
uclibc config, which automatically triggers
UCLIBC_HAS_TLS=y

So, if gcc is built without tls, this leads to the error from this ticket. After switching threads to something different uclibc builds fine without tls in gcc. I think, these two options (BR2_PTHREADS_NATIVE and BR2_GCC_ENABLE_TLS) should be connected, since tls has to either be enabled in both gcc and uclibc, or likewise disabled in both.
Comment 14 Thomas Petazzoni 2015-09-03 20:26:41 UTC
(In reply to comment #13)

> So, if gcc is built without tls, this leads to the error from this ticket.
> After switching threads to something different uclibc builds fine without tls
> in gcc. I think, these two options (BR2_PTHREADS_NATIVE and BR2_GCC_ENABLE_TLS)
> should be connected, since tls has to either be enabled in both gcc and uclibc,
> or likewise disabled in both.

Thanks for the report. Our plan is to make the TLS option no longer visible, and make TLS mandatory when thread support is enabled. If you want to tackle that, don't hesitate to send a patch!
Comment 15 Alex Potapenko 2015-09-04 10:50:15 UTC
(In reply to comment #14)
> Thanks for the report. Our plan is to make the TLS option no longer visible,
> and make TLS mandatory when thread support is enabled. If you want to tackle
> that, don't hesitate to send a patch!

I think forcing TLS is a good idea, and BR2_PTHREADS_NATIVE should be the only threads option (if enabled) for uclibc, as with uclibc-ng.

If I had known about TLS when I was building my original toolchains for my Optware-ng project using Buildroot-2015-02, I would have enabled it. For now, until I eventually migrate to uclibc-ng (plan to create new feeds and abandon old ones), I have to make sure that upgraded toolchains are compatible with the old ones, so have to disable TLS.
Comment 16 Thomas Petazzoni 2016-08-31 19:47:17 UTC
Fixed by https://git.buildroot.org/buildroot/commit/?h=next&id=1bd02bc230e1b3b22ca3eb23fb3dcb91b878283a, which simply removes the option to enable/disable TLS support. Now TLS support is automatically enabled or disable in gcc depending on the selected C library and its configuration.