Skip to contentSkip to conversation

arch-mips.inc: Change definition of TRANSLATED_TARGET_ARCH

PATCH In review Mark Hatle 1 participant 2 messages Jan 23, 2015

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

PATCH 1/1 arch-mips.inc: Change definition of TRANSLATED_TARGET_ARCH

[YOCTO #7230]

In certain system configurations TRANSLATED_TARGET_ARCH will not expand in the right order for gcc-cross-candian-mips64n32 to be generated properly.

This will cause SDKs to fail to generate properly.

Changing the global definition of TRANSLATED_TARGET_ARCH always expands the ABIEXTENSION, which causes the OVERRIDES to pick it up as well. This effectively defines a new class of overrides for the 'n32'.

The side effect is that we need to duplicate some mips64 overrides, and redefine others that were previously 'n32' or 'mips64' exclusive to have the correct semantics.

---
 meta/conf/bitbake.conf                             |   2 +
 meta/conf/machine/include/mips/arch-mips.inc       |   4 +-
 .../packagegroups/packagegroup-core-sdk.bb         |   1 +
 .../packagegroup-core-tools-profile.bb             |   2 +
 .../packagegroups/packagegroup-self-hosted.bb      |   1 +
 meta/recipes-devtools/gcc/gcc-configure-common.inc |   2 +
 meta/recipes-devtools/gdb/gdb-common.inc           |   2 +
 .../python/python-numpy/mips64n32/_numpyconfig.h   |  30 +++++
 .../python/python-numpy/mips64n32/config.h         | 139 +++++++++++++++++++++
 meta/recipes-devtools/python/python-numpy_1.7.0.bb |   4 +
 .../ghostscript/ghostscript/mips64eln32/objarch.h  |  40 ++++++
 .../ghostscript/ghostscript/mips64n32/objarch.h    |  40 ++++++
 meta/recipes-extended/mdadm/mdadm_3.3.2.bb         |   1 +
 .../packagegroups/packagegroup-core-lsb.bb         |   1 +
 meta/recipes-kernel/sysprof/sysprof_git.bb         |   1 +
 .../packagegroups/packagegroup-core-qt.bb          |   2 +-
 .../packagegroups/packagegroup-core-qt4e.bb        |   2 +-
 .../packagegroup-qt-toolchain-target.inc           |   2 +-
 meta/recipes-qt/qt4/qt4-4.8.6.inc                  |   2 +-
 meta/recipes-sato/images/core-image-sato-sdk.bb    |   1 +
 meta/recipes-sato/midori/midori_0.5.8.bb           |   2 +-
 meta/recipes-sato/webkit/webkit-gtk_1.8.3.bb       |   2 +-
 22 files changed, 276 insertions(+), 7 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h
 create mode 100644 meta/recipes-devtools/python/python-numpy/mips64n32/config.h
 create mode 100644 meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h
 create mode 100644 meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h
meta/conf/bitbake.conf +2 -0
index d22e9e8..ba6113d 100644
@@ -520,6 +520,8 @@ LINKER_HASH_STYLE_mips = "sysv"
 LINKER_HASH_STYLE_mipsel = "sysv"
 LINKER_HASH_STYLE_mips64 = "sysv"
 LINKER_HASH_STYLE_mips64el = "sysv"
+LINKER_HASH_STYLE_mips64n32 = "sysv"
+LINKER_HASH_STYLE_mips64eln32 = "sysv"
 TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE', True) != 'gnu']}"
 
 export LDFLAGS = "${TARGET_LDFLAGS}"
meta/conf/machine/include/mips/arch-mips.inc +3 -1
index 08d8fdc..c41fa5e 100644
@@ -101,4 +101,6 @@ BASE_LIB_tune-mips64el-nf = "lib64"
 MIPSPKGSFX_VARIANT_tune-mips64el-nf = "${TUNE_ARCH}"
 PACKAGE_EXTRA_ARCHS_tune-mips64el-nf = "mips64el-nf"
 
-TRANSLATED_TARGET_ARCH_append = "${ABIEXTENSION}"
+# On mips we need to redefine this to include the ABIEXTENSION
+# we can avoid the python bit as there are no _ or - to translate
+TRANSLATED_TARGET_ARCH = "${TARGET_ARCH}${ABIEXTENSION}"
meta/recipes-core/packagegroups/packagegroup-core-sdk.bb +1 -0
index 83da7e0..a41eada 100644
@@ -32,6 +32,7 @@ SANITIZERS = "libasan-dev libubsan-dev"
 SANITIZERS_aarch64 = ""
 SANITIZERS_mips = ""
 SANITIZERS_mips64 = ""
+SANITIZERS_mips64n32 = ""
 SANITIZERS_powerpc64 = ""
 SANITIZERS_sparc = ""
 
meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb +2 -0
index f0ba8b9..6f4842f 100644
@@ -38,6 +38,7 @@ SYSTEMTAP = "systemtap"
 SYSTEMTAP_libc-uclibc = ""
 SYSTEMTAP_mips = ""
 SYSTEMTAP_mips64 = ""
+SYSTEMTAP_mips64n32 = ""
 SYSTEMTAP_aarch64 = ""
 
 # lttng-ust uses sched_getcpu() which is not there on uclibc
@@ -65,6 +66,7 @@ VALGRIND = "valgrind"
 VALGRIND_libc-uclibc = ""
 VALGRIND_mips = ""
 VALGRIND_mips64 = ""
+VALGRIND_mips64n32 = ""
 VALGRIND_arm = ""
 VALGRIND_aarch64 = ""
 
meta/recipes-core/packagegroups/packagegroup-self-hosted.bb +1 -0
index af57fac..c471020 100644
@@ -29,6 +29,7 @@ RDEPENDS_packagegroup-self-hosted = "\
 # midori depends on webkit-gtk which could not build for mips64
 MIDORI = "midori"
 MIDORI_mips64 = ""
+MIDORI_mips64n32 = ""
 
 RDEPENDS_packagegroup-self-hosted-host-tools = "\
     connman \
meta/recipes-devtools/gcc/gcc-configure-common.inc +2 -0
index 0693118..c30242d 100644
@@ -64,6 +64,8 @@ EXTRA_OECONF_append_libc-uclibc = " --enable-__cxa_atexit"
 
 EXTRA_OECONF_append_mips64 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
 EXTRA_OECONF_append_mips64el = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64n32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64eln32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
 
 # ARMv6+ adds atomic instructions that affect the ABI in libraries built
 # with TUNE_CCARGS in gcc-runtime.  Make the compiler default to a
meta/recipes-devtools/gdb/gdb-common.inc +2 -0
index a902f9a..81af42f 100644
@@ -11,6 +11,8 @@ LTTNGUST_mips = ""
 LTTNGUST_mipsel = ""
 LTTNGUST_mips64 = ""
 LTTNGUST_mips64el = ""
+LTTNGUST_mips64n32 = ""
+LTTNGUST_mips64eln32 = ""
 LTTNGUST_sh4 = ""
 
 INC_PR = "r0"
meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h new file +30 -0
new file mode 100644
index 0000000..be57ac2
@@ -0,0 +1,30 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x00000007
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
meta/recipes-devtools/python/python-numpy/mips64n32/config.h new file +139 -0

139 lines not on this page · raw message

meta/recipes-devtools/python/python-numpy_1.7.0.bb +4 -0
index 6cb14c9..d4fd279 100644
@@ -50,6 +50,10 @@ CONFIGFILESURI_mips64 = " \
     file://config.h \
     file://_numpyconfig.h \
 "
+CONFIGFILESURI_mips64n32 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
 
 S = "${WORKDIR}/numpy-${PV}"
 
meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h new file +40 -0
new file mode 100644
index 0000000..a05de29
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h new file +40 -0
new file mode 100644
index 0000000..0d0a16b
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
meta/recipes-extended/mdadm/mdadm_3.3.2.bb +1 -0
index c9392b4..7140990 100644
@@ -32,6 +32,7 @@ EXTRA_OEMAKE = "CHECK_RUN_DIR=0"
 # int-ll64.h included
 EXTRA_OEMAKE_append_powerpc64 = ' CFLAGS=-D__SANE_USERSPACE_TYPES__'
 EXTRA_OEMAKE_append_mips64 = ' CFLAGS=-D__SANE_USERSPACE_TYPES__'
+EXTRA_OEMAKE_append_mips64n32 = ' CFLAGS=-D__SANE_USERSPACE_TYPES__'
 
 do_compile() {
 	oe_runmake
meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb +1 -0
index dd96fbe..e0f32e0 100644
@@ -211,6 +211,7 @@ QT4PKGS = " \
     ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "libqtopengl4", "", d)} \
     "
 QT4PKGS_mips64 = ""
+QT4PKGS_mips64n32 = ""
 
 SUMMARY_packagegroup-core-lsb-desktop = "LSB Desktop"
 DESCRIPTION_packagegroup-core-lsb-desktop = "Packages required to support libraries \
meta/recipes-kernel/sysprof/sysprof_git.bb +1 -0
index cfc814f..e18aebf 100644
@@ -14,6 +14,7 @@ SRC_URI = "git://git.gnome.org/sysprof \
 SRC_URI_append_arm  = " file://rmb-arm.patch"
 SRC_URI_append_mips = " file://rmb-mips.patch"
 SRC_URI_append_mips64 = " file://rmb-mips.patch"
+SRC_URI_append_mips64n32 = " file://rmb-mips.patch"
 
 S = "${WORKDIR}/git"
 
meta/recipes-qt/packagegroups/packagegroup-core-qt.bb +1 -1
index d28e032..5f6916a 100644
@@ -7,7 +7,7 @@ LICENSE = "MIT"
 PR = "r4"
 
 # Qt4 could NOT be built on MIPS64 with 64 bits userspace
-COMPATIBLE_HOST_mips64 = "mips64.*-linux-gnun32"
+COMPATIBLE_HOST_mips64 = "null"
 
 inherit packagegroup
 
meta/recipes-qt/packagegroups/packagegroup-core-qt4e.bb +1 -1
index d7a457c..d4f0fd1 100644
@@ -3,7 +3,7 @@ PR = "r2"
 LICENSE = "MIT"
 
 # Qt4 could NOT be built on MIPS64 with 64 bits userspace
-COMPATIBLE_HOST_mips64 = "mips64.*-linux-gnun32"
+COMPATIBLE_HOST_mips64 = "null"
 
 inherit packagegroup
 
meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.inc +1 -1
index fc1ccba..02a0326 100644
@@ -1,7 +1,7 @@
 LICENSE = "MIT"
 
 # Qt4 could NOT be built on MIPS64 with 64 bits userspace
-COMPATIBLE_HOST_mips64 = "mips64.*-linux-gnun32"
+COMPATIBLE_HOST_mips64 = "null"
 
 inherit packagegroup
 
meta/recipes-qt/qt4/qt4-4.8.6.inc +1 -1
index a2c0688..bd20dac 100644
@@ -39,7 +39,7 @@ S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}"
 # disable webkit for mips64 n32 temporarily that fails to compile,
 # qt upstream defect:
 # https://bugreports.qt-project.org/browse/QTBUG-39224
-QT_CONFIG_FLAGS_append_mips64 = "${@bb.utils.contains("TUNE_FEATURES", "n32", " -no-webkit", "" ,d)}"
+QT_CONFIG_FLAGS_append_mips64n32 = " -no-webkit"
 
 # disable webkit for aarch64 temporarily that fails to compile
 QT_CONFIG_FLAGS_append_aarch64 = " -no-webkit"
meta/recipes-sato/images/core-image-sato-sdk.bb +1 -0
index 1c4f328..62836f9 100644
@@ -6,6 +6,7 @@ form a standalone SDK."
 
 QT4PKG = "qt4-pkgs"
 QT4PKG_mips64 = ""
+QT4PKG_mips64n32 = ""
 
 IMAGE_FEATURES += "dev-pkgs tools-sdk ${QT4PKG} \
 	tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks ssh-server-openssh"
meta/recipes-sato/midori/midori_0.5.8.bb +1 -1
index 299ecb3..3aabdd4 100644
@@ -10,7 +10,7 @@ SRC_URI[sha256sum] = "af19135fd4c4b04345df4d3592e7939c20f9b40eaca24550e6cb619751
 
 # midori depends on webkit-gtk, and webkit-gtk can NOT be built on
 # MIPS64 with n32 ABI. So remove it from mips64 n32 temporarily.
-COMPATIBLE_HOST_mips64 = "mips64.*-linux$"
+COMPATIBLE_HOST_mips64n32 = "null"
 
 inherit gtk-icon-cache pkgconfig vala pythonnative cmake
 
meta/recipes-sato/webkit/webkit-gtk_1.8.3.bb +1 -1
index 29f8a79..920e1a0 100644
@@ -32,7 +32,7 @@ SRC_URI[md5sum] = "dcbf9d5e2e6391f857c29a57528b32a6"
 SRC_URI[sha256sum] = "ada02d636af61aed38f142d3cded662d141ce71264f624c4eb873621a74cc9e7"
 
 # webkit-gtk can NOT be built on MIPS64 with n32 ABI
-COMPATIBLE_HOST_mips64 = "mips64.*-linux$"
+COMPATIBLE_HOST_mips64n32 = "null"
 
 inherit autotools lib_package gtk-doc pkgconfig
 
Signature · 1 line
1.9.3
author
#1 lore raw

Note, I tested this by building a world build for MACHINE qemumips64 with DEFAULTTUNE set to mips64-n32.

It and the other recent patches I've sent are available at

git://git.yoctoproject.org/poky-contrib mhatle/oe-core

--Mark

Quoted 45 lines · Mark Hatle

[YOCTO #7230]

In certain system configurations TRANSLATED_TARGET_ARCH will not expand in the right order for gcc-cross-candian-mips64n32 to be generated properly.

This will cause SDKs to fail to generate properly.

Changing the global definition of TRANSLATED_TARGET_ARCH always expands the ABIEXTENSION, which causes the OVERRIDES to pick it up as well. This effectively defines a new class of overrides for the 'n32'.

The side effect is that we need to duplicate some mips64 overrides, and redefine others that were previously 'n32' or 'mips64' exclusive to have the correct semantics.

---
 meta/conf/bitbake.conf                             |   2 +
 meta/conf/machine/include/mips/arch-mips.inc       |   4 +-
 .../packagegroups/packagegroup-core-sdk.bb         |   1 +
 .../packagegroup-core-tools-profile.bb             |   2 +
 .../packagegroups/packagegroup-self-hosted.bb      |   1 +
 meta/recipes-devtools/gcc/gcc-configure-common.inc |   2 +
 meta/recipes-devtools/gdb/gdb-common.inc           |   2 +
 .../python/python-numpy/mips64n32/_numpyconfig.h   |  30 +++++
 .../python/python-numpy/mips64n32/config.h         | 139 +++++++++++++++++++++
 meta/recipes-devtools/python/python-numpy_1.7.0.bb |   4 +
 .../ghostscript/ghostscript/mips64eln32/objarch.h  |  40 ++++++
 .../ghostscript/ghostscript/mips64n32/objarch.h    |  40 ++++++
 meta/recipes-extended/mdadm/mdadm_3.3.2.bb         |   1 +
 .../packagegroups/packagegroup-core-lsb.bb         |   1 +
 meta/recipes-kernel/sysprof/sysprof_git.bb         |   1 +
 .../packagegroups/packagegroup-core-qt.bb          |   2 +-
 .../packagegroups/packagegroup-core-qt4e.bb        |   2 +-
 .../packagegroup-qt-toolchain-target.inc           |   2 +-
 meta/recipes-qt/qt4/qt4-4.8.6.inc                  |   2 +-
 meta/recipes-sato/images/core-image-sato-sdk.bb    |   1 +
 meta/recipes-sato/midori/midori_0.5.8.bb           |   2 +-
 meta/recipes-sato/webkit/webkit-gtk_1.8.3.bb       |   2 +-
 22 files changed, 276 insertions(+), 7 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h
 create mode 100644 meta/recipes-devtools/python/python-numpy/mips64n32/config.h
 create mode 100644 meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h
 create mode 100644 meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h