Skip to contentSkip to conversation

Support combination of MUSL and x32 build

PATCH New [email protected] 1 participant 8 messages Jul 7, 2017

lore
Share & tools
lore
#0 lore raw

v2 cover Support combination of MUSL and x32 build

From: sweeaun <[email protected]>

Modified infrastructure (bbclass) and fixed bugs on multiple recipes to enable combination of MUSL and x32 build.

The following changes since commit 754c03006943a219ffd417c36ab909b464f57f67:

local.conf.sample: drop image-swab reference (2017-07-06 15:03:10 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib sweeaun/muslx32_patch2
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=sweeaun/muslx32_patch2

sweeaun (7):
insane.bbclass: Support musl-x32
siteinfo.bbclass: Support musl-x32
gnu-efi: Support musl-x32 build
grub-efi: Support musl-x32
openssl: Support musl-x32 build
perl: Support musl-x32 build
libffi: Support musl-x32 build

 meta/classes/insane.bbclass                        |  5 +++-
 meta/classes/siteinfo.bbclass                      |  2 ++
 meta/recipes-bsp/gnu-efi/gnu-efi_3.0.5.bb          |  1 +
 meta/recipes-bsp/grub/grub-efi_2.02.bb             |  2 ++
 meta/recipes-connectivity/openssl/openssl.inc      |  5 ++--
 meta/recipes-devtools/perl/perl_5.24.1.bb          |  2 +-
 .../0001-libffi-Support-musl-x32-build.patch       | 30 ++++++++++++++++++++++
 meta/recipes-support/libffi/libffi_3.2.1.bb        |  1 +
 8 files changed, 44 insertions(+), 4 deletions(-)
 create mode 100644 meta/recipes-support/libffi/libffi/0001-libffi-Support-musl-x32-build.patch
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/7 insane.bbclass: Support musl-x32

From: sweeaun <[email protected]>

Added musl-x32 elf header into dictionary.

---
 meta/classes/insane.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta/classes/insane.bbclass +4 -1
index 7680a59..479d39c 100644
@@ -150,6 +150,9 @@ def package_qa_get_machine_dict(d):
             "linux-gnux32" :       {
                         "x86_64":     (62,     0,    0,          True,          32),
                       },
+            "linux-muslx32" :       {
+                        "x86_64":     (62,     0,    0,          True,          32),
+                      },
             "linux-gnun32" :       {
                         "mips64":       ( 8,     0,    0,          False,         32),
                         "mips64el":     ( 8,     0,    0,          True,          32),
@@ -488,7 +491,7 @@ def package_qa_check_arch(path,name,d, elf, messages):
 
     # Check the architecture and endiannes of the binary
     is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \
-            (target_os == "linux-gnux32" or re.match('mips64.*32', d.getVar('DEFAULTTUNE')))
+            (target_os == "linux-gnux32" or target_os == "linux-muslx32"  or re.match('mips64.*32', d.getVar('DEFAULTTUNE')))
     if not ((machine == elf.machine()) or is_32):
         package_qa_add_message(messages, "arch", "Architecture did not match (%s, expected %s) on %s" % \
                  (oe.qa.elf_machine_to_string(elf.machine()), oe.qa.elf_machine_to_string(machine), package_qa_clean_path(path,d)))
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/7 siteinfo.bbclass: Support musl-x32

In reply to [email protected]

From: sweeaun <[email protected]>

Modified targetinfo and osinfo to support musl-x32.

---
 meta/classes/siteinfo.bbclass | 2 ++
 1 file changed, 2 insertions(+)
meta/classes/siteinfo.bbclass +2 -0
index 90ea5ba..20b4704 100644
@@ -63,6 +63,7 @@ def siteinfo_data(d):
         "linux-gnueabi": "common-linux common-glibc",
         "linux-gnuspe": "common-linux common-glibc",
         "linux-musl": "common-linux common-musl",
+        "linux-muslx32": "common-linux common-musl",
         "linux-musleabi": "common-linux common-musl",
         "linux-muslspe": "common-linux common-musl",
         "uclinux-uclibc": "common-uclibc",
@@ -99,6 +100,7 @@ def siteinfo_data(d):
         "x86_64-darwin9": "bit-64",
         "x86_64-linux": "bit-64",
         "x86_64-linux-musl": "x86_64-linux bit-64",
+        "x86_64-linux-muslx32": "bit-32 ix86-common x32-linux",
         "x86_64-elf": "bit-64",
         "x86_64-linux-gnu": "bit-64 x86_64-linux",
         "x86_64-linux-gnux32": "bit-32 ix86-common x32-linux",
Signature · 1 line
2.7.4
#3 lore raw

PATCH v2 3/7 gnu-efi: Support musl-x32 build

In reply to [email protected]

From: sweeaun <[email protected]>

To build 64-bit binaries for musl-x32.

---
 meta/recipes-bsp/gnu-efi/gnu-efi_3.0.5.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-bsp/gnu-efi/gnu-efi_3.0.5.bb +1 -0
index d6f9f53..7346737 100644
@@ -53,6 +53,7 @@ FILES_${PN} += "${libdir}/*.lds"
 
 # 64-bit binaries are expected for EFI when targeting X32
 INSANE_SKIP_${PN}-dev_append_linux-gnux32 = " arch"
+INSANE_SKIP_${PN}-dev_append_linux-muslx32 = " arch"
 
 BBCLASSEXTEND = "native"
 
Signature · 1 line
2.7.4
#4 lore raw

PATCH v2 4/7 grub-efi: Support musl-x32

In reply to [email protected]

From: sweeaun <[email protected]>

To build 64-bit binaries for musl-x32.

---
 meta/recipes-bsp/grub/grub-efi_2.02.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-bsp/grub/grub-efi_2.02.bb +2 -0
index 9d494d5..b949beb 100644
@@ -65,5 +65,7 @@ FILES_${PN} += "${libdir}/grub/${GRUB_TARGET}-efi \
 # 64-bit binaries are expected for the bootloader with an x32 userland
 INSANE_SKIP_${PN}_append_linux-gnux32 = " arch"
 INSANE_SKIP_${PN}-dbg_append_linux-gnux32 = " arch"
+INSANE_SKIP_${PN}_append_linux-muslx32 = " arch"
+INSANE_SKIP_${PN}-dbg_append_linux-muslx32 = " arch"
 
 BBCLASSEXTEND = "native"
Signature · 1 line
2.7.4
#5 lore raw

PATCH v2 5/7 openssl: Support musl-x32 build

In reply to [email protected]

From: sweeaun <[email protected]>

Support musl-x32 build which to build openssl with 32 bits.

---
 meta/recipes-connectivity/openssl/openssl.inc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-connectivity/openssl/openssl.inc +3 -2
index ce295e8..a56bd6e 100644
@@ -66,7 +66,8 @@ do_configure () {
 	case $os in
 	linux-gnueabi |\
 	linux-gnuspe |\
-	linux-musl*)
+	linux-musleabi |\
+	linux-muslspe)
 		os=linux
 		;;
 		*)
@@ -98,7 +99,7 @@ do_configure () {
 	linux-i686)
 		target=debian-i386-i686/cmov
 		;;
-	linux-gnux32-x86_64)
+	linux-gnux32-x86_64 | linux-muslx32-x86_64 )
 		target=linux-x32
 		;;
 	linux-gnu64-x86_64)
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 6/7 perl: Support musl-x32 build

In reply to [email protected]

From: sweeaun <[email protected]>

Existing musl fixups in perl recipe doesn't cover linux-muslx32. This is fixed to support musl-x32 build.

---
 meta/recipes-devtools/perl/perl_5.24.1.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/perl/perl_5.24.1.bb +1 -1
index b0ceb84..95d9694 100644
@@ -125,7 +125,7 @@ do_configure() {
         done
 
         # Fixups for musl
-        if [ "${TARGET_OS}" = "linux-musl" -o "${TARGET_OS}" = "linux-musleabi" ]; then
+        if [ "${TARGET_OS}" = "linux-musl" -o "${TARGET_OS}" = "linux-musleabi" -o "${TARGET_OS}" = "linux-muslx32" ]; then
                 sed -i -e "s,\(d_libm_lib_version=\)'define',\1'undef',g" \
                        -e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
                        -e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
Signature · 1 line
2.7.4
#7 lore raw

PATCH v2 7/7 libffi: Support musl-x32 build

In reply to [email protected]

From: sweeaun <[email protected]>

Added target musl-x32 in configure.ac to support musl-x32 build in libffi.

---
 .../0001-libffi-Support-musl-x32-build.patch       | 30 ++++++++++++++++++++++
 meta/recipes-support/libffi/libffi_3.2.1.bb        |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-support/libffi/libffi/0001-libffi-Support-musl-x32-build.patch
meta/recipes-support/libffi/libffi/0001-libffi-Support-musl-x32-build.patch new file +30 -0
new file mode 100644
index 0000000..6b167c8
@@ -0,0 +1,30 @@
+From 69c3906c85c791716bf650aa36d9361d22acf3fb Mon Sep 17 00:00:00 2001
+From: sweeaun <[email protected]>
+Date: Thu, 6 Jul 2017 16:32:46 -0700
+Subject: [PATCH] libffi: Support musl x32 build
+
+Support libffi build with target musl-x32.
+
+Upstream-Status: Pending
+
+Signed-off-by: sweeaun <[email protected]>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index a7bf5ee..8ebe99c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -177,7 +177,7 @@ case "$host" in
+ 	TARGETDIR=x86
+ 	if test $ac_cv_sizeof_size_t = 4; then
+ 	  case "$host" in
+-	    *-gnux32)
++	    *-gnux32 | *-muslx32)
+ 	      TARGET=X86_64
+ 	      ;;
+ 	    *)
+-- 
+2.7.4
+
meta/recipes-support/libffi/libffi_3.2.1.bb +1 -0
index 43eee8e..2a3f4b7 100644
@@ -13,6 +13,7 @@ SRC_URI = "ftp://sourceware.org/pub/libffi/${BP}.tar.gz \
            file://not-win32.patch \
 	   file://0001-mips-Use-compiler-internal-define-for-linux.patch \
            file://0001-mips-fix-MIPS-softfloat-build-issue.patch \
+           file://0001-libffi-Support-musl-x32-build.patch \
 	   "
 
 SRC_URI[md5sum] = "83b89587607e3eb65c70d361f13bab43"
Signature · 1 line
2.7.4