Skip to contentSkip to conversation

package:uclibc-ng:enable gnu hash for non mips platforms

PATCH In review Hans Ulli Kroll 2 participants 2 messages Sep 8, 2024 – Oct 28, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package:uclibc-ng:enable gnu hash for non mips platforms

In toolchain-wrapper.mk we use both sysv and gnu hash style for all platforms, except MIPS which uses sysv only.

However uClibc-ng has some extra knob to enable gnu hash via Kconfig, which is set by default off.

This leads to wrong symbol resolving on armv5 and output of devices, here on Pogoplug 4 detected with lcpci 3.10.

---
 package/uclibc/uclibc.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/uclibc/uclibc.mk +7 -0
index de834bac4f..f48ebe6a16 100644
@@ -205,6 +205,12 @@ define UCLIBC_X86_TYPE_CONFIG
 endef
 endif
 
+ifneq ($(UCLIBC_TARGET_ARCH),mips)
+define UCLIBC_LDSO_GNU_HASH_SUPPORT
+	$(call KCONFIG_ENABLE_OPT,LDSO_GNU_HASH_SUPPORT)
+endef
+endif
+
 #
 # Debug
 #
@@ -403,6 +409,7 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
 	$(UCLIBC_SH_TYPE_CONFIG)
 	$(UCLIBC_SPARC_TYPE_CONFIG)
 	$(UCLIBC_POWERPC_TYPE_CONFIG)
+	$(UCLIBC_LDSO_GNU_HASH_SUPPORT)
 	$(UCLIBC_X86_TYPE_CONFIG)
 	$(UCLIBC_DEBUG_CONFIG)
 	$(UCLIBC_ENDIAN_CONFIG)
Signature · 6 lines
2.46.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello Hans,

Thanks for your patch!

Quoted 2 lines · On Sun, 8 Sep 2024 10:36:36 +0200 Hans Ulli Kroll <[email protected]> wrote:

In toolchain-wrapper.mk we use both sysv and gnu hash style for all platforms, except MIPS which uses sysv only.

The logic in toolchain-wrapper.mk regarding --hash-style is about building the toolchain-wrapper executable for the host. So I really don't see how this can be related to the uClibc library built for the target.

Quoted 5 lines

However uClibc-ng has some extra knob to enable gnu hash via Kconfig, which is set by default off.

This leads to wrong symbol resolving on armv5 and output of devices, here on Pogoplug 4 detected with lcpci 3.10.

In principle, I have nothing against your patch, but I must say I don't really understand why it solves your problem, and what is the impact/consequences.

Hans, do you have more details on the problems you are seeing?

Waldemar, any input?

As far as I can see from a quick look, we default to --hash-style=both, as far as I can see in the Busybox binary:

  [ 3] .hash             HASH            00000190 000190 000a10 04   A  5   0  4
  [ 4] .gnu.hash         GNU_HASH        00000ba0 000ba0 000018 04   A  5   0  4

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot