Skip to contentSkip to conversation

klibc: Edit out gcc hardcoding in do_compile

PATCH In review Khem Raj 3 participants 7 messages Sep 11, 2017 – Sep 12, 2017

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/5 klibc: Edit out gcc hardcoding in do_compile

This is needed when building klcc-cross and klcc-cross does not have do_configure, therefore stick this just before do_compile

---
 meta-initramfs/recipes-devtools/klibc/klibc.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-initramfs/recipes-devtools/klibc/klibc.inc +1 -1
index ed15b2e1e..dec3d3704 100644
@@ -50,7 +50,7 @@ do_configure () {
     ln -sf "${STAGING_DIR_TARGET}${exec_prefix}" linux
 }
 
-do_configure_prepend_toolchain-clang() {
+do_compile_prepend_toolchain-clang() {
     sed -i -e 's#$(KLIBCROSS)gcc#$(KLIBCROSS)clang#g' ${S}/Makefile
 }
 
Signature · 1 line
2.14.1
author
#1 lore raw

PATCH 2/5 xfsdump: Upgrade to 3.1.7

Fix build on musl
Point to new SRC_URI

---
 ...-c99-defined-int64_t-instead-of-__int64_t.patch | 28 ++++++++++++++++++++++
 .../xfsdump/{xfsdump_3.1.6.bb => xfsdump_3.1.7.bb} |  7 +++---
 2 files changed, 32 insertions(+), 3 deletions(-)
 create mode 100644 meta-filesystems/recipes-utils/xfsdump/files/0001-xfsdump-Use-c99-defined-int64_t-instead-of-__int64_t.patch
 rename meta-filesystems/recipes-utils/xfsdump/{xfsdump_3.1.6.bb => xfsdump_3.1.7.bb} (81%)
meta-filesystems/recipes-utils/xfsdump/files/0001-xfsdump-Use-c99-defined-int64_t-instead-of-__int64_t.patch new file +28 -0
new file mode 100644
index 000000000..1fe1bde8b
@@ -0,0 +1,28 @@
+From f1e822d546e08cc195eaeb38ca172bd0c3800aa9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 9 Sep 2017 07:48:48 -0700
+Subject: [PATCH] xfsdump: Use c99 defined int64_t instead of __int64_t
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Submitted
+
+ common/hsmapi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/common/hsmapi.c b/common/hsmapi.c
+index 6054773..0709dbe 100644
+--- a/common/hsmapi.c
++++ b/common/hsmapi.c
+@@ -585,7 +585,7 @@ HsmModifyExtentMap(
+ 	struct getbmapx	*bmap)
+ {
+ 	dmf_f_ctxt_t	*dmf_f_ctxtp = (dmf_f_ctxt_t *)contextp;
+-	__int64_t	length;
++	int64_t		length;
+ 
+ 	if (bmap[0].bmv_entries <= 0) {
+ 		return 1;	/* caller must already be at EOF */
+-- 
+2.14.1
+
meta-filesystems/recipes-utils/xfsdump/xfsdump_3.1.7.bb renamed from meta-filesystems/recipes-utils/xfsdump/xfsdump_3.1.6.bb +4 -3
similarity index 81%
rename from meta-filesystems/recipes-utils/xfsdump/xfsdump_3.1.6.bb
rename to meta-filesystems/recipes-utils/xfsdump/xfsdump_3.1.7.bb
index d1033cff1..0ac991b23 100644
@@ -10,16 +10,17 @@ LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://doc/COPYING;md5=15c832894d10ddd00dfcf57bee490ecc"
 DEPENDS = "xfsprogs attr"
 
-SRC_URI = "ftp://oss.sgi.com/projects/xfs/cmd_tars/${BPN}-${PV}.tar.gz \
+SRC_URI = "https://www.kernel.org/pub/linux/utils/fs/xfs/xfsdump/${BP}.tar.xz \
            file://remove-install-as-user.patch \
            file://0001-Include-fcntl.h-for-O_EXCL.patch \
            file://0002-Replace-__uint32_t-with-uint32_t.patch \
            file://0003-replace-use-of-SIGCLD-with-SIGCHLD.patch \
            file://0004-include-limit.h-for-PATH_MAX.patch \
            file://0005-include-sys-types.h-for-u_int32_t-in-attr-attributes.patch \
+           file://0001-xfsdump-Use-c99-defined-int64_t-instead-of-__int64_t.patch \
            "
-SRC_URI[md5sum] = "50353cd4f4b435685955363e6044f4d1"
-SRC_URI[sha256sum] = "7f78c11ca527477d90e5e62b0778f3ad96f2b71c19173044e9aca9515fff42d0"
+SRC_URI[md5sum] = "c6e91f2ac8b76c796db2d236f5ca5947"
+SRC_URI[sha256sum] = "99e6d4df257ebc6d29ca9e970ca20672c2ea03481ad949bc68f98de3e4d56dce"
 
 inherit autotools-brokensep
 
Signature · 1 line
2.14.1
author
#2 lore raw

PATCH 3/5 opencv: Fix build with clang

In reply to Khem Raj

-isystem is not needed even with clang

---
 .../opencv/opencv/0001-Dont-use-isystem.patch      | 26 ++++++++++++++++++++++
 meta-oe/recipes-support/opencv/opencv_3.3.bb       |  2 +-
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch
meta-oe/recipes-support/opencv/opencv/0001-Dont-use-isystem.patch new file +26 -0
new file mode 100644
index 000000000..6dd48fcdc
@@ -0,0 +1,26 @@
+From 2bc6bb9831d07f035fea74ea745cea43dd5f9ef9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 9 Sep 2017 23:48:31 -0700
+Subject: [PATCH] Dont use isystem
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ cmake/OpenCVPCHSupport.cmake | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+Index: git/cmake/OpenCVPCHSupport.cmake
+===================================================================
+--- git.orig/cmake/OpenCVPCHSupport.cmake
++++ git/cmake/OpenCVPCHSupport.cmake
+@@ -17,7 +17,8 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
+     IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.2.0")
+         SET(PCHSupport_FOUND TRUE)
+     ENDIF()
+-
++    SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I")
++    SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I")
+     SET(_PCH_include_prefix "-I")
+     SET(_PCH_isystem_prefix "-isystem")
+     SET(_PCH_define_prefix "-D")
meta-oe/recipes-support/opencv/opencv_3.3.bb +1 -1
index efbb2f52a..25f247662 100644
@@ -49,8 +49,8 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
     file://0001-build-workaround-GCC-7.1.1-compilation-issue-with-sa.patch \
     file://0002-imgcodecs-refactoring-improve-code-quality.patch \
     file://0003-imgproc-test-add-checks-for-remove-call.patch \
+    file://0001-Dont-use-isystem.patch \
 "
-
 PV = "3.3+git${SRCPV}"
 
 S = "${WORKDIR}/git"
Signature · 1 line
2.14.1
author
#3 lore raw

PATCH 4/5 klibc.bbclass: Use forcevariable override to define flags

In reply to Khem Raj

This is required so it can override the CC settings when clang is used because meta-clang uses toolchain-clang override to set CC and friends so we need to use higher order override, forcevariable is highest order.

---
 meta-initramfs/classes/klibc.bbclass | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
meta-initramfs/classes/klibc.bbclass +6 -7
index f864104cf..2aacf241e 100644
@@ -3,13 +3,12 @@ DEPENDS =+ "klcc-cross"
 
 # Default for klcc is to build static binaries.
 # Set CC = "${TARGET_PREFIX}klcc -shared" to build the dynamic version.
+CC_forcevariable = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}"
+CC_forcevariable_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork"
 
-export CC = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}"
-export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork"
-
-export CPP = "${CC} -E"
+CPP_forcevariable = "${CC} -E"
 
 # klcc uses own optimizations by default. See klcc(1) man file.
-export CFLAGS=""
-export CPPFLAGS=""
-export LDFLAGS=""
+CFLAGS_forcevariable=""
+CPPFLAGS_forcevariable=""
+LDFLAGS_forcevariable=""
Signature · 1 line
2.14.1
#4 lore raw

Re: [meta-initramfs][PATCH 4/5] klibc.bbclass: Use forcevariable override to define flags

Quoted 4 lines · Khem Raj

This is required so it can override the CC settings when clang is used because meta-clang uses toolchain-clang override to set CC and friends so we need to use higher order override, forcevariable is highest order.

Just for reference, ${LIBCOVERRIDE} is the highest order over-ride, forcevariable is second.

Quoted 37 lines
---
 meta-initramfs/classes/klibc.bbclass | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
meta-initramfs/classes/klibc.bbclass +6 -8
index f864104cf..2aacf241e 100644
@@ -3,13 +3,12 @@ DEPENDS =+ "klcc-cross"
 
 # Default for klcc is to build static binaries.
 # Set CC = "${TARGET_PREFIX}klcc -shared" to build the dynamic version.
+CC_forcevariable = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}"
+CC_forcevariable_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork"
 
-export CC = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}"
-export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork"
-
-export CPP = "${CC} -E"
+CPP_forcevariable = "${CC} -E"
 
 # klcc uses own optimizations by default. See klcc(1) man file.
-export CFLAGS=""
-export CPPFLAGS=""
-export LDFLAGS=""
+CFLAGS_forcevariable=""
+CPPFLAGS_forcevariable=""
+LDFLAGS_forcevariable=""
--

2.14.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#5 lore raw

Re: [meta-initramfs][PATCH 4/5] klibc.bbclass: Use forcevariable override to define flags

One of these last changes seems to cause:

http://errors.yoctoproject.org/Errors/Details/155766/

Quoted 55 lines · Andre McCurdy
Quoted 4 lines · Khem Raj

This is required so it can override the CC settings when clang is used because meta-clang uses toolchain-clang override to set CC and friends so we need to use higher order override, forcevariable is highest order.

Just for reference, ${LIBCOVERRIDE} is the highest order over-ride, forcevariable is second.

Review

Quoted 6 lines
---
 meta-initramfs/classes/klibc.bbclass | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
(quoted diff) +0 -0

b/meta-initramfs/classes/klibc.bbclass

meta-initramfs/classes/klibc.bbclass DEPENDS =+ "klcc-cross" · line 7

Quoted 9 lines

index f864104cf..2aacf241e 100644

meta-initramfs/classes/klibc.bbclass +2 -0
@@ -3,13 +3,12 @@ DEPENDS =+ "klcc-cross"
 
 # Default for klcc is to build static binaries.
 # Set CC = "${TARGET_PREFIX}klcc -shared" to build the dynamic version.
+CC_forcevariable = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}"
+CC_forcevariable_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc

${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork"

meta-initramfs/classes/klibc.bbclass DEPENDS =+ "klcc-cross" · line 7

Quoted 3 lines
meta-initramfs/classes/klibc.bbclass +0 -2
-export CC = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}"
-export CC_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc

${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork"

Quoted 14 lines
meta-initramfs/classes/klibc.bbclass +4 -6
-
-export CPP = "${CC} -E"
+CPP_forcevariable = "${CC} -E"
 
 # klcc uses own optimizations by default. See klcc(1) man file.
-export CFLAGS=""
-export CPPFLAGS=""
-export LDFLAGS=""
+CFLAGS_forcevariable=""
+CPPFLAGS_forcevariable=""
+LDFLAGS_forcevariable=""
--

2.14.1

Quoted 5 lines

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

author
#6 lore raw

PATCH 5/5 klibc.bbclass: Add -mfloat-abi on arm

In reply to Khem Raj

Default toolchain is not configured for hard float therefore we need to pass the right -mfloat-abi option

---
 meta-initramfs/classes/klibc.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-initramfs/classes/klibc.bbclass +1 -1
index 2aacf241e..855382579 100644
@@ -3,7 +3,7 @@ DEPENDS =+ "klcc-cross"
 
 # Default for klcc is to build static binaries.
 # Set CC = "${TARGET_PREFIX}klcc -shared" to build the dynamic version.
-CC_forcevariable = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS}"
+CC_forcevariable = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS} ${@ ' -mfloat-abi=${TUNE_CCARGS_MFLOAT}' if (d.getVar('TUNE_CCARGS_MFLOAT') != '') else ''}"
 CC_forcevariable_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS} -march=armv4 -mthumb-interwork"
 
 CPP_forcevariable = "${CC} -E"
Signature · 1 line
2.14.1