Skip to contentSkip to conversation

package/mpg123: remove MMU dependency

PATCH Applied Bernd Kuhls 2 participants 3 messages Sep 26 – Oct 10

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/mpg123: remove MMU dependency

Buildroot commit f0862592b3caf5bc9cd347fd29634673cfbbabd7 added the dependency to BR2_USE_MMU in 2014.
Upstream made fork() optional in 2022:
https://github.com/madebr/mpg123/commit/91f75fc026e37d88d25229b81c58bcf8d6d2a8eb

This change reveals a previously hidden build error with the toolchain bootlin-armv7m-uclibc:

src/libmpg123/synth_arm_accurate.S: Assembler messages:
src/libmpg123/synth_arm_accurate.S:22: Error: selected processor does
not support ARM opcodes
src/libmpg123/synth_arm_accurate.S:31: Error: attempt to use an ARM
instruction on a Thumb-only processor --
`stmfd sp!,{r4,r5,r6,r7,r8,r9,r10,r11,lr}'
src/libmpg123/synth_arm_accurate.S:33: Error: attempt to use an ARM
instruction on a Thumb-only processor -- `add r0,r0,#64'
[...]

To fix the problem we limit ARM code to !BR2_ARM_INSTRUCTIONS_THUMB2.

---
Gitlab pipelines for mpg123 passed:
https://gitlab.com/bkuhls/buildroot/-/commits/85dfb60e8f4fbe0caa74674d91c54400c288ec10

Gitlab pipelines for squeezelite passed:
https://gitlab.com/bkuhls/buildroot/-/commits/f5549196dd9e923e3c83e809a5e170da44551c75

with the exception of an unrelated build error at bootlin-x86-i686-musl/build/ffmpeg-6.1.5/.stamp_built

/builds/bkuhls/buildroot/br-test-pkg/bootlin-x86-i686-musl/host/opt/ext-toolchain/bin/../lib/gcc/i686-buildroot-linux-musl/15.3.0/../../../../i686-buildroot-linux-musl/bin/ld:
read-only segment has dynamic relocations
collect2: error: ld returned 1 exit status

 package/mpg123/Config.in      | 1 -
 package/mpg123/mpg123.mk      | 2 +-
 package/squeezelite/Config.in | 2 --
 3 files changed, 1 insertion(+), 4 deletions(-)
package/mpg123/Config.in +0 -1
index 73ca1c740c..8cbc3a4758 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_MPG123
 	bool "mpg123"
-	depends on BR2_USE_MMU # fork - in the application
 	help
 	  Fast, free and portable MPEG audio player for Unix. It
 	  supports MPEG 1.0/2.0 layers 1, 2 and 3.
package/mpg123/mpg123.mk +1 -1
index 17445395ae..0318cb4810 100644
@@ -26,7 +26,7 @@ ifeq ($(BR2_aarch64),y)
 MPG123_CPU = aarch64
 endif
 
-ifeq ($(BR2_arm),y)
+ifeq ($(BR2_arm)x$(BR2_ARM_INSTRUCTIONS_THUMB2),yx)
 ifeq ($(or $(BR2_ARM_CPU_HAS_NEON),$(BR2_ARM_CPU_HAS_VFPV2)),y)
 MPG123_CPU = arm_fpu
 else
package/squeezelite/Config.in +0 -2
index a034759143..0bdc43ce6c 100644
@@ -2,7 +2,6 @@ config BR2_PACKAGE_SQUEEZELITE
 	bool "squeezelite"
 	depends on BR2_USE_WCHAR # flac
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
-	depends on BR2_USE_MMU # mpg123
 	depends on !BR2_STATIC_LIBS # dlopen
 	select BR2_PACKAGE_ALSA_LIB
 	select BR2_PACKAGE_ALSA_LIB_MIXER
@@ -44,6 +43,5 @@ config BR2_PACKAGE_SQUEEZELITE_VISEXPORT
 endif
 
 comment "squeezelite needs a toolchain w/ wchar, NPTL, dynamic library"
-	depends on BR2_USE_MMU
 	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS_NPTL \
 		|| BR2_STATIC_LIBS
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 8 lines · Bernd Kuhls

Buildroot commit f0862592b3caf5bc9cd347fd29634673cfbbabd7 added the dependency to BR2_USE_MMU in 2014.
Upstream made fork() optional in 2022:
https://github.com/madebr/mpg123/commit/91f75fc026e37d88d25229b81c58bcf8d6d2a8eb

This change reveals a previously hidden build error with the toolchain bootlin-armv7m-uclibc:

Quoted 9 lines

src/libmpg123/synth_arm_accurate.S: Assembler messages:
src/libmpg123/synth_arm_accurate.S:22: Error: selected processor does
not support ARM opcodes
src/libmpg123/synth_arm_accurate.S:31: Error: attempt to use an ARM
instruction on a Thumb-only processor --
`stmfd sp!,{r4,r5,r6,r7,r8,r9,r10,r11,lr}'
src/libmpg123/synth_arm_accurate.S:33: Error: attempt to use an ARM
instruction on a Thumb-only processor -- `add r0,r0,#64'
[...]

So the ARM support needs support for ARM instructions.

Quoted 1 line

To fix the problem we limit ARM code to !BR2_ARM_INSTRUCTIONS_THUMB2.

Therefore it is most logical to require BR2_ARM_CPU_HAS_ARM than !BR2_ARM_INSTRUCTIONS_THUMB2.

So I've changed:

Quoted 1 line

+ifeq ($(BR2_arm)x$(BR2_ARM_INSTRUCTIONS_THUMB2),yx)

to:

ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_ARM),yy)

and applied. Thanks!

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
#2 lore raw
In reply to Bernd Kuhls

In reply of:

Quoted 18 lines

Buildroot commit f0862592b3caf5bc9cd347fd29634673cfbbabd7 added the dependency to BR2_USE_MMU in 2014.
Upstream made fork() optional in 2022:
https://github.com/madebr/mpg123/commit/91f75fc026e37d88d25229b81c58bcf8d6d2a8eb

This change reveals a previously hidden build error with the toolchain bootlin-armv7m-uclibc:

src/libmpg123/synth_arm_accurate.S: Assembler messages:
src/libmpg123/synth_arm_accurate.S:22: Error: selected processor does
not support ARM opcodes
src/libmpg123/synth_arm_accurate.S:31: Error: attempt to use an ARM
instruction on a Thumb-only processor --
`stmfd sp!,{r4,r5,r6,r7,r8,r9,r10,r11,lr}'
src/libmpg123/synth_arm_accurate.S:33: Error: attempt to use an ARM
instruction on a Thumb-only processor -- `add r0,r0,#64'
[...]

Quoted 3 lines

To fix the problem we limit ARM code to !BR2_ARM_INSTRUCTIONS_THUMB2.

Applied to 2025.02.x & 2026.08.x. Thanks

Quoted 69 lines

---
Gitlab pipelines for mpg123 passed:
https://gitlab.com/bkuhls/buildroot/-/commits/85dfb60e8f4fbe0caa74674d91c54400c288ec10

Gitlab pipelines for squeezelite passed:
https://gitlab.com/bkuhls/buildroot/-/commits/f5549196dd9e923e3c83e809a5e170da44551c75

with the exception of an unrelated build error at bootlin-x86-i686-musl/build/ffmpeg-6.1.5/.stamp_built

/builds/bkuhls/buildroot/br-test-pkg/bootlin-x86-i686-musl/host/opt/ext-toolchain/bin/../lib/gcc/i686-buildroot-linux-musl/15.3.0/../../../../i686-buildroot-linux-musl/bin/ld:
read-only segment has dynamic relocations
collect2: error: ld returned 1 exit status

 package/mpg123/Config.in      | 1 -
 package/mpg123/mpg123.mk      | 2 +-
 package/squeezelite/Config.in | 2 --
 3 files changed, 1 insertion(+), 4 deletions(-)
package/mpg123/Config.in +0 -1
index 73ca1c740c..8cbc3a4758 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_MPG123
 	bool "mpg123"
-	depends on BR2_USE_MMU # fork - in the application
 	help
 	  Fast, free and portable MPEG audio player for Unix. It
 	  supports MPEG 1.0/2.0 layers 1, 2 and 3.
package/mpg123/mpg123.mk +1 -1
index 17445395ae..0318cb4810 100644
@@ -26,7 +26,7 @@ ifeq ($(BR2_aarch64),y)
 MPG123_CPU = aarch64
 endif
 
-ifeq ($(BR2_arm),y)
+ifeq ($(BR2_arm)x$(BR2_ARM_INSTRUCTIONS_THUMB2),yx)
 ifeq ($(or $(BR2_ARM_CPU_HAS_NEON),$(BR2_ARM_CPU_HAS_VFPV2)),y)
 MPG123_CPU = arm_fpu
 else
package/squeezelite/Config.in +0 -2
index a034759143..0bdc43ce6c 100644
@@ -2,7 +2,6 @@ config BR2_PACKAGE_SQUEEZELITE
 	bool "squeezelite"
 	depends on BR2_USE_WCHAR # flac
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
-	depends on BR2_USE_MMU # mpg123
 	depends on !BR2_STATIC_LIBS # dlopen
 	select BR2_PACKAGE_ALSA_LIB
 	select BR2_PACKAGE_ALSA_LIB_MIXER
@@ -44,6 +43,5 @@ config BR2_PACKAGE_SQUEEZELITE_VISEXPORT
 endif
 
 comment "squeezelite needs a toolchain w/ wchar, NPTL, dynamic library"
-	depends on BR2_USE_MMU
 	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS_NPTL \
 		|| BR2_STATIC_LIBS
Signature · 6 lines
2.47.3

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

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