Skip to contentSkip to conversation

ipkg: needs MMU

PATCH New Baruch Siach 3 participants 10 messages Jul 26, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipkg: needs MMU

Fixes:
http://autobuild.buildroot.net/results/6cf/6cf75e08795d9ab194ce4e882c0f4858bad979c3/
http://autobuild.buildroot.net/results/964/964d8f694bc7d05b35411eabfbadf40bbf6337ae/
http://autobuild.buildroot.net/results/0f2/0f2cddf89af3ad4330556acd04ab6cb080370e24/

---
 package/ipkg/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/ipkg/Config.in +1 -0
index 4b2078d9cd70..d93e1d17b3dd 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_IPKG
 	bool "ipkg"
+	depends on BR2_USE_MMU # fork()
 	help
 	  The Itsy Package Installer from handhelds.org
 
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/1 ipkg: needs MMU

Hello,

Quoted 15 lines · Baruch Siach

Fixes:
http://autobuild.buildroot.net/results/6cf/6cf75e08795d9ab194ce4e882c0f4858bad979c3/
http://autobuild.buildroot.net/results/964/964d8f694bc7d05b35411eabfbadf40bbf6337ae/
http://autobuild.buildroot.net/results/0f2/0f2cddf89af3ad4330556acd04ab6cb080370e24/

---
 package/ipkg/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/ipkg/Config.in +0 -0
index 4b2078d9cd70..d93e1d17b3dd 100644

package/ipkg/Config.in line 3

Quoted 3 lines
package/ipkg/Config.in +1 -0
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_IPKG
 	bool "ipkg"
+	depends on BR2_USE_MMU # fork()

I think this needs more investigation, because:

BR2_bfin=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_IPKG=y
# BR2_TARGET_ROOTFS_TAR is not set

which is a noMMU configuration, is able to build ipkg just fine.

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 ipkg: needs MMU

Hello,

Sorry, last e-mail sent mistakenly.

Quoted 10 lines · Thomas Petazzoni

I think this needs more investigation, because:

BR2_bfin=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_IPKG=y
# BR2_TARGET_ROOTFS_TAR is not set

which is a noMMU configuration, is able to build ipkg just fine.

I was indeed a bit surprised to see this patch: we have been having Blackfin configurations for a long time in the autobuilders, and we never had to add a BR2_USE_MMU dependency on this package.

So I believe there's something a bit more subtle going on here.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/1 ipkg: needs MMU

Hi Thomas,

Quoted 10 lines · Thomas Petazzoni
Quoted 9 lines · Thomas Petazzoni

I think this needs more investigation, because:

BR2_bfin=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_IPKG=y
# BR2_TARGET_ROOTFS_TAR is not set

Quoted 7 lines
Quoted 1 line

which is a noMMU configuration, is able to build ipkg just fine.

I was indeed a bit surprised to see this patch: we have been having Blackfin configurations for a long time in the autobuilders, and we never had to add a BR2_USE_MMU dependency on this package.

So I believe there's something a bit more subtle going on here.

Right. It's this code from libbb/libbb.h:

/* Cope with mmu-less systems somewhat gracefully */ #if defined(__UCLIBC__) && !defined(__ARCH_HAS_MMU__)
#define fork vfork
#endif

This breaks musl that does not define __UCLIBC__. I posted an updated patch to uses HAVE_FORK instead.

Is there anyone actually using this package anyway? Even its homepage is not accessible here (handhelds.org does not resolve).

Thanks for reviewing,
baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#4 lore raw

PATCH 1/1 ipkg: needs MMU

Hello,

Quoted 9 lines · Baruch Siach

Right. It's this code from libbb/libbb.h:

/* Cope with mmu-less systems somewhat gracefully */ #if defined(__UCLIBC__) && !defined(__ARCH_HAS_MMU__)
#define fork vfork
#endif

This breaks musl that does not define __UCLIBC__. I posted an updated patch to uses HAVE_FORK instead.

We don't use musl on any noMMU platform today, so this certainly cannot explain failures like:

http://autobuild.buildroot.net/results/6cf/6cf75e08795d9ab194ce4e882c0f4858bad979c3/

(which was the first one mentioned in your commit log), since this failure happens with uClibc.

Looking at http://autobuild.buildroot.net/?reason=ipkg-0.99.163, I see (looking only at the failures since the beginning of 2016) :

* Numerous failures on ARM noMMU (uClibc)
* Two failures on m68k noMMU (uClibc)
* An old failure on i686 due to download issue

i.e, none of the failures are caused by a musl-related build.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/1 ipkg: needs MMU

Hi Thomas,

Quoted 19 lines · Thomas Petazzoni
Quoted 9 lines · Baruch Siach

Right. It's this code from libbb/libbb.h:

/* Cope with mmu-less systems somewhat gracefully */ #if defined(__UCLIBC__) && !defined(__ARCH_HAS_MMU__)
#define fork vfork
#endif

This breaks musl that does not define __UCLIBC__. I posted an updated patch to uses HAVE_FORK instead.

We don't use musl on any noMMU platform today, so this certainly cannot explain failures like:

http://autobuild.buildroot.net/results/6cf/6cf75e08795d9ab194ce4e882c0f4858bad979c3/

(which was the first one mentioned in your commit log), since this failure happens with uClibc.

Quoted 8 lines

Looking at http://autobuild.buildroot.net/?reason=ipkg-0.99.163, I see (looking only at the failures since the beginning of 2016) :

* Numerous failures on ARM noMMU (uClibc)
* Two failures on m68k noMMU (uClibc)
* An old failure on i686 due to download issue

i.e, none of the failures are caused by a musl-related build.

You are right of course, forgive my sloppiness. To be correct for uClibc the code should test for __ARCH_USE_MMU__ instead of __ARCH_HAS_MMU__. But testing HAVE_FORK is better, I thing, since it also covers other hypothetical MMU-less C libraries.

I'll resend the patch with a correct description.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#6 lore raw

PATCH 1/1 ipkg: needs MMU

Hello,

Quoted 4 lines · Baruch Siach

You are right of course, forgive my sloppiness. To be correct for uClibc the code should test for __ARCH_USE_MMU__ instead of __ARCH_HAS_MMU__. But testing HAVE_FORK is better, I thing, since it also covers other hypothetical MMU-less C libraries.

Using HAVE_FORK indeed seems better. However, can you verify that it actually works for MMU-capable platforms?

What worries me is that the code in libbb/ originally comes from Busybox, which doesn't use autoconf. HAVE_FORK is a #define value defined by ipkg's autoconf configure script, in config.h, and I'm not sure if the libbb/ code includes config.h.

So, please make sure that HAVE_FORK is really taken into account when building on MMU-capable platforms by adding some #error in the #if defined(HAVE_FORK) test in the libbb code that you're changing.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw

PATCH 1/1 ipkg: needs MMU

Hi Thomas,

Quoted 9 lines · Thomas Petazzoni
Quoted 4 lines · Baruch Siach

You are right of course, forgive my sloppiness. To be correct for uClibc the code should test for __ARCH_USE_MMU__ instead of __ARCH_HAS_MMU__. But testing HAVE_FORK is better, I thing, since it also covers other hypothetical MMU-less C libraries.

Using HAVE_FORK indeed seems better. However, can you verify that it actually works for MMU-capable platforms?

Quoted 8 lines

What worries me is that the code in libbb/ originally comes from Busybox, which doesn't use autoconf. HAVE_FORK is a #define value defined by ipkg's autoconf configure script, in config.h, and I'm not sure if the libbb/ code includes config.h.

So, please make sure that HAVE_FORK is really taken into account when building on MMU-capable platforms by adding some #error in the #if defined(HAVE_FORK) test in the libbb code that you're changing.

I verified that config.h macros are defined in libbb.h before posting the last patch, by using another defined macros. I repeated this test as you suggested, with HAVE_FORK and the current br-arm-full.config, just to be sure. The #error triggers as expected in both tests.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#8 lore raw

PATCH 1/1 ipkg: needs MMU

Hello,

Quoted 4 lines · Baruch Siach

I verified that config.h macros are defined in libbb.h before posting the last patch, by using another defined macros. I repeated this test as you suggested, with HAVE_FORK and the current br-arm-full.config, just to be sure. The #error triggers as expected in both tests.

Excellent, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#9 lore raw

PATCH 1/1 ipkg: needs MMU

In reply to Baruch Siach
Quoted 18 lines · Baruch Siach

Hi Thomas,

Quoted 12 lines · Thomas Petazzoni
Quoted 9 lines · Baruch Siach

Right. It's this code from libbb/libbb.h:

/* Cope with mmu-less systems somewhat gracefully */ #if defined(__UCLIBC__) && !defined(__ARCH_HAS_MMU__)
#define fork vfork
#endif

This breaks musl that does not define __UCLIBC__. I posted an updated patch to uses HAVE_FORK instead.

We don't use musl on any noMMU platform today,

SH2 fdpic is available in musl, so in theory you can start :)

Quoted 15 lines
Quoted 15 lines

so this certainly cannot
explain failures like:

http://autobuild.buildroot.net/results/6cf/6cf75e08795d9ab194ce4e882c0f4858bad979c3/

(which was the first one mentioned in your commit log), since this failure happens with uClibc.

Looking at http://autobuild.buildroot.net/?reason=ipkg-0.99.163, I see (looking only at the failures since the beginning of 2016) :

* Numerous failures on ARM noMMU (uClibc)
* Two failures on m68k noMMU (uClibc)
* An old failure on i686 due to download issue

Quoted 6 lines
Quoted 1 line

i.e, none of the failures are caused by a musl-related build.

You are right of course, forgive my sloppiness. To be correct for uClibc the code should test for __ARCH_USE_MMU__ instead of __ARCH_HAS_MMU__. But testing HAVE_FORK is better, I thing, since it also covers other hypothetical MMU-less C libraries.

ARCH_USE_MMU seems to be sufficient unless there is any other kind of memory management system that can redefine fork behavior.

is fork the only difference when it comes to nommu, I guess not. So why create an extra check just for fork.

Quoted 5 lines

I'll resend the patch with a correct description.

baruch

Quoted 8 lines

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160726/f77e1d15/attachment.asc>