Skip to contentSkip to conversation

check-bin-arch: skip /lib/modules to allow 32-bit userland on 64-bit arch

PATCH New Thomas De Schampheleire 3 participants 3 messages Feb 20, 2018 – Feb 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 check-bin-arch: skip /lib/modules to allow 32-bit userland on 64-bit arch

The script check-bin-arch fails as follows on a config for PowerPC e6500 (64-bit CPU) with BR2_ARCH="powerpc" (32-bit userland desired):

ERROR: architecture for "/lib/modules/..../lib/libcrc32c.ko"
is "PowerPC64", should be "PowerPC"

This situation is perfectly acceptable: the kernel is 64-bit and so are its modules, even though userland is 32-bit.

To keep check-bin-arch and its caller simple, just skip /lib/modules/ entirely, like is done for /lib/firmware and some others.

---
 support/scripts/check-bin-arch | 8 ++++++++
 1 file changed, 8 insertions(+)
support/scripts/check-bin-arch +8 -0
index 887b6613cd..f6a4569c62 100755
@@ -29,6 +29,14 @@ while read f; do
 		continue
 	fi
 
+	# Skip kernel modules
+	# When building a 32-bit userland on 64-bit architectures, the kernel
+	# and its modules may still be 64-bit. To keep the basic
+	# check-bin-arch logic simple, just skip this directory.
+	if [[ "${f}" =~ ^/lib/modules/.* ]]; then
+		continue
+	fi
+
 	# Skip files in /usr/share, several packages (qemu,
 	# pru-software-support) legitimately install ELF binaries that
 	# are not for the target architecture
Signature · 1 line
2.13.6
#1 lore raw

PATCH 1/1 check-bin-arch: skip /lib/modules to allow 32-bit userland on 64-bit arch

Thomas, All,

On 2018-02-20 12:11 +0100, Thomas De Schampheleire spake thusly:

Quoted 6 lines

The script check-bin-arch fails as follows on a config for PowerPC e6500 (64-bit CPU) with BR2_ARCH="powerpc" (32-bit userland desired):

ERROR: architecture for "/lib/modules/..../lib/libcrc32c.ko"
is "PowerPC64", should be "PowerPC"

Quoted 7 lines

This situation is perfectly acceptable: the kernel is 64-bit and so are its modules, even though userland is 32-bit.

To keep check-bin-arch and its caller simple, just skip /lib/modules/ entirely, like is done for /lib/firmware and some others.

Regards,
Yann E. MORIN.

Quoted 30 lines
---
 support/scripts/check-bin-arch | 8 ++++++++
 1 file changed, 8 insertions(+)
support/scripts/check-bin-arch +8 -0
index 887b6613cd..f6a4569c62 100755
@@ -29,6 +29,14 @@ while read f; do
 		continue
 	fi
 
+	# Skip kernel modules
+	# When building a 32-bit userland on 64-bit architectures, the kernel
+	# and its modules may still be 64-bit. To keep the basic
+	# check-bin-arch logic simple, just skip this directory.
+	if [[ "${f}" =~ ^/lib/modules/.* ]]; then
+		continue
+	fi
+
 	# Skip files in /usr/share, several packages (qemu,
 	# pru-software-support) legitimately install ELF binaries that
 	# are not for the target architecture
Signature · 6 lines
2.13.6

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 check-bin-arch: skip /lib/modules to allow 32-bit userland on 64-bit arch

In reply to Thomas De Schampheleire

Hello,

Quoted 9 lines · Thomas De Schampheleire

The script check-bin-arch fails as follows on a config for PowerPC e6500 (64-bit CPU) with BR2_ARCH="powerpc" (32-bit userland desired):

ERROR: architecture for "/lib/modules/..../lib/libcrc32c.ko"
is "PowerPC64", should be "PowerPC"

This situation is perfectly acceptable: the kernel is 64-bit and so are its modules, even though userland is 32-bit.

Quoted 7 lines

To keep check-bin-arch and its caller simple, just skip /lib/modules/ entirely, like is done for /lib/firmware and some others.

---
 support/scripts/check-bin-arch | 8 ++++++++
 1 file changed, 8 insertions(+)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com