Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-oe][PATCH 01/49] libqmi: Fix build with clang
Date: Wed, 23 Nov 2016 01:21:21 -0800	[thread overview]
Message-ID: <20161123092209.23699-1-raj.khem@gmail.com> (raw)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../libqmi/libqmi/0001-Detect-clang.patch          | 84 ++++++++++++++++++++++
 .../recipes-connectivity/libqmi/libqmi_1.16.0.bb   |  4 +-
 2 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-connectivity/libqmi/libqmi/0001-Detect-clang.patch

diff --git a/meta-oe/recipes-connectivity/libqmi/libqmi/0001-Detect-clang.patch b/meta-oe/recipes-connectivity/libqmi/libqmi/0001-Detect-clang.patch
new file mode 100644
index 0000000..4047ffb
--- /dev/null
+++ b/meta-oe/recipes-connectivity/libqmi/libqmi/0001-Detect-clang.patch
@@ -0,0 +1,84 @@
+From 4cfb728804157e8f3c69e11ba4df449d8f76388f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Oct 2016 04:42:26 +0000
+Subject: [PATCH] Detect clang
+
+Check for clang compiler since we need to disable
+unused-function warning for clang, at same time
+pass werror when checking for compiler options if
+werror is enabled so spurious options do not get
+enabled. Only the ones that are supported by given
+compiler are accepted.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+---
+ m4/compiler-warnings.m4 | 29 +++++++++++++++++++++++++----
+ 1 file changed, 25 insertions(+), 4 deletions(-)
+
+diff --git a/m4/compiler-warnings.m4 b/m4/compiler-warnings.m4
+index de4a8b0..e4ba718 100644
+--- a/m4/compiler-warnings.m4
++++ b/m4/compiler-warnings.m4
+@@ -2,10 +2,30 @@ AC_DEFUN([LIBQMI_COMPILER_WARNINGS],
+ [AC_ARG_ENABLE(more-warnings,
+ 	AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]),
+ 	set_more_warnings="$enableval",set_more_warnings=error)
++
++# Clang throws a lot of warnings when it does not understand a flag. Disable
++# this warning for now so other warnings are visible.
++AC_MSG_CHECKING([if compiling with clang])
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
++#ifndef __clang__
++	not clang
++#endif
++	]])],
++	[CLANG=yes],
++	[CLANG=no]
++)
++AC_MSG_RESULT([$CLANG])
++AS_IF([test "x$CLANG" = "xyes"], [CLANG_FLAGS=-Wno-error=unused-function])
++CFLAGS="$CFLAGS $CLANG_FLAGS"
++LDFLAGS="$LDFLAGS $CLANG_FLAGS"
++
+ AC_MSG_CHECKING(for more warnings)
+ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
+ 	AC_MSG_RESULT(yes)
+ 	CFLAGS="-Wall -std=gnu89 $CFLAGS"
++	if test "x$set_more_warnings" = xerror; then
++		WERROR="-Werror"
++	fi
+ 
+ 	for option in -Wmissing-declarations -Wmissing-prototypes \
+ 		      -Wdeclaration-after-statement -Wstrict-prototypes \
+@@ -17,22 +37,23 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
+ 		      -Wmissing-include-dirs -Waggregate-return \
+ 		      -Wformat-security; do
+ 		SAVE_CFLAGS="$CFLAGS"
+-		CFLAGS="$CFLAGS $option"
++		CFLAGS="$CFLAGS $option $WERROR"
+ 		AC_MSG_CHECKING([whether gcc understands $option])
+ 		AC_TRY_COMPILE([], [],
+ 			has_option=yes,
+ 			has_option=no,)
+ 		if test $has_option = no; then
+ 			CFLAGS="$SAVE_CFLAGS"
++		else
++			CFLAGS="$SAVE_CFLAGS $option"
+ 		fi
+ 		AC_MSG_RESULT($has_option)
+ 		unset has_option
+ 		unset SAVE_CFLAGS
+ 	done
++	CFLAGS="$CFLAGS $WERROR"
+ 	unset option
+-	if test "x$set_more_warnings" = xerror; then
+-		CFLAGS="$CFLAGS -Werror"
+-	fi
++	unset WERROR
+ else
+ 	AC_MSG_RESULT(no)
+ fi
+-- 
+1.9.1
+
diff --git a/meta-oe/recipes-connectivity/libqmi/libqmi_1.16.0.bb b/meta-oe/recipes-connectivity/libqmi/libqmi_1.16.0.bb
index 5ac889f..679b102 100644
--- a/meta-oe/recipes-connectivity/libqmi/libqmi_1.16.0.bb
+++ b/meta-oe/recipes-connectivity/libqmi/libqmi_1.16.0.bb
@@ -11,6 +11,8 @@ DEPENDS = "glib-2.0 libgudev libmbim"
 
 inherit autotools pkgconfig bash-completion
 
-SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz"
+SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BPN}-${PV}.tar.xz \
+           file://0001-Detect-clang.patch \
+           "
 SRC_URI[md5sum] = "4970c110f160b33637a3515004c637b2"
 SRC_URI[sha256sum] = "7ab6bb47fd23bf4d3fa17424e40ea5552d08b19e5ee4f125f21f316c8086ba2a"
-- 
2.10.2



             reply	other threads:[~2016-11-23  9:22 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23  9:21 Khem Raj [this message]
2016-11-23  9:21 ` [meta-oe][PATCH 02/49] meta_oe_security_flags: Disable PIE for s3c64xx-gpio/s3c24xx-gpio/cpufrequtils Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 03/49] boinc: Add recipe for boinc-client Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 04/49] libplist: Remove rpaths surgically Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 05/49] meta_oe_security_flags.inc: Add libcec, libmodplug, libcdio Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 06/49] dcadec, libsquish: Add new recipes Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 07/49] libcec: Update to 3.1.0+ Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 08/49] kodi: Add krypton/17.x Jarvis/16.x recipes Khem Raj
2016-11-26  0:15   ` Martin Jansa
2016-11-26  7:42     ` Koen Kooi
2016-11-28 17:48       ` Khem Raj
2016-11-29  0:57     ` Khem Raj
2016-12-15  9:53       ` Martin Jansa
2016-11-23  9:21 ` [meta-oe][PATCH 09/49] fwts: Update to 16.09 release Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 10/49] libvdpau: Add recipe Khem Raj
2016-12-17 23:53   ` Martin Jansa
2016-12-19 21:10     ` Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 11/49] krb5: Add -fPIC to compile flags Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 12/49] Disable PIE for libvdpau Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 13/49] kodi: Fix build with pic on x86_64 Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 14/49] kodi-17: Add packageconfig for lcms support Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 15/49] samba: Fix build with musl Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 16/49] lockdev: Pretend GNU libc on musl Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 17/49] kodi-17: Fix build with musl Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH V2 18/49] breakpad: Upgrade to latest Khem Raj
2016-11-26  0:12   ` Martin Jansa
2016-11-26  6:09     ` Khem Raj
2016-11-23  9:21 ` [meta-filesystems][PATCH 19/49] xfsprogs: Upgrade 3.2.3 -> 4.8.0 Khem Raj
2016-11-25  0:31   ` Martin Jansa
2016-11-25 10:41     ` Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 20/49] arno-iptables-firewall: Add recipe Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 21/49] dibbler: " Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 22/49] ez-ipupdate: " Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 23/49] miniupnpd: " Khem Raj
2016-11-26  0:16   ` Martin Jansa
2016-11-26  6:00     ` Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 24/49] inetutils: Disable rsh, rcp, rlogin on musl Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 25/49] ssmtp: Add recipe Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 26/49] ne10: Update to latest Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 27/49] libgit2: Update to 0.24.3 Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 28/49] openldap: Fix Build error due to missing -fPIC Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 29/49] dante: Add recipe for 1.4.1 Khem Raj
2016-11-26  0:16   ` Martin Jansa
2016-11-26  6:03     ` Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 30/49] networkmanager-openvpn: Update 1.0.8->1.2.6 Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 31/49] openobex,obexftp: Update recipes Khem Raj
2016-11-26  0:17   ` Martin Jansa
2016-11-26  4:57     ` Khem Raj
2016-11-26  6:02       ` Khem Raj
2016-11-26  9:08         ` Martin Jansa
2016-11-28 19:38           ` Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 32/49] md5deep: Fix build with clang Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 33/49] dialog: Update 1.3-20160424 -> 1.3-20160828 Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 34/49] ipsec-tools: Fix build with clang Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 35/49] crda: " Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 36/49] obex-data-server: Fix build with new openobex version Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 37/49] flashrom: Remove redundant const qualifier Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 38/49] fribidi: Fix build with security flags turned on Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 39/49] libmicrohttpd: Upgrade to 0.9.52 Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 40/49] jsoncpp: Add new recipe Khem Raj
2016-11-28 10:46   ` Piotr Lewicki
2016-11-28 21:10     ` Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 41/49] jsonrpc: Add recipe Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 42/49] libmad: Fix build with clang Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 43/49] modemmanager: " Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 44/49] libcec: Add missing dep on ncurses Khem Raj
2016-11-23  9:22 ` [meta-multimedia][PATCH 45/49] kodi-17: Update to latest Khem Raj
2016-11-23  9:22 ` [meta-multimedia][PATCH 46/49] tvheadend: Update to 4.0.9 Khem Raj
2016-11-26  0:18   ` Martin Jansa
2016-11-26  4:56     ` Khem Raj
2016-11-23  9:22 ` [meta-networking][PATCH 47/49] memcached: Update to 1.4.33 Khem Raj
2016-11-23  9:22 ` [meta-multimedia][PATCH 48/49] vlc: Add packageconfig for vdpau Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 49/49] mpv: Add libvdpau to DEPENDS Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161123092209.23699-1-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox