All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] multilib_header: Update wrapper to handle arm 32/64 bit
@ 2017-03-30 15:27 Richard Purdie
  2017-03-30 15:27 ` [PATCH 2/5] linux-libc-headers: Allow arm kernel headers to coexist on " Richard Purdie
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Richard Purdie @ 2017-03-30 15:27 UTC (permalink / raw)
  To: openembedded-core

Having arm 32/64 bit headers coexisting turns out to be tricky. Unfortunately
our wrapper works using wordsize.h and this differs on arm so we can't use it.

Therefore replicate the logic here for arm. I did look into writing our
own wordsize.h but we also need to remap kernel headers on arm and
since wordsize.h comes from libc, that doesn't work for kernel headers.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/multilib_header.bbclass |  7 -------
 scripts/multilib_header_wrapper.h    | 26 ++++++++++++++++----------
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/meta/classes/multilib_header.bbclass b/meta/classes/multilib_header.bbclass
index 304c28e..e03f5b1 100644
--- a/meta/classes/multilib_header.bbclass
+++ b/meta/classes/multilib_header.bbclass
@@ -13,13 +13,9 @@ oe_multilib_header() {
 		;;
 	*)
 	esac
-        # We use
-        # For ARM: We don't support multilib builds.
         # For MIPS: "n32" is a special case, which needs to be
         # distinct from both 64-bit and 32-bit.
         case ${TARGET_ARCH} in
-        arm*)   return
-                ;;
         mips*)  case "${MIPSPKGSFX_ABI}" in
                 "-n32")
                        ident=n32   
@@ -31,9 +27,6 @@ oe_multilib_header() {
                 ;;
         *)      ident=${SITEINFO_BITS}
         esac
-	if echo ${TARGET_ARCH} | grep -q arm; then
-	    return
-	fi
 	for each_header in "$@" ; do
 	   if [ ! -f "${D}/${includedir}/$each_header" ]; then
 	      bberror "oe_multilib_header: Unable to find header $each_header."
diff --git a/scripts/multilib_header_wrapper.h b/scripts/multilib_header_wrapper.h
index 5a87540..f516673 100644
--- a/scripts/multilib_header_wrapper.h
+++ b/scripts/multilib_header_wrapper.h
@@ -21,11 +21,23 @@
  * 
  */
 
-#include <bits/wordsize.h>
 
-#ifdef __WORDSIZE
+#if defined (__arm__)
+#define __MHWORDSIZE			32
+#elif defined (__aarch64__) && defined ( __LP64__)
+#define __MHWORDSIZE			64
+#elif defined (__aarch64__)
+#define __MHWORDSIZE			32
+#else
+#include <bits/wordsize.h>
+#if defined (__WORDSIZE)
+#define __MHWORDSIZE			__WORDSIZE
+#else
+#error "__WORDSIZE is not defined"
+#endif
+#endif
 
-#if __WORDSIZE == 32
+#if __MHWORDSIZE == 32
 
 #ifdef _MIPS_SIM
 
@@ -41,15 +53,9 @@
 #include <ENTER_HEADER_FILENAME_HERE-32.h>
 #endif
 
-#elif __WORDSIZE == 64
+#elif __MHWORDSIZE == 64
 #include <ENTER_HEADER_FILENAME_HERE-64.h>
 #else
 #error "Unknown __WORDSIZE detected"
 #endif /* matches #if __WORDSIZE == 32 */
-
-#else /* __WORDSIZE is not defined */
-
-#error "__WORDSIZE is not defined"
-
-#endif
   
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/5] linux-libc-headers: Allow arm kernel headers to coexist on 32/64 bit
  2017-03-30 15:27 [PATCH 1/5] multilib_header: Update wrapper to handle arm 32/64 bit Richard Purdie
@ 2017-03-30 15:27 ` Richard Purdie
  2017-03-30 15:27 ` [PATCH 3/5] glibc-package: Allow 32 and 64 bit headers to exist on arm Richard Purdie
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2017-03-30 15:27 UTC (permalink / raw)
  To: openembedded-core

Its rather sad we need to do this but in order to make combined 32 and 64 bit
SDKs work, we need a common set of headers and this is the delta that
allows things to work. It only applies on arm.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 .../linux-libc-headers/linux-libc-headers.inc             | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
index 653a470..bb9a669 100644
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -42,7 +42,7 @@ python __anonymous () {
         d.setVar("HEADER_FETCH_VER", "2.6")
 }
 
-inherit kernel-arch pkgconfig
+inherit kernel-arch pkgconfig multilib_header
 
 KORG_ARCHIVE_COMPRESSION ?= "xz"
 
@@ -68,6 +68,19 @@ do_install() {
 	find ${D}${includedir} -name ..install.cmd | xargs rm -f
 }
 
+do_install_append_aarch64 () {
+        do_install_armmultilib
+}
+
+do_install_append_arm () {
+	do_install_armmultilib
+}
+
+do_install_armmultilib () {
+	oe_multilib_header asm/auxvec.h asm/bitsperlong.h asm/byteorder.h asm/fcntl.h asm/hwcap.h asm/ioctls.h asm/kvm.h asm/mman.h asm/param.h asm/perf_regs.h
+	oe_multilib_header asm/posix_types.h asm/ptrace.h  asm/setup.h  asm/sigcontext.h asm/siginfo.h asm/signal.h asm/stat.h  asm/statfs.h asm/swab.h  asm/types.h asm/unistd.h
+}
+
 BBCLASSEXTEND = "nativesdk"
 
 #DEPENDS = "cross-linkage"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/5] glibc-package: Allow 32 and 64 bit headers to exist on arm
  2017-03-30 15:27 [PATCH 1/5] multilib_header: Update wrapper to handle arm 32/64 bit Richard Purdie
  2017-03-30 15:27 ` [PATCH 2/5] linux-libc-headers: Allow arm kernel headers to coexist on " Richard Purdie
@ 2017-03-30 15:27 ` Richard Purdie
  2017-03-30 15:27 ` [PATCH 4/5] linux-libc-headers: Drop 4.4 Richard Purdie
  2017-03-30 15:27 ` [PATCH 5/5] linux-libc-headers: Remove reference to cross-linkage Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2017-03-30 15:27 UTC (permalink / raw)
  To: openembedded-core

With this change (combined with the previous linux-libc-header fix), a
combined sysroot for 32 and 64 bit arm works meaning our SDK works
correctly for that multilib setup.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-core/glibc/glibc-package.inc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
index 6e548cb..2ca5666 100644
--- a/meta/recipes-core/glibc/glibc-package.inc
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -140,8 +140,25 @@ do_install_append_aarch64 () {
 				${D}/lib/ld-linux-aarch64_be.so.1
 		fi
 	fi
+	do_install_armmultilib
 }
 
+do_install_append_arm () {
+	do_install_armmultilib
+}
+
+do_install_armmultilib () {
+
+	oe_multilib_header bits/endian.h bits/fcntl.h bits/fenv.h bits/fp-fast.h bits/hwcap.h bits/ipc.h bits/link.h bits/wordsize.h
+	oe_multilib_header bits/local_lim.h bits/mman.h bits/msq.h bits/pthreadtypes.h  bits/sem.h  bits/semaphore.h bits/setjmp.h
+	oe_multilib_header bits/shm.h bits/sigstack.h bits/stat.h bits/statfs.h bits/string.h bits/typesizes.h
+
+	oe_multilib_header fpu_control.h gnu/lib-names.h gnu/stubs.h ieee754.h
+
+	oe_multilib_header sys/elf.h sys/procfs.h sys/ptrace.h sys/ucontext.h sys/user.h
+}
+
+
 LOCALESTASH = "${WORKDIR}/stashed-locale"
 bashscripts = "mtrace sotruss xtrace"
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/5] linux-libc-headers: Drop 4.4
  2017-03-30 15:27 [PATCH 1/5] multilib_header: Update wrapper to handle arm 32/64 bit Richard Purdie
  2017-03-30 15:27 ` [PATCH 2/5] linux-libc-headers: Allow arm kernel headers to coexist on " Richard Purdie
  2017-03-30 15:27 ` [PATCH 3/5] glibc-package: Allow 32 and 64 bit headers to exist on arm Richard Purdie
@ 2017-03-30 15:27 ` Richard Purdie
  2017-03-30 15:27 ` [PATCH 5/5] linux-libc-headers: Remove reference to cross-linkage Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2017-03-30 15:27 UTC (permalink / raw)
  To: openembedded-core

We've been using 4.10 for a while now, I think 4.4 was accidentally left
behind so clean it up.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb | 9 ---------
 1 file changed, 9 deletions(-)
 delete mode 100644 meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb

diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb
deleted file mode 100644
index 3763dc0..0000000
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.4.bb
+++ /dev/null
@@ -1,9 +0,0 @@
-require linux-libc-headers.inc
-
-SRC_URI_append_libc-musl = "\
-    file://0001-libc-compat.h-fix-some-issues-arising-from-in6.h.patch \
-    file://0002-libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch \
-    file://0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch \
-   "
-SRC_URI[md5sum] = "9a78fa2eb6c68ca5a40ed5af08142599"
-SRC_URI[sha256sum] = "401d7c8fef594999a460d10c72c5a94e9c2e1022f16795ec51746b0d165418b2"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 5/5] linux-libc-headers: Remove reference to cross-linkage
  2017-03-30 15:27 [PATCH 1/5] multilib_header: Update wrapper to handle arm 32/64 bit Richard Purdie
                   ` (2 preceding siblings ...)
  2017-03-30 15:27 ` [PATCH 4/5] linux-libc-headers: Drop 4.4 Richard Purdie
@ 2017-03-30 15:27 ` Richard Purdie
  3 siblings, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2017-03-30 15:27 UTC (permalink / raw)
  To: openembedded-core

This is long dead (thankfully), remove stale reference/comment.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
index bb9a669..1b01741 100644
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -83,7 +83,6 @@ do_install_armmultilib () {
 
 BBCLASSEXTEND = "nativesdk"
 
-#DEPENDS = "cross-linkage"
 RDEPENDS_${PN}-dev = ""
 RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-30 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-30 15:27 [PATCH 1/5] multilib_header: Update wrapper to handle arm 32/64 bit Richard Purdie
2017-03-30 15:27 ` [PATCH 2/5] linux-libc-headers: Allow arm kernel headers to coexist on " Richard Purdie
2017-03-30 15:27 ` [PATCH 3/5] glibc-package: Allow 32 and 64 bit headers to exist on arm Richard Purdie
2017-03-30 15:27 ` [PATCH 4/5] linux-libc-headers: Drop 4.4 Richard Purdie
2017-03-30 15:27 ` [PATCH 5/5] linux-libc-headers: Remove reference to cross-linkage Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.