Skip to contentSkip to conversation

virglrender: Fix endianness check on musl

PATCH New Khem Raj 1 participant 3 messages Aug 6, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 virglrender: Fix endianness check on musl

Seen to fail on musl/mips, this fixes the check to be linux specific which means it can detect the endianness for musl correctly

---
 ...d-libc-check-to-be-platform-OS-check.patch | 36 +++++++++++++++++++
 .../virglrenderer/virglrenderer_0.7.0.bb      |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-graphics/virglrenderer/virglrenderer/0001-gallium-Expand-libc-check-to-be-platform-OS-check.patch
meta/recipes-graphics/virglrenderer/virglrenderer/0001-gallium-Expand-libc-check-to-be-platform-OS-check.patch new file +36 -0
new file mode 100644
index 0000000000..a0ac3aefdd
@@ -0,0 +1,36 @@
+From 3d30df8d8ccb919733b5339b2a82474305b83998 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Aug 2019 01:19:48 +0000
+Subject: [PATCH] gallium: Expand libc check to be platform OS check
+
+endianness on musl based systems can also be detected in same way as
+glibc, therefore check for __linux__ define instead of __GLIBC__
+
+Fixes build on musl/mips
+
+| ../../../../git/src/gallium/include/pipe/p_config.h:171:2: error: #error Unknown Endianness
+| #error Unknown Endianness
+|  ^~~~~
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/gallium/include/pipe/p_config.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h
+index d603681..71cdf49 100644
+--- a/src/gallium/include/pipe/p_config.h
++++ b/src/gallium/include/pipe/p_config.h
+@@ -130,7 +130,7 @@
+  * Endian detection.
+  */
+ 
+-#ifdef __GLIBC__
++#ifdef __linux__
+ #include <endian.h>
+ 
+ #if __BYTE_ORDER == __LITTLE_ENDIAN
+-- 
+2.17.1
+
meta/recipes-graphics/virglrenderer/virglrenderer_0.7.0.bb +1 -0
index 225a0b8b0c..818d5b6307 100644
@@ -9,6 +9,7 @@ SRCREV = "402c228861c9893f64cffbbcb4cb23044b8c721c"
 SRC_URI = "git://anongit.freedesktop.org/virglrenderer \
            file://0001-vtest-add-missing-includes.patch \
            file://0001-Makefile.am-explicitly-link-with-libdrm.patch \
+           file://0001-gallium-Expand-libc-check-to-be-platform-OS-check.patch \
            "
 
 S = "${WORKDIR}/git"
Signature · 1 line
2.22.0
author
#1 lore raw

PATCH 2/3 syslinux: Override hardcoded toolnames in Makefile

makefile assumes native toolnames e.g. ar, as, nm etc. which causes build fails on non-x86 build hosts

objcopy: Unable to recognise the format of the input file `libcom32.elf'

---
 .../syslinux/syslinux_6.04-pre2.bb            | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
meta/recipes-devtools/syslinux/syslinux_6.04-pre2.bb +17 -2
index 67e5d57d48..e9dbefb930 100644
@@ -59,11 +59,26 @@ do_compile() {
 
 	# Rebuild only the installer; keep precompiled bootloaders
 	# as per author's request (doc/distrib.txt)
-	oe_runmake CC="${CC} ${CFLAGS}" LD="${LD}" LDFLAGS="${LDFLAGS}" firmware="bios" installer
+	oe_runmake CC="${CC} ${CFLAGS}" \
+                   LD="${LD}" LDFLAGS="${LDFLAGS}" \
+                   OBJDUMP="${OBJDUMP}" \
+                   OBJCOPY="${OBJCOPY}" \
+                   AR="${AR}" \
+                   STRIP="${STRIP}" \
+                   NM="${NM}" \
+                   RANLIB="${RANLIB}" \
+                   firmware="bios" installer
 }
 
 do_install() {
-	oe_runmake CC="${CC} ${CFLAGS}" LD="${LD}" firmware="bios" install INSTALLROOT="${D}"
+	oe_runmake CC="${CC} ${CFLAGS}" LD="${LD}" \
+                   OBJDUMP="${OBJDUMP}" \
+                   OBJCOPY="${OBJCOPY}" \
+                   AR="${AR}" \
+                   STRIP="${STRIP}" \
+                   NM="${NM}" \
+                   RANLIB="${RANLIB}" \
+                   firmware="bios" install INSTALLROOT="${D}"
 
 	install -d ${D}${datadir}/syslinux/
 	install -m 644 ${S}/bios/core/ldlinux.sys ${D}${datadir}/syslinux/
Signature · 1 line
2.22.0
author
#2 lore raw

PATCH 3/3 systemd-boot: Add option to specify cross objcopy and use it

In reply to Khem Raj

This is needed when build host != x86 box

---
 meta/recipes-core/systemd/systemd-boot_242.bb |  2 +
 ...fi-objcopy-option-to-specify-objcopy.patch | 48 +++++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-meson-Add-Defi-objcopy-option-to-specify-objcopy.patch
meta/recipes-core/systemd/systemd-boot_242.bb +2 -0
index 56e68a3d49..56a25c35ba 100644
@@ -8,6 +8,7 @@ DEPENDS = "intltool-native libcap util-linux gnu-efi gperf-native"
 SRC_URI += "file://0001-Revert-meson-use-an-array-option-for-efi-cc.patch \
             file://0001-Revert-meson-print-EFI-CC-configuration-nicely.patch \
             file://0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch \
+            file://0001-meson-Add-Defi-objcopy-option-to-specify-objcopy.patch \
             "
 
 inherit meson pkgconfig gettext
@@ -22,6 +23,7 @@ EXTRA_OEMESON += "-Defi=true \
                   -Dman=false \
                   -Defi-cc='${EFI_CC}' \
                   -Defi-ld='${LD}' \
+                  -Defi-objcopy='${OBJCOPY}' \
                   "
 
 # install to the image as boot*.efi if its the EFI_PROVIDER,
meta/recipes-core/systemd/systemd/0001-meson-Add-Defi-objcopy-option-to-specify-objcopy.patch new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
2.22.0