From 8d89651ef729e560ad96dcfc002fcde6ff7f923b Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Thu, 8 Oct 2015 22:46:13 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- meta-bigendian/conf/layer.conf | 9 ++++++ .../initscripts/initscripts_1.0.bbappend | 1 + .../python/python-numpy_1.7.0.bbappend | 8 +++++ .../python/python/python_ffi_armeb_be8.patch | 34 ++++++++++++++++++++ .../recipes-devtools/python/python_2.7.3.bbappend | 3 ++ .../strace/strace/strace-4.8-arm-be8.patch | 37 ++++++++++++++++++++++ .../recipes-devtools/strace/strace_%.bbappend | 3 ++ .../libffi/libffi/libffi_armeb_be8.patch | 37 ++++++++++++++++++++++ .../recipes-gnome/libffi/libffi_3.1.bbappend | 3 ++ .../recipes-kernel/sysprof/sysprof_git.bbappend | 1 + 10 files changed, 136 insertions(+) create mode 100644 meta-bigendian/conf/layer.conf create mode 100644 meta-bigendian/recipes-core/initscripts/initscripts_1.0.bbappend create mode 100644 meta-bigendian/recipes-devtools/python/python-numpy_1.7.0.bbappend create mode 100644 meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch create mode 100644 meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend create mode 100644 meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch create mode 100644 meta-bigendian/recipes-devtools/strace/strace_%.bbappend create mode 100644 meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch create mode 100644 meta-bigendian/recipes-gnome/libffi/libffi_3.1.bbappend create mode 100644 meta-bigendian/recipes-kernel/sysprof/sysprof_git.bbappend (limited to 'meta-bigendian') diff --git a/meta-bigendian/conf/layer.conf b/meta-bigendian/conf/layer.conf new file mode 100644 index 0000000..f374010 --- /dev/null +++ b/meta-bigendian/conf/layer.conf @@ -0,0 +1,9 @@ +# We have a conf and classes directory, append to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have a recipes directory, add to BBFILES +BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend" + +BBFILE_COLLECTIONS += "bigendian" +BBFILE_PATTERN_bigendian := "^${LAYERDIR}/" +BBFILE_PRIORITY_bigendian = "20" diff --git a/meta-bigendian/recipes-core/initscripts/initscripts_1.0.bbappend b/meta-bigendian/recipes-core/initscripts/initscripts_1.0.bbappend new file mode 100644 index 0000000..355fbab --- /dev/null +++ b/meta-bigendian/recipes-core/initscripts/initscripts_1.0.bbappend @@ -0,0 +1 @@ +SRC_URI_append_armeb = " file://arm/alignment.sh" diff --git a/meta-bigendian/recipes-devtools/python/python-numpy_1.7.0.bbappend b/meta-bigendian/recipes-devtools/python/python-numpy_1.7.0.bbappend new file mode 100644 index 0000000..aa9df9a --- /dev/null +++ b/meta-bigendian/recipes-devtools/python/python-numpy_1.7.0.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += " ${CONFIGFILESURI} " + +CONFIGFILESURI_armeb = " \ + file://config.h \ + file://numpyconfig.h \ +" diff --git a/meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch b/meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch new file mode 100644 index 0000000..afd090b --- /dev/null +++ b/meta-bigendian/recipes-devtools/python/python/python_ffi_armeb_be8.patch @@ -0,0 +1,34 @@ +Index: Python-2.7.3/Modules/_ctypes/libffi/src/arm/ffi.c +=================================================================== +--- Python-2.7.3.orig/Modules/_ctypes/libffi/src/arm/ffi.c ++++ Python-2.7.3/Modules/_ctypes/libffi/src/arm/ffi.c +@@ -272,7 +272,7 @@ ffi_prep_incoming_args_SYSV(char *stack, + } + + /* How to make a trampoline. */ +- ++#if !(defined(__ARMEB__) && defined(__ARM_ARCH_7A__)) + #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ + ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ +@@ -284,7 +284,19 @@ ffi_prep_incoming_args_SYSV(char *stack, + *(unsigned int*) &__tramp[16] = __fun; \ + __clear_cache((&__tramp[0]), (&__tramp[19])); \ + }) +- ++#else /* armv7 big endian: be8 instructions are still little endian */ ++#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ ++({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ ++ unsigned int __fun = (unsigned int)(FUN); \ ++ unsigned int __ctx = (unsigned int)(CTX); \ ++ *(unsigned int*) &__tramp[0] = 0x0f002de9; /* swab(0xe92d000f, 4) - stmfd sp!, {r0-r3} */ \ ++ *(unsigned int*) &__tramp[4] = 0x00009fe5; /* swab(0xe59f0000, 4) - ldr r0, [pc] */ \ ++ *(unsigned int*) &__tramp[8] = 0x00f09fe5; /* swab(0xe59ff000, 4) - ldr pc, [pc] */ \ ++ *(unsigned int*) &__tramp[12] = __ctx; \ ++ *(unsigned int*) &__tramp[16] = __fun; \ ++ __clear_cache((&__tramp[0]), (&__tramp[19])); \ ++ }) ++#endif + + /* the cif must already be prep'ed */ + diff --git a/meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend b/meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend new file mode 100644 index 0000000..db79a4a --- /dev/null +++ b/meta-bigendian/recipes-devtools/python/python_2.7.3.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://python_ffi_armeb_be8.patch" diff --git a/meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch b/meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch new file mode 100644 index 0000000..bda4807 --- /dev/null +++ b/meta-bigendian/recipes-devtools/strace/strace/strace-4.8-arm-be8.patch @@ -0,0 +1,37 @@ +strace: fix system call matching code in get_scno for be8 arm + +on ARM V7 operating in big endian mode strace does not work: + +root@genericarmv7ab:~# strace ls +pid 1356 unknown syscall trap 0x000000ef + +it happens because ARM V7 when runs as big endian operates in be8 mode, +where instruction are still in little endian form. Strace get_scno reads +instructions and matches it to certain pattern, but in armeb case it needs +to byteswap it before that. + +Signed-off-by: Victor Kamensky +Signed-off-by: Riku Voipio +--- + syscall.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/syscall.c ++++ b/syscall.c +@@ -1374,6 +1374,16 @@ get_scno(struct tcb *tcp) + scno = ptrace(PTRACE_PEEKTEXT, tcp->pid, (void *)(arm_regs.ARM_pc - 4), NULL); + if (errno) + return -1; ++ ++#if defined(__ARMEB__) && defined(__ARM_ARCH_7A__) ++ /* We running big endian arm on ARMv7: instructions are ++ * in little endian form so we need to byteswap it. Note ++ * on older ARM like V5 Xscale code is in big endian form ++ * byte swap is not needed in this case. I.e be8 vs be32. ++ */ ++ scno = __builtin_bswap32(scno); ++#endif /* __ARMEB__ && __ARM_ARCH_7A__ */ ++ + /* EABI syscall convention? */ + if (scno != 0xef000000) { + /* No, it's OABI */ diff --git a/meta-bigendian/recipes-devtools/strace/strace_%.bbappend b/meta-bigendian/recipes-devtools/strace/strace_%.bbappend new file mode 100644 index 0000000..3f3d73e --- /dev/null +++ b/meta-bigendian/recipes-devtools/strace/strace_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://strace-4.8-arm-be8.patch" diff --git a/meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch b/meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch new file mode 100644 index 0000000..7efa58e --- /dev/null +++ b/meta-bigendian/recipes-gnome/libffi/libffi/libffi_armeb_be8.patch @@ -0,0 +1,37 @@ +Index: libffi-3.0.13/src/arm/ffi.c +=================================================================== +--- libffi-3.0.13.orig/src/arm/ffi.c ++++ libffi-3.0.13/src/arm/ffi.c +@@ -582,6 +582,7 @@ ffi_closure_free (void *ptr) + + #else + ++#if !(defined(__ARMEB__) && defined(__ARM_ARCH_7A__)) + #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ + ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ +@@ -595,7 +596,23 @@ ffi_closure_free (void *ptr) + /* Clear instruction \ + mapping. */ \ + }) +- ++#else /* armv7 big endian: be8 instructions are still little endian */ ++#define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ ++({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ ++ unsigned int __fun = (unsigned int)(FUN); \ ++ unsigned int __ctx = (unsigned int)(CTX); \ ++ unsigned char *insns = (unsigned char *)(CTX); \ ++ *(unsigned int*) &__tramp[0] = 0x0f002de9; /* swab(0xe92d000f, 4) - stmfd sp!, {r0-r3} */ \ ++ *(unsigned int*) &__tramp[4] = 0x00009fe5; /* swab(0xe59f0000, 4) - ldr r0, [pc] */ \ ++ *(unsigned int*) &__tramp[8] = 0x00f09fe5; /* swab(0xe59ff000, 4) - ldr pc, [pc] */ \ ++ *(unsigned int*) &__tramp[12] = __ctx; \ ++ *(unsigned int*) &__tramp[16] = __fun; \ ++ __clear_cache((&__tramp[0]), (&__tramp[19])); /* Clear data mapping. */ \ ++ __clear_cache(insns, insns + 3 * sizeof (unsigned int)); \ ++ /* Clear instruction \ ++ mapping. */ \ ++ }) ++#endif + #endif + + /* the cif must already be prep'ed */ diff --git a/meta-bigendian/recipes-gnome/libffi/libffi_3.1.bbappend b/meta-bigendian/recipes-gnome/libffi/libffi_3.1.bbappend new file mode 100644 index 0000000..05b2f11 --- /dev/null +++ b/meta-bigendian/recipes-gnome/libffi/libffi_3.1.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://libffi_armeb_be8.patch" diff --git a/meta-bigendian/recipes-kernel/sysprof/sysprof_git.bbappend b/meta-bigendian/recipes-kernel/sysprof/sysprof_git.bbappend new file mode 100644 index 0000000..3a9227f --- /dev/null +++ b/meta-bigendian/recipes-kernel/sysprof/sysprof_git.bbappend @@ -0,0 +1 @@ +SRC_URI_append_armeb = " file://rmb-arm.patch" -- cgit v1.2.3-54-g00ecf