Skip to contentSkip to conversation

New: musl buildroot-toolchain does not put libgcc_s.so.1 into place

Buildroot bugzilla at busybox.net 1 participant 8 messages Oct 26, 2014 – Nov 10, 2014

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=7568

Summary: musl buildroot-toolchain does not put libgcc_s.so.1
into place
Product: buildroot
Version: 2014.08
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
AssignedTo: unassigned at buildroot.uclibc.org
ReportedBy: alex+buildroot at digriz.org.uk
CC: buildroot at uclibc.org
Estimated Hours: 0.0

I use the following settings:

BR2_mipsel=y
BR2_TOOLCHAIN_BUILDROOT_MUSL=y

When trying to run non-busybox tools (such as 'nft', nftables) I get a grumbling that libgcc_s.so.1 does not exist.

To workaround the problem, I slipped into my post-build.sh script the following:
----
cp output/host/usr/mipsel-buildroot-linux-musl/sysroot/lib/libgcc_s.so.1 "$1/lib"
./output/host/usr/mipsel-buildroot-linux-musl/bin/strip "$1/lib/libgcc_s.so.1" ln -f -s libgcc_s.so.1 "$1/lib/libgcc_s.so"
----

I vaguely recall there used to be a BR2_GCC_SHARED_LIBGCC that did this for you, but it seems to have gone. Digging around, and if I am following through the makefiles correctly, it looks like the external toolchains do plumb this in. Not sure how this should actually be fixed.

Let me know if you need anything from me to help get this fixed.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 7568] musl buildroot-toolchain does not put libgcc_s.so.1 into place

https://bugs.busybox.net/show_bug.cgi?id=7568

--- Comment #1 from Thomas Petazzoni <[email protected]> 2014-11-07 07:32:59 UTC --- This looks strange because the installation of libgcc_s.so.1 is done by the
gcc-final package, and therefore should not depend on the C library being used.
Here is the relevant snippet of code from gcc-final.mk:

define HOST_GCC_FINAL_INSTALL_LIBGCC

        -cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/libgcc_s* \
                $(STAGING_DIR)/lib/
        -cp -dpf $(HOST_DIR)/usr/$(GNU_TARGET_NAME)/lib*/libgcc_s* \
                $(TARGET_DIR)/lib/

endef

HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_INSTALL_LIBGCC

Obviously, there is a "-" before those commands, so if the command fails for some reason, it will be ignored. Maybe that's the issue here. I'll have to reproduce and see what happens.

Thanks for the report!

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 7568] musl buildroot-toolchain does not put libgcc_s.so.1 into place

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7568

--- Comment #2 from Thomas Petazzoni <[email protected]> 2014-11-09 11:00:39 UTC --- Humm, I'm not able to reproduce your problem. I've built the following
defconfig:

test at build:~/outputs/bug7568$ cat defconfig
BR2_mipsel=y
BR2_TOOLCHAIN_BUILDROOT_MUSL=y

And there is definitely libgcc_s.so.1 installed in the target:

test at build:~/outputs/bug7568$ ls -l target/lib
total 976
lrwxrwxrwx 1 test test 12 Nov 9 10:54 ld-musl-mipsel-sf.so.1 ->
/lib/libc.so

-rwxr-xr-x 1 test test 778344 Nov  9 10:57 libc.so
lrwxrwxrwx 1 test test     13 Nov  9 10:57 libgcc_s.so -> libgcc_s.so.1
-rw-r--r-- 1 test test 216248 Nov  9 10:57 libgcc_s.so.1

Which version of Buildroot are you testing? I'm testing the latest master, as of commit 44f89c38dc72e042d8190f4ca15b26abdb7e69b4.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 7568] musl buildroot-toolchain does not put libgcc_s.so.1 into place

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7568

Thomas Petazzoni <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at buildroot.uclibc |thomas.petazzoni at free-elect
|.org |rons.com

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#4 lore raw

[Buildroot] [Bug 7568] musl buildroot-toolchain does not put libgcc_s.so.1 into place

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7568

--- Comment #3 from Alexander Clouter <[email protected]> 2014-11-09 19:35:23 UTC --- Only tried with the 2014.08 release (fcd720dfcf702d796fbc625b9abc4c06cb848d84) as nothing stood out libgcc wise since, which actually looking again is wrong, as there was the whole move to a two stage gcc build which probably worked all of this?

I'm going to do some rebuilding with newer versions and see also if it is something in my .config. I do though get the same problem with uClibc too, probably have done something silly...

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#5 lore raw

[Buildroot] [Bug 7568] musl buildroot-toolchain does not put libgcc_s.so.1 into place

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7568

--- Comment #4 from Alexander Clouter <[email protected]> 2014-11-09 19:56:43 UTC --- For reference, my full (current) config is:

BR2_mipsel=y
BR2_mips_32r2=y
BR2_DL_DIR="$(CONFIG_DIR)/../dl"
BR2_CCACHE=y
BR2_CCACHE_DIR="$(CONFIG_DIR)/../ccache" BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y BR2_TOOLCHAIN_BUILDROOT_INET_IPV6=y BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
# BR2_UCLIBC_INSTALL_UTILS is not set BR2_ENABLE_LOCALE_PURGE=y
BR2_ENABLE_LOCALE_WHITELIST="C" BR2_TARGET_GENERIC_HOSTNAME="bratwurst" BR2_TARGET_GENERIC_ISSUE="Welcome to BRatWuRsT" BR2_INIT_NONE=y
# BR2_TARGET_GENERIC_GETTY is not set
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set BR2_ROOTFS_OVERLAY="$(CONFIG_DIR)/../overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="$(BRATWURST_BOARD_DIR)/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BRATWURST_BOARD_DIR)/post-image.sh" BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_SAME_AS_HEADERS=y BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BRATWURST_BOARD_DIR)/linux.config" BR2_LINUX_KERNEL_VMLINUZ=y
BR2_PACKAGE_DNSMASQ=y
BR2_PACKAGE_DROPBEAR=y BR2_PACKAGE_DROPBEAR_DISABLE_REVERSEDNS=y
BR2_PACKAGE_PPPD=y
BR2_TARGET_ROOTFS_JFFS2=y
BR2_TARGET_ROOTFS_JFFS2_FLASH_64=y
# BR2_TARGET_ROOTFS_TAR is not set BR2_PACKAGE_EXTERNAL_NFTABLES=y
BR2_PACKAGE_LINUX_ATM=y

Had the problem before adding EXTERNAL_NFTABLES/LINUX_ATM, so I doubt this is causing a problem, but if you need to, you can get those hooks at
https://github.com/jimdigriz/bratwurst

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#6 lore raw

[Buildroot] [Bug 7568] musl buildroot-toolchain does not put libgcc_s.so.1 into place

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7568

--- Comment #5 from Alexander Clouter <[email protected]> 2014-11-09 20:08:43 UTC --- Okay, found the problem.

Not a clean build environment, and I was using the following as a quick and dirty 'clean':

http://lists.busybox.net/pipermail/buildroot/2012-September/058323.html

If I distclean then build, it all works fine.

Really sorry for wasting your time.

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
#7 lore raw

[Buildroot] [Bug 7568] musl buildroot-toolchain does not put libgcc_s.so.1 into place

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=7568

Thomas Petazzoni <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME

--- Comment #6 from Thomas Petazzoni <[email protected]> 2014-11-10 09:15:41 UTC --- (In reply to comment #5)

Quoted 6 lines

Okay, found the problem.

Not a clean build environment, and I was using the following as a quick and dirty 'clean':

http://lists.busybox.net/pipermail/buildroot/2012-September/058323.html

We always rejected merging such "tricks", specifically because they cause people to not do proper full rebuilds when necessary :-)

Quoted 3 lines

If I distclean then build, it all works fine.

Really sorry for wasting your time.

No problem, thanks for investigating on your side, and thanks in the first place for taking the time to report the issues you're seeing.

I'm marking the bug as "worksforme".

Signature · 3 lines
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.