Clang inspired fixes
cover Clang inspired fixes
Trying to get OE-Core built using clang came up with some errors which could be fixed with updating to newer revision or backporting some of upstreamed patches
Hongxu Jia (1):
ghostscript: 9.16 -> 9.18
Khem Raj (1):
strace: Backport fixes for compiling with clang
...01-Move-gcc-compat-macros-to-gcc_compat.h.patch | 176 ++++++++++++
...1-scm_rights-fd.test-rewrite-without-fork.patch | 198 +++++++++++++
.../strace/0001-tests-introduce-libtests.patch | 306 +++++++++++++++++++++
.../0001-tests-scm_rights.c-use-libtests.patch | 54 ++++
meta/recipes-devtools/strace/strace_4.11.bb | 4 +
...Fix-support-for-building-with-no-jbig2-de.patch | 81 ++++++
...part-2-fix-support-for-building-with-a-JP.patch | 48 ++++
.../files/do-not-check-local-libpng-source.patch | 38 +++
.../{ghostscript_9.16.bb => ghostscript_9.18.bb} | 11 +-
9 files changed, 912 insertions(+), 4 deletions(-)
create mode 100644 meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch
create mode 100644 meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch
create mode 100644 meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch
create mode 100644 meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch
create mode 100644 meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch
create mode 100644 meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch
create mode 100644 meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch
rename meta/recipes-extended/ghostscript/{ghostscript_9.16.bb => ghostscript_9.18.bb} (87%)Signature · 1 line
1.9.1
PATCH 1/2 ghostscript: 9.16 -> 9.18
From: Hongxu Jia <[email protected]>
- Backport patches to fix build failure caused by '--without-jbig2dec' and '--without-jbig2dec'.
...
|make[1]: *** No rule to make target obj/sjbig2_.dev', needed by obj/sjbig2.dev'. Stop.
...
http://bugs.ghostscript.com/show_bug.cgi?id=696497
- Previously, it did not build the whole local libpng source in ghostscript, only picked up specific files and compile them. But on ghostscript 9.18, when the arm's FPU has been set to NEON (-mfpu=neon * with GCC), the selected file "libpng/pngrutil.c" needs to link 'png_init_filter_functions_neon' which should be compiled by a non-selected file "libpng/arm/arm_init.c".
...
|./obj/pngrutil.o: In function `png_init_filter_functions':
|armv7a-neon-poky-linux-gnueabi/ghostscript/9.18-r0/build/../ ghostscript-9.18/libpng/pngrutil.c:3921: undefined reference to `png_init_filter_functions_neon'
...
So do not compile local libpng source in ghostscript, use shared libpng to instead.
---
...Fix-support-for-building-with-no-jbig2-de.patch | 81 ++++++++++++++++++++++
...part-2-fix-support-for-building-with-a-JP.patch | 48 +++++++++++++
.../files/do-not-check-local-libpng-source.patch | 38 ++++++++++
.../{ghostscript_9.16.bb => ghostscript_9.18.bb} | 11 +--
4 files changed, 174 insertions(+), 4 deletions(-)
create mode 100644 meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch
create mode 100644 meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch
create mode 100644 meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch
rename meta/recipes-extended/ghostscript/{ghostscript_9.16.bb => ghostscript_9.18.bb} (87%)meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch new file +81 -0
@@ -0,0 +1,81 @@ +From 1d19998091154f89b8294e4594a05986b4c2f822 Mon Sep 17 00:00:00 2001 +From: Chris Liddell <[email protected]> +Date: Wed, 13 Jan 2016 02:08:42 -0500 +Subject: [PATCH 1/2] Bug 696497: Fix support for building with no jbig2 + decoder + +Author: Chris Liddell <[email protected]> + +Upstream-Status: Backport +http://bugs.ghostscript.com/show_bug.cgi?id=696497 +http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=b0f5a975 +Signed-off-by: Hongxu Jia <[email protected]> +--- + base/lib.mak | 9 +++++++++ + psi/int.mak | 23 ++++++++++++++++++----- + 2 files changed, 27 insertions(+), 5 deletions(-) + +diff --git a/base/lib.mak b/base/lib.mak +index 241df2f..daa7056 100644 +--- a/base/lib.mak ++++ b/base/lib.mak +@@ -1732,6 +1732,10 @@ $(GLD)sjbig2_jbig2dec.dev : $(LIB_MAK) $(ECHOGS_XE) \ + $(SETMOD) $(GLD)sjbig2_jbig2dec $(sjbig2_jbig2dec) + $(ADDMOD) $(GLD)sjbig2_jbig2dec -include $(GLD)jbig2dec.dev + ++$(GLD)sjbig2_.dev : $(LIB_MAK) $(ECHOGS_XE) \ ++ $(LIB_MAK) $(MAKEDIRS) ++ $(SETMOD) $(GLD)sjbig2_ ++ + # jbig2dec.dev is defined in jbig2.mak + + $(GLOBJ)sjbig2.$(OBJ) : $(GLSRC)sjbig2.c $(AK) \ +@@ -1739,6 +1743,11 @@ $(GLOBJ)sjbig2.$(OBJ) : $(GLSRC)sjbig2.c $(AK) \ + $(sjbig2_h) $(strimpl_h) $(MAKEDIRS) + $(GLJBIG2CC) $(GLO_)sjbig2.$(OBJ) $(C_) $(GLSRC)sjbig2.c + ++$(GLOBJ)snojbig2.$(OBJ) : $(GLSRC)snojbig2.c $(AK) \ ++ $(stdint__h) $(memory__h) $(stdio__h) $(gserrors_h) $(gdebug_h) \ ++ $(strimpl_h) $(LIB_MAK) $(MAKEDIRS) ++ $(GLJBIG2CC) $(GLO_)snojbig2.$(OBJ) $(C_) $(GLSRC)snojbig2.c ++ + # luratech version + sjbig2_luratech=$(GLOBJ)sjbig2_luratech.$(OBJ) + +diff --git a/psi/int.mak b/psi/int.mak +index 6149a3b..f9d667d 100644 +--- a/psi/int.mak ++++ b/psi/int.mak +@@ -1254,11 +1254,24 @@ $(PSOBJ)zfaes.$(OBJ) : $(PSSRC)zfaes.c $(OP) $(memory__h)\ + # this can be turned on and off with a FEATURE_DEV + + fjbig2_=$(PSOBJ)zfjbig2_$(JBIG2_LIB).$(OBJ) +-$(PSD)jbig2.dev : $(INT_MAK) $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\ +- $(MAKEDIRS) +- $(SETMOD) $(PSD)jbig2 $(fjbig2_) +- $(ADDMOD) $(PSD)jbig2 -include $(GLD)sjbig2 +- $(ADDMOD) $(PSD)jbig2 -oper zfjbig2 ++ ++$(PSD)jbig2_jbig2dec.dev : $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\ ++ $(INT_MAK) $(MAKEDIRS) ++ $(SETMOD) $(PSD)jbig2_jbig2dec $(fjbig2_) ++ $(ADDMOD) $(PSD)jbig2_jbig2dec -include $(GLD)sjbig2 ++ $(ADDMOD) $(PSD)jbig2_jbig2dec -oper zfjbig2 ++ ++$(PSD)jbig2_luratech.dev : $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\ ++ $(INT_MAK) $(MAKEDIRS) ++ $(SETMOD) $(PSD)jbig2_luratech $(fjbig2_) ++ $(ADDMOD) $(PSD)jbig2_luratech -include $(GLD)sjbig2 ++ $(ADDMOD) $(PSD)jbig2_luratech -oper zfjbig2 ++ ++$(PSD)jbig2_.dev : $(ECHOGS_XE) $(INT_MAK) $(MAKEDIRS) ++ $(SETMOD) $(PSD)jbig2_ ++ ++$(PSD)jbig2.dev : $(PSD)jbig2_$(JBIG2_LIB).dev $(INT_MAK) $(MAKEDIRS) ++ $(CP_) $(PSD)jbig2_$(JBIG2_LIB).dev $(PSD)jbig2.dev + + $(PSOBJ)zfjbig2_jbig2dec.$(OBJ) : $(PSSRC)zfjbig2.c $(OP) $(memory__h)\ + $(gsstruct_h) $(gstypes_h) $(ialloc_h) $(idict_h) $(ifilter_h)\ +-- +1.9.1 +
meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch new file +48 -0
48 lines not on this page · raw message
meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch new file +38 -0
@@ -0,0 +1,38 @@ +From 5ef8b85bc98f3bd9a15d5f47e24d3e23ae27c265 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <[email protected]> +Date: Mon, 18 Jan 2016 01:00:30 -0500 +Subject: [PATCH] configure.ac: do not check local png source + +In oe-core, it did not need to compile local libpng +source in ghostscript, so do not check local png +source, and directly check the existance of shared +libpng library. + +Upstream-Status: Inappropriate [OE-Core specific] + +Signed-off-by: Hongxu Jia <[email protected]> +--- + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index ab30a97..b762fd7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -955,11 +955,11 @@ AC_SUBST(ZLIBDIR) + AC_SUBST(FT_SYS_ZLIB) + + dnl png for the png output device; it also requires zlib +-LIBPNGDIR=src ++LIBPNGDIR=$srcdir/libpng + PNGDEVS='' + PNGDEVS_ALL='png48 png16m pnggray pngmono png256 png16 pngalpha' + AC_MSG_CHECKING([for local png library source]) +-if test -f $srcdir/libpng/pngread.c; then ++if false; then + AC_MSG_RESULT([yes]) + SHARE_LIBPNG=0 + LIBPNGDIR=$srcdir/libpng +-- +1.9.1 +
meta/recipes-extended/ghostscript/ghostscript_9.18.bb renamed from meta/recipes-extended/ghostscript/ghostscript_9.16.bb +7 -4
@@ -13,13 +13,16 @@ SECTION = "console/utils" LICENSE = "GPLv3" LIC_FILES_CHKSUM = "file://LICENSE;md5=b17cea54743435ab2a581c237bea294a" -DEPENDS = "ghostscript-native tiff jpeg fontconfig cups" -DEPENDS_class-native = "" +DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng" +DEPENDS_class-native = "libpng-native" SRC_URI_BASE = "http://downloads.ghostscript.com/public/ghostscript-${PV}.tar.gz \ file://ghostscript-9.15-parallel-make.patch \ file://ghostscript-9.16-Werror-return-type.patch \ file://png_mak.patch \ + file://0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch \ + file://0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch \ + file://do-not-check-local-libpng-source.patch \ " SRC_URI = "${SRC_URI_BASE} \
@@ -34,8 +37,8 @@ SRC_URI_class-native = "${SRC_URI_BASE} \ file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \ " -SRC_URI[md5sum] = "829319325bbdb83f5c81379a8f86f38f" -SRC_URI[sha256sum] = "746d77280cca8afdd3d4c2c1389e332ed9b0605bd107bcaae1d761b061d1a68d" +SRC_URI[md5sum] = "33a47567d7a591c00a253caddd12a88a" +SRC_URI[sha256sum] = "5fc93079749a250be5404c465943850e3ed5ffbc0d5c07e10c7c5ee8afbbdb1b" EXTRA_OECONF = "--without-x --with-system-libtiff --without-jbig2dec \ --with-fontpath=${datadir}/fonts \
Signature · 1 line
1.9.1
PATCH 2/2 strace: Backport fixes for compiling with clang
In reply to Khem RajBackport fixes needed to avoid use of VLAs which is not available on clang/llvm
--- ...01-Move-gcc-compat-macros-to-gcc_compat.h.patch | 176 ++++++++++++ ...1-scm_rights-fd.test-rewrite-without-fork.patch | 198 +++++++++++++ .../strace/0001-tests-introduce-libtests.patch | 306 +++++++++++++++++++++ .../0001-tests-scm_rights.c-use-libtests.patch | 54 ++++ meta/recipes-devtools/strace/strace_4.11.bb | 4 + 5 files changed, 738 insertions(+) create mode 100644 meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch create mode 100644 meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch create mode 100644 meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch create mode 100644 meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch
meta/recipes-devtools/strace/strace/0001-Move-gcc-compat-macros-to-gcc_compat.h.patch new file +176 -0
@@ -0,0 +1,176 @@ +From f32126ba790dd4e61d43a2140b24f02426297bb6 Mon Sep 17 00:00:00 2001 +From: "Dmitry V. Levin" <[email protected]> +Date: Thu, 31 Dec 2015 14:19:41 +0000 +Subject: [PATCH] Move gcc compat macros to gcc_compat.h + +* defs.h: Include "gcc_compat.h". +(GNUC_PREREQ, ATTRIBUTE_NORETURN, ATTRIBUTE_FORMAT, +ATTRIBUTE_ALIGNED, ATTRIBUTE_PACKED, ATTRIBUTE_MALLOC, +ATTRIBUTE_NOINLINE, ATTRIBUTE_ALLOC_SIZE): Move ... +* gcc_compat.h: ... here. +* Makefile.am (strace_SOURCES): Add gcc_compat.h. +--- +Signed-off-by: Khem Raj <[email protected]> +Upstream-Status: Backport + + Makefile.am | 1 + + defs.h | 43 +---------------------------------- + gcc_compat.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 75 insertions(+), 42 deletions(-) + create mode 100644 gcc_compat.h + +diff --git a/Makefile.am b/Makefile.am +index ab52778..d43608d 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -97,6 +97,7 @@ strace_SOURCES = \ + flock.c \ + flock.h \ + futex.c \ ++ gcc_compat.h \ + get_robust_list.c \ + getcpu.c \ + getcwd.c \ +diff --git a/defs.h b/defs.h +index 283ab1f..bae212c 100644 +--- a/defs.h ++++ b/defs.h +@@ -55,6 +55,7 @@ + #include <sys/syscall.h> + + #include "mpers_type.h" ++#include "gcc_compat.h" + + #ifndef HAVE_STRERROR + const char *strerror(int); +@@ -68,48 +69,6 @@ const char *strerror(int); + extern char *stpcpy(char *dst, const char *src); + #endif + +-#if defined __GNUC__ && defined __GNUC_MINOR__ +-# define GNUC_PREREQ(maj, min) \ +- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +-#else +-# define __attribute__(x) /* empty */ +-# define GNUC_PREREQ(maj, min) 0 +-#endif +- +-#if GNUC_PREREQ(2, 5) +-# define ATTRIBUTE_NORETURN __attribute__((__noreturn__)) +-#else +-# define ATTRIBUTE_NORETURN /* empty */ +-#endif +- +-#if GNUC_PREREQ(2, 7) +-# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args)) +-# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg))) +-# define ATTRIBUTE_PACKED __attribute__((__packed__)) +-#else +-# define ATTRIBUTE_FORMAT(args) /* empty */ +-# define ATTRIBUTE_ALIGNED(arg) /* empty */ +-# define ATTRIBUTE_PACKED /* empty */ +-#endif +- +-#if GNUC_PREREQ(3, 0) +-# define ATTRIBUTE_MALLOC __attribute__((__malloc__)) +-#else +-# define ATTRIBUTE_MALLOC /* empty */ +-#endif +- +-#if GNUC_PREREQ(3, 1) +-# define ATTRIBUTE_NOINLINE __attribute__((__noinline__)) +-#else +-# define ATTRIBUTE_NOINLINE /* empty */ +-#endif +- +-#if GNUC_PREREQ(4, 3) +-# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args)) +-#else +-# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */ +-#endif +- + #ifndef offsetof + # define offsetof(type, member) \ + (((char *) &(((type *) NULL)->member)) - ((char *) (type *) NULL)) +diff --git a/gcc_compat.h b/gcc_compat.h +new file mode 100644 +index 0000000..1f2c835 +--- /dev/null ++++ b/gcc_compat.h +@@ -0,0 +1,73 @@ ++/* ++ * Copyright (c) 2015 Dmitry V. Levin <[email protected]> ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * 3. The name of the author may not be used to endorse or promote products ++ * derived from this software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#ifndef GCC_COMPAT_H_ ++#define GCC_COMPAT_H_ ++ ++#if defined __GNUC__ && defined __GNUC_MINOR__ ++# define GNUC_PREREQ(maj, min) \ ++ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) ++#else ++# define __attribute__(x) /* empty */ ++# define GNUC_PREREQ(maj, min) 0 ++#endif ++ ++#if GNUC_PREREQ(2, 5) ++# define ATTRIBUTE_NORETURN __attribute__((__noreturn__)) ++#else ++# define ATTRIBUTE_NORETURN /* empty */ ++#endif ++ ++#if GNUC_PREREQ(2, 7) ++# define ATTRIBUTE_FORMAT(args) __attribute__((__format__ args)) ++# define ATTRIBUTE_ALIGNED(arg) __attribute__((__aligned__(arg))) ++# define ATTRIBUTE_PACKED __attribute__((__packed__)) ++#else ++# define ATTRIBUTE_FORMAT(args) /* empty */ ++# define ATTRIBUTE_ALIGNED(arg) /* empty */ ++# define ATTRIBUTE_PACKED /* empty */ ++#endif ++ ++#if GNUC_PREREQ(3, 0) ++# define ATTRIBUTE_MALLOC __attribute__((__malloc__)) ++#else ++# define ATTRIBUTE_MALLOC /* empty */ ++#endif ++ ++#if GNUC_PREREQ(3, 1) ++# define ATTRIBUTE_NOINLINE __attribute__((__noinline__)) ++#else ++# define ATTRIBUTE_NOINLINE /* empty */ ++#endif ++ ++#if GNUC_PREREQ(4, 3) ++# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args)) ++#else ++# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */ ++#endif ++ ++#endif +-- +1.9.1 +
meta/recipes-devtools/strace/strace/0001-scm_rights-fd.test-rewrite-without-fork.patch new file +198 -0
198 lines not on this page · raw message
meta/recipes-devtools/strace/strace/0001-tests-introduce-libtests.patch new file +306 -0
306 lines not on this page · raw message
meta/recipes-devtools/strace/strace/0001-tests-scm_rights.c-use-libtests.patch new file +54 -0
54 lines not on this page · raw message
meta/recipes-devtools/strace/strace_4.11.bb +4 -0
@@ -11,6 +11,10 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \ file://use-asm-sgidefs.h.patch \ file://0001-arc-metag-nios2-or1k-tile-fix-build.patch \ file://Makefile-ptest.patch \ + file://0001-tests-scm_rights.c-use-libtests.patch \ + file://0001-scm_rights-fd.test-rewrite-without-fork.patch \ + file://0001-Move-gcc-compat-macros-to-gcc_compat.h.patch \ + file://0001-tests-introduce-libtests.patch \ file://run-ptest \ "
Signature · 1 line
1.9.1