Misc fixes
cover Misc fixes
clang finds couple of more issues to weed out
The following changes since commit d1d55041e38b12d40f896834b56475ea19a6047f:
sstate: Ensure installation directory is empty before execution (2017-03-22 10:12:10 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib kraj/pu
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=kraj/pu
Khem Raj (2):
db: Fix atomic function namespace clash with clang builtins
libvorbis: Contain gcc specific compiler flags using configure option
.../libvorbis/0001-configure-Check-for-clang.patch | 56 ++++++++++++++++++++++ .../libvorbis/libvorbis_1.3.5.bb | 4 +- ...me-local-__atomic_compare_exchange-to-avo.patch | 45 +++++++++++++++++ meta/recipes-support/db/db_5.3.28.bb | 1 + 4 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-multimedia/libvorbis/libvorbis/0001-configure-Check-for-clang.patch create mode 100644 meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch
Signature · 1 line
2.12.1
PATCH 1/2 db: Fix atomic function namespace clash with clang builtins
Rename local function to avoid conflicts with compiler intrinsics
--- ...me-local-__atomic_compare_exchange-to-avo.patch | 45 ++++++++++++++++++++++ meta/recipes-support/db/db_5.3.28.bb | 1 + 2 files changed, 46 insertions(+) create mode 100644 meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch
meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch new file +45 -0
@@ -0,0 +1,45 @@ +From 29621d637e30982489693f2e207ce6a1790e3337 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 22 Mar 2017 15:32:26 +0000 +Subject: [PATCH] atomic: Rename local __atomic_compare_exchange to avoid clash + with builtins + +Helps building with clang + +Fixes + +../db-5.3.28/src/dbinc/atomic.h:179:19: error: definition of builtin function '__atomic_compare_exchange' +static inline int __atomic_compare_exchange( + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + src/dbinc/atomic.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h +index 6a858f7..1b49de5 100644 +--- a/src/dbinc/atomic.h ++++ b/src/dbinc/atomic.h +@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val; + #define atomic_inc(env, p) __atomic_inc(p) + #define atomic_dec(env, p) __atomic_dec(p) + #define atomic_compare_exchange(env, p, o, n) \ +- __atomic_compare_exchange((p), (o), (n)) ++ __db_atomic_compare_exchange((p), (o), (n)) + static inline int __atomic_inc(db_atomic_t *p) + { + int temp; +@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p) + * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html + * which configure could be changed to use. + */ +-static inline int __atomic_compare_exchange( ++static inline int __db_atomic_compare_exchange( + db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval) + { + atomic_value_t was; +-- +1.8.3.1 +
meta/recipes-support/db/db_5.3.28.bb +1 -0
@@ -21,6 +21,7 @@ PE = "1" SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz" SRC_URI += "file://arm-thumb-mutex_db5.patch \ file://fix-parallel-build.patch \ + file://0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch \ " SRC_URI[md5sum] = "b99454564d5b4479750567031d66fe24"
Signature · 1 line
2.12.1
PATCH 2/2 libvorbis: Contain gcc specific compiler flags using configure option
In reply to Khem Raj--- .../libvorbis/0001-configure-Check-for-clang.patch | 56 ++++++++++++++++++++++ .../libvorbis/libvorbis_1.3.5.bb | 4 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-multimedia/libvorbis/libvorbis/0001-configure-Check-for-clang.patch
meta/recipes-multimedia/libvorbis/libvorbis/0001-configure-Check-for-clang.patch new file +56 -0
@@ -0,0 +1,56 @@ +From 44b4511784f9b51c514dff4ceb3cbeaf9c374d08 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 22 Mar 2017 16:06:55 +0000 +Subject: [PATCH] configure: Check for clang + +Disable gcc specific options if using clang + +Signed-off-by: Khem Raj <[email protected]> +--- +Upstream-Status: Pending + + configure.ac | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index eddd02d..00ecba5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -93,6 +93,16 @@ AC_ARG_ENABLE(examples, + + AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$enable_examples" = xyes]) + ++AC_MSG_CHECKING([whether C compiler is clang]) ++$CC -x c /dev/null -dM -E > conftest.txt 2>&1 ++if grep "__clang__" conftest.txt >/dev/null 2>&1; then ++ AC_SUBST([CC_CLANG], [1]) ++ AC_MSG_RESULT([yes]) ++ else ++ AC_SUBST([CC_CLANG], [0]) ++ AC_MSG_RESULT([no]) ++fi ++ + dnl -------------------------------------------------- + dnl Set build flags based on environment + dnl -------------------------------------------------- +@@ -127,10 +137,15 @@ else + AC_MSG_RESULT([$GCC_VERSION]) + case $host in + *86-*-linux*) ++ if test "$CC_CLANG" = "1"; then ++ ieeefp="" ++ else ++ ieefp="-mno-ieee-fp" ++ fi + DEBUG="-g -Wall -Wextra -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char" +- CFLAGS="-O3 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char" ++ CFLAGS="-O3 -ffast-math -D_REENTRANT -fsigned-char ${ieefp}" + # PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -D_REENTRANT -fsigned-char -fno-inline -static" +- PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math -mno-ieee-fp -D_REENTRANT -fsigned-char -fno-inline" ++ PROFILE="-Wall -Wextra -pg -g -O3 -ffast-math ${ieefp} -D_REENTRANT -fsigned-char -fno-inline" + + # glibc < 2.1.3 has a serious FP bug in the math inline header + # that will cripple Vorbis. Look to see if the magic FP stack +-- +1.8.3.1 +
meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb +3 -1
@@ -10,7 +10,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7d2c487d2fc7dd3e3c7c465a5b7f6217 \ file://include/vorbis/vorbisenc.h;beginline=1;endline=11;md5=d1c1d138863d6315131193d4046d81cb" DEPENDS = "libogg" -SRC_URI = "http://downloads.xiph.org/releases/vorbis/${BP}.tar.xz" +SRC_URI = "http://downloads.xiph.org/releases/vorbis/${BP}.tar.xz \ + file://0001-configure-Check-for-clang.patch \ + " SRC_URI[md5sum] = "28cb28097c07a735d6af56e598e1c90f" SRC_URI[sha256sum] = "54f94a9527ff0a88477be0a71c0bab09a4c3febe0ed878b24824906cd4b0e1d1"
Signature · 1 line
2.12.1