diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-12-19 22:00:06 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-12-20 19:47:50 -0800 |
commit | e1a8da10f038af69b2d4fc133dea62eceb4f0d46 (patch) | |
tree | 4e7dccf3ea436a5752f9d301dac380963a733824 | |
parent | 3f800ed93dc5dc9367553e51596fdef80f77d21e (diff) | |
download | meta-openembedded-e1a8da10f038af69b2d4fc133dea62eceb4f0d46.tar.gz |
7zip: Fix build with clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-extended/7zip/7zip_24.09.bb | 32 | ||||
-rw-r--r-- | meta-oe/recipes-extended/7zip/files/0001-support-yocto-cross-compiling.patch | 18 |
2 files changed, 32 insertions, 18 deletions
diff --git a/meta-oe/recipes-extended/7zip/7zip_24.09.bb b/meta-oe/recipes-extended/7zip/7zip_24.09.bb index 2ccec78404..719a160b66 100644 --- a/meta-oe/recipes-extended/7zip/7zip_24.09.bb +++ b/meta-oe/recipes-extended/7zip/7zip_24.09.bb | |||
@@ -17,19 +17,28 @@ UPSTREAM_CHECK_URI = "https://github.com/ip7z/7zip/releases/latest" | |||
17 | S = "${WORKDIR}/git" | 17 | S = "${WORKDIR}/git" |
18 | 18 | ||
19 | # Support Yocto cross compiling | 19 | # Support Yocto cross compiling |
20 | CXXFLAGS:append:toolchain-clang = " -Wno-error=cast-qual -Wno-error=sign-conversion \ | ||
21 | -Wno-error=disabled-macro-expansion \ | ||
22 | -Wno-error=shorten-64-to-32 \ | ||
23 | -Wno-error=cast-function-type-strict" | ||
24 | |||
20 | EXTRA_OEMAKE += " \ | 25 | EXTRA_OEMAKE += " \ |
21 | CXXFLAGS_EXTRA='${CXXFLAGS}' \ | 26 | CXXFLAGS_EXTRA='${CXXFLAGS}' \ |
22 | CFLAGS_BASE2='${CFLAGS}' \ | 27 | CFLAGS_BASE2='${CFLAGS}' \ |
23 | LDFLAGS_STATIC_3='${LDFLAGS}' \ | 28 | LDFLAGS_STATIC_3='${LDFLAGS}' \ |
24 | " | 29 | " |
25 | 30 | ||
31 | # Support clang | ||
32 | MAKEFILE ?= "../../cmpl_gcc.mak" | ||
33 | MAKEFILE:class-target:toolchain-clang = "../../cmpl_clang.mak" | ||
34 | |||
26 | do_compile() { | 35 | do_compile() { |
27 | oe_runmake -C CPP/7zip/Bundles/Alone2 -f ../../cmpl_gcc.mak | 36 | oe_runmake -C CPP/7zip/Bundles/Alone2 -f ${MAKEFILE} |
28 | oe_runmake -C CPP/7zip/Bundles/Format7zF -f ../../cmpl_gcc.mak | 37 | oe_runmake -C CPP/7zip/Bundles/Format7zF -f ${MAKEFILE} |
29 | oe_runmake -C CPP/7zip/UI/Console -f ../../cmpl_gcc.mak | 38 | oe_runmake -C CPP/7zip/UI/Console -f ${MAKEFILE} |
30 | oe_runmake -C CPP/7zip/Bundles/SFXCon -f ../../cmpl_gcc.mak | 39 | oe_runmake -C CPP/7zip/Bundles/SFXCon -f ${MAKEFILE} |
31 | oe_runmake -C CPP/7zip/Bundles/Alone -f ../../cmpl_gcc.mak | 40 | oe_runmake -C CPP/7zip/Bundles/Alone -f ${MAKEFILE} |
32 | oe_runmake -C CPP/7zip/Bundles/Alone7z -f ../../cmpl_gcc.mak | 41 | oe_runmake -C CPP/7zip/Bundles/Alone7z -f ${MAKEFILE} |
33 | } | 42 | } |
34 | 43 | ||
35 | FILES:${PN} += "${libdir}/*" | 44 | FILES:${PN} += "${libdir}/*" |
@@ -37,15 +46,18 @@ FILES:${PN} += "${libdir}/*" | |||
37 | FILES_SOLIBSDEV = "" | 46 | FILES_SOLIBSDEV = "" |
38 | INSANE_SKIP:${PN} += "dev-so" | 47 | INSANE_SKIP:${PN} += "dev-so" |
39 | 48 | ||
49 | INSTALLDIR ?= "g" | ||
50 | INSTALLDIR:class-target:toolchain-clang = "c" | ||
51 | |||
40 | do_install() { | 52 | do_install() { |
41 | install -d ${D}${bindir} | 53 | install -d ${D}${bindir} |
42 | install -m 0755 ${S}/CPP/7zip/Bundles/Alone/b/g/7za ${D}${bindir} | 54 | install -m 0755 ${S}/CPP/7zip/Bundles/Alone/b/${INSTALLDIR}/7za ${D}${bindir} |
43 | install -m 0755 ${S}/CPP/7zip/Bundles/Alone7z/b/g/7zr ${D}${bindir} | 55 | install -m 0755 ${S}/CPP/7zip/Bundles/Alone7z/b/${INSTALLDIR}/7zr ${D}${bindir} |
44 | install -m 0755 ${S}/CPP/7zip/UI/Console/b/g/7z ${D}${bindir}/7z.real | 56 | install -m 0755 ${S}/CPP/7zip/UI/Console/b/${INSTALLDIR}/7z ${D}${bindir}/7z.real |
45 | install -m 0755 ${UNPACKDIR}/7z_wrapper.sh ${D}${bindir}/7z | 57 | install -m 0755 ${UNPACKDIR}/7z_wrapper.sh ${D}${bindir}/7z |
46 | 58 | ||
47 | install -d ${D}${libdir} | 59 | install -d ${D}${libdir} |
48 | install -m 0755 ${S}/CPP/7zip/Bundles/Format7zF/b/g/7z.so ${D}${libdir}/lib7z.so | 60 | install -m 0755 ${S}/CPP/7zip/Bundles/Format7zF/b/${INSTALLDIR}/7z.so ${D}${libdir}/lib7z.so |
49 | ln -rsn ${D}${libdir}/lib7z.so ${D}${bindir}/7z.so | 61 | ln -rsn ${D}${libdir}/lib7z.so ${D}${bindir}/7z.so |
50 | } | 62 | } |
51 | 63 | ||
diff --git a/meta-oe/recipes-extended/7zip/files/0001-support-yocto-cross-compiling.patch b/meta-oe/recipes-extended/7zip/files/0001-support-yocto-cross-compiling.patch index 06908e94fe..e3d0477930 100644 --- a/meta-oe/recipes-extended/7zip/files/0001-support-yocto-cross-compiling.patch +++ b/meta-oe/recipes-extended/7zip/files/0001-support-yocto-cross-compiling.patch | |||
@@ -21,8 +21,6 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | |||
21 | CPP/7zip/var_gcc.mak | 2 -- | 21 | CPP/7zip/var_gcc.mak | 2 -- |
22 | 2 files changed, 1 insertion(+), 3 deletions(-) | 22 | 2 files changed, 1 insertion(+), 3 deletions(-) |
23 | 23 | ||
24 | diff --git a/CPP/7zip/7zip_gcc.mak b/CPP/7zip/7zip_gcc.mak | ||
25 | index bcb06a0..297f0a8 100644 | ||
26 | --- a/CPP/7zip/7zip_gcc.mak | 24 | --- a/CPP/7zip/7zip_gcc.mak |
27 | +++ b/CPP/7zip/7zip_gcc.mak | 25 | +++ b/CPP/7zip/7zip_gcc.mak |
28 | @@ -45,7 +45,7 @@ CFLAGS_DEBUG = -g | 26 | @@ -45,7 +45,7 @@ CFLAGS_DEBUG = -g |
@@ -30,12 +28,10 @@ index bcb06a0..297f0a8 100644 | |||
30 | CFLAGS_DEBUG = -DNDEBUG | 28 | CFLAGS_DEBUG = -DNDEBUG |
31 | ifneq ($(CC), $(CROSS_COMPILE)clang) | 29 | ifneq ($(CC), $(CROSS_COMPILE)clang) |
32 | -LFLAGS_STRIP = -s | 30 | -LFLAGS_STRIP = -s |
33 | +LFLAGS_STRIP = | 31 | +LFLAGS_STRIP = |
34 | endif | 32 | endif |
35 | endif | 33 | endif |
36 | 34 | ||
37 | diff --git a/CPP/7zip/var_gcc.mak b/CPP/7zip/var_gcc.mak | ||
38 | index 664491c..6d0f485 100644 | ||
39 | --- a/CPP/7zip/var_gcc.mak | 35 | --- a/CPP/7zip/var_gcc.mak |
40 | +++ b/CPP/7zip/var_gcc.mak | 36 | +++ b/CPP/7zip/var_gcc.mak |
41 | @@ -6,7 +6,5 @@ IS_ARM64= | 37 | @@ -6,7 +6,5 @@ IS_ARM64= |
@@ -46,6 +42,12 @@ index 664491c..6d0f485 100644 | |||
46 | -CXX=$(CROSS_COMPILE)g++ | 42 | -CXX=$(CROSS_COMPILE)g++ |
47 | 43 | ||
48 | # -march=armv8-a+crc+crypto | 44 | # -march=armv8-a+crc+crypto |
49 | -- | 45 | --- a/CPP/7zip/var_clang.mak |
50 | 2.34.1 | 46 | +++ b/CPP/7zip/var_clang.mak |
51 | 47 | @@ -6,6 +6,4 @@ IS_ARM64= | |
48 | CROSS_COMPILE= | ||
49 | MY_ARCH= | ||
50 | USE_ASM= | ||
51 | -CC=$(CROSS_COMPILE)clang | ||
52 | -CXX=$(CROSS_COMPILE)clang++ | ||
53 | USE_CLANG=1 | ||