Skip to contentSkip to conversation

package/busybox: Fallback to -g2 in if -g3 is enabled.

PATCH In review Dmitry Chestnykh 2 participants 2 messages Apr 16, 2024 – May 9, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/busybox: Fallback to -g2 in if -g3 is enabled.

Linker process hangs if busybox was built with -g3, so fallback to -g2 in this case.
The issue can be reproduced for example with qemu_aarch64_virt_defconfig by selecting BR2_DEBUG_3.

---
 package/busybox/busybox.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/busybox/busybox.mk +5 -0
index eb5e7ad922..e9a7fce554 100644
@@ -18,6 +18,11 @@ BUSYBOX_IGNORE_CVES += CVE-2022-28391
 BUSYBOX_CFLAGS = \
 	$(TARGET_CFLAGS)
 
+# Linking hangs with -g3, fallback to -g2
+ifeq ($(BR2_DEBUG_3),y)
+       BUSYBOX_CFLAGS += -g2
+endif
+
 BUSYBOX_LDFLAGS = \
 	$(TARGET_LDFLAGS)
 
Signature · 6 lines
2.44.0

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

Hello Dmitry,

Quoted 6 lines · On Tue, 16 Apr 2024 22:27:36 +0300 Dmitry Chestnykh <[email protected]>…

Linker process hangs if busybox was built with -g3, so fallback to -g2 in this case.
The issue can be reproduced for example with qemu_aarch64_virt_defconfig by selecting BR2_DEBUG_3.

Thanks for your patch. However, this is more of a workaround than a real fix, indeed the linker shouldn't hang at -g3.

Does this happen on all architectures? Does it happen regardless of the compiler optimization level selected? Did you report the bug to upstream binutils?

Thanks a lot,

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