All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] World build fixes with gcc-5
@ 2015-04-22  7:49 Khem Raj
  2015-04-22  7:49 ` [PATCH 01/10] connman: Fix builds to compile on musl Khem Raj
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

This patchset contains fixes needed for building world using
gcc-5, gcc-5 recipes are still in contrib tree. First lets fix
the recipes

connman fix and packagegroup fix is needed for making sure that
these packagegroups are marked glibc specific or independent using
overrides, helps in paving way for doing world builds for non
glibc based systems


The following changes since commit 166f2587468ae71988c610858aad3f7ef67eccba:

  bison: don't depend on help2man (2015-04-21 11:29:30 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib kraj/for-master
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/for-master

Khem Raj (10):
  connman: Fix builds to compile on musl
  glibc, packagegroup-self-hosted, packagegroup-core-lsb: Consider
    non-glibc libcs
  insserv: Fix build with gcc5 and clang
  xserver-xorg: Fix build with gcc-5
  u-boot-mkimage: Backport fix from upstream to fix build with gcc-5
  mdadm: Fix inline semantics
  lttng-tools: Add extern qualifier to declarations in .h file
  subversion: Add -P to CPPFLAGS
  gnome-icon-theme: Needs nls.m4
  gtk+: Correct function prototype

 meta/recipes-bsp/u-boot/u-boot-mkimage/gcc5.patch  |  91 +++++
 meta/recipes-bsp/u-boot/u-boot-mkimage_2015.01.bb  |   4 +-
 ...cktrace-API-only-when-compiling-for-glibc.patch |  41 ++
 .../connman/connman/0002-musl-header-fixes.patch   | 235 +++++++++++
 ...resolve-musl-does-not-implement-res_ninit.patch |  77 ++++
 ...Fix-duplicate-definitions-issue-with-musl.patch |  43 ++
 meta/recipes-connectivity/connman/connman_1.28.bb  |   4 +
 meta/recipes-core/glibc/glibc_2.21.bb              |   8 +-
 .../packagegroups/packagegroup-self-hosted.bb      |   7 +-
 .../161_bts777914_fix_undeclared_identifier.patch  |  36 ++
 meta/recipes-devtools/insserv/insserv_1.14.0.bb    |   1 +
 .../subversion/subversion_1.8.11.bb                |   3 +-
 meta/recipes-extended/mdadm/files/inline.patch     |  39 ++
 meta/recipes-extended/mdadm/mdadm_3.3.2.bb         |   1 +
 .../packagegroups/packagegroup-core-lsb.bb         |   9 +
 .../recipes-gnome/gnome/gnome-icon-theme_2.31.0.bb |   2 +-
 .../gtk+/gtk+/strict-prototypes.patch              |  24 ++
 meta/recipes-gnome/gtk+/gtk+_2.24.27.bb            |   1 +
 ...sdksyms.sh-Make-sdksyms.sh-work-with-gcc5.patch |  50 +++
 .../xorg-xserver/xserver-xorg_1.16.3.bb            |   1 +
 .../lttng/lttng-tools/extern-decls.patch           | 442 +++++++++++++++++++++
 meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb     |   1 +
 22 files changed, 1109 insertions(+), 11 deletions(-)
 create mode 100644 meta/recipes-bsp/u-boot/u-boot-mkimage/gcc5.patch
 create mode 100644 meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch
 create mode 100644 meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch
 create mode 100644 meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch
 create mode 100644 meta/recipes-connectivity/connman/connman/0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch
 create mode 100644 meta/recipes-devtools/insserv/files/161_bts777914_fix_undeclared_identifier.patch
 create mode 100644 meta/recipes-extended/mdadm/files/inline.patch
 create mode 100644 meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch
 create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-sdksyms.sh-Make-sdksyms.sh-work-with-gcc5.patch
 create mode 100644 meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch

-- 
2.1.4



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 01/10] connman: Fix builds to compile on musl
  2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
@ 2015-04-22  7:49 ` Khem Raj
  2015-04-22 10:27   ` Jukka Rissanen
  2015-04-22  7:49 ` [PATCH 02/10] glibc, packagegroup-self-hosted, packagegroup-core-lsb: Consider non-glibc libcs Khem Raj
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

Add explicit includes for headers which are indirectly included on glibc
Dont use backtrace APIs on non-glibc C libs
res_nimit is a glibc specific API in resolvers so we avoid it

Change-Id: I78a173f02f8c117ebb513311f27a48bc8d645efe
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...cktrace-API-only-when-compiling-for-glibc.patch |  41 ++++
 .../connman/connman/0002-musl-header-fixes.patch   | 235 +++++++++++++++++++++
 ...resolve-musl-does-not-implement-res_ninit.patch |  77 +++++++
 ...Fix-duplicate-definitions-issue-with-musl.patch |  43 ++++
 meta/recipes-connectivity/connman/connman_1.28.bb  |   4 +
 5 files changed, 400 insertions(+)
 create mode 100644 meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch
 create mode 100644 meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch
 create mode 100644 meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch
 create mode 100644 meta/recipes-connectivity/connman/connman/0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch

diff --git a/meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch b/meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch
new file mode 100644
index 0000000..873843b
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch
@@ -0,0 +1,41 @@
+From b736e90681e135e0cccb143a9ce8b7049e1ec0f0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 22:57:20 -0700
+Subject: [PATCH 1/4] Enable backtrace() API only when compiling for glibc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/log.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/log.c b/src/log.c
+index a693bd0..3bf9fcc 100644
+--- a/src/log.c
++++ b/src/log.c
+@@ -30,7 +30,9 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
++#ifdef __GLIBC__
+ #include <execinfo.h>
++#endif
+ #include <dlfcn.h>
+ 
+ #include "connman.h"
+@@ -215,9 +217,9 @@ static void print_backtrace(unsigned int offset)
+ static void signal_handler(int signo)
+ {
+ 	connman_error("Aborting (signal %d) [%s]", signo, program_exec);
+-
++#ifdef __GLIBC__
+ 	print_backtrace(2);
+-
++#endif
+ 	exit(EXIT_FAILURE);
+ }
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch b/meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch
new file mode 100644
index 0000000..058f1dc
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch
@@ -0,0 +1,235 @@
+From b6ff3a5989e72307cd54a840179ea072c4e0213e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 22:59:55 -0700
+Subject: [PATCH 2/4] musl header fixes
+
+ported from
+http://git.alpinelinux.org/cgit/aports/plain/testing/connman/musl-fixes.patch
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac                 | 1 +
+ gdhcp/common.c               | 6 +++++-
+ gweb/gresolv.c               | 1 +
+ plugins/wifi.c               | 3 +--
+ src/ippool.c                 | 2 +-
+ src/iptables.c               | 2 +-
+ src/log.c                    | 2 ++
+ src/ntp.c                    | 2 +-
+ src/tethering.c              | 2 --
+ tools/dhcp-test.c            | 1 -
+ tools/dnsproxy-test.c        | 1 +
+ tools/private-network-test.c | 2 +-
+ tools/tap-test.c             | 2 +-
+ 13 files changed, 16 insertions(+), 11 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6fa01ba..493a5f1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -165,6 +165,7 @@ fi
+ AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
+ AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
+ 
++AC_CHECK_HEADERS(execinfo.h)
+ AC_CHECK_HEADERS(resolv.h, dummy=yes,
+ 	AC_MSG_ERROR(resolver header files are required))
+ AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
+diff --git a/gdhcp/common.c b/gdhcp/common.c
+index 48fcdef..40ade87 100644
+--- a/gdhcp/common.c
++++ b/gdhcp/common.c
+@@ -22,6 +22,7 @@
+ #include <config.h>
+ #endif
+ 
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+@@ -31,7 +32,6 @@
+ #include <string.h>
+ #include <endian.h>
+ #include <net/if_arp.h>
+-#include <linux/if.h>
+ #include <netpacket/packet.h>
+ #include <net/ethernet.h>
+ #include <arpa/inet.h>
+@@ -40,6 +40,8 @@
+ #include "gdhcp.h"
+ #include "common.h"
+ 
++#include <linux/if.h>
++
+ static const DHCPOption client_options[] = {
+ 	{ OPTION_IP,			0x01 }, /* subnet-mask */
+ 	{ OPTION_IP | OPTION_LIST,	0x03 }, /* routers */
+@@ -474,10 +476,12 @@ static const struct in6_addr in6addr_all_dhcp_relay_agents_and_servers_mc =
+ 	IN6ADDR_ALL_DHCP_RELAY_AGENTS_AND_SERVERS_MC_INIT;
+ 
+ /* from netinet/in.h */
++#if 0
+ struct in6_pktinfo {
+ 	struct in6_addr ipi6_addr;  /* src/dst IPv6 address */
+ 	unsigned int ipi6_ifindex;  /* send/recv interface index */
+ };
++#endif
+ 
+ int dhcpv6_send_packet(int index, struct dhcpv6_packet *dhcp_pkt, int len)
+ {
+diff --git a/gweb/gresolv.c b/gweb/gresolv.c
+index 5cf7a9a..c11a1d9 100644
+--- a/gweb/gresolv.c
++++ b/gweb/gresolv.c
+@@ -24,6 +24,7 @@
+ #endif
+ 
+ #include <errno.h>
++#include <stdio.h>
+ #include <unistd.h>
+ #include <stdarg.h>
+ #include <string.h>
+diff --git a/plugins/wifi.c b/plugins/wifi.c
+index 1f90a31..427c552 100644
+--- a/plugins/wifi.c
++++ b/plugins/wifi.c
+@@ -30,9 +30,8 @@
+ #include <string.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+-#include <linux/if_arp.h>
+-#include <linux/wireless.h>
+ #include <net/ethernet.h>
++#include <linux/wireless.h>
+ 
+ #ifndef IFF_LOWER_UP
+ #define IFF_LOWER_UP	0x10000
+diff --git a/src/ippool.c b/src/ippool.c
+index bb8568d..f1eb1f3 100644
+--- a/src/ippool.c
++++ b/src/ippool.c
+@@ -28,7 +28,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <sys/socket.h>
+ 
+ #include "connman.h"
+diff --git a/src/iptables.c b/src/iptables.c
+index 8d583ea..a91a451 100644
+--- a/src/iptables.c
++++ b/src/iptables.c
+@@ -28,7 +28,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ #include <sys/socket.h>
+ #include <xtables.h>
+ 
+diff --git a/src/log.c b/src/log.c
+index 3bf9fcc..3b9843f 100644
+--- a/src/log.c
++++ b/src/log.c
+@@ -114,6 +114,7 @@ void connman_debug(const char *format, ...)
+ 
+ static void print_backtrace(unsigned int offset)
+ {
++#ifdef HAVE_EXECINFO_H
+ 	void *frames[99];
+ 	size_t n_ptrs;
+ 	unsigned int i;
+@@ -212,6 +213,7 @@ static void print_backtrace(unsigned int offset)
+ 
+ 	close(outfd[1]);
+ 	close(infd[0]);
++#endif /* HAVE_EXECINFO_H */
+ }
+ 
+ static void signal_handler(int signo)
+diff --git a/src/ntp.c b/src/ntp.c
+index abb2caa..dd50532 100644
+--- a/src/ntp.c
++++ b/src/ntp.c
+@@ -180,7 +180,7 @@ static void send_packet(int fd, const char *server, uint32_t timeout)
+ 	msg.xmttime.fraction = htonl(transmit_timeval.tv_usec * 1000);
+ 
+ 	len = sendto(fd, &msg, sizeof(msg), MSG_DONTWAIT,
+-						&addr, sizeof(addr));
++						(struct sockaddr *) &addr, sizeof(addr));
+ 	if (len < 0) {
+ 		connman_error("Time request for server %s failed (%d/%s)",
+ 			server, errno, strerror(errno));
+diff --git a/src/tethering.c b/src/tethering.c
+index ceeec74..c44cb36 100644
+--- a/src/tethering.c
++++ b/src/tethering.c
+@@ -31,10 +31,8 @@
+ #include <stdio.h>
+ #include <sys/ioctl.h>
+ #include <net/if.h>
+-#include <linux/sockios.h>
+ #include <string.h>
+ #include <fcntl.h>
+-#include <linux/if_tun.h>
+ #include <netinet/in.h>
+ #include <linux/if_bridge.h>
+ 
+diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c
+index c34e10a..eae66fc 100644
+--- a/tools/dhcp-test.c
++++ b/tools/dhcp-test.c
+@@ -33,7 +33,6 @@
+ #include <arpa/inet.h>
+ #include <net/route.h>
+ #include <net/ethernet.h>
+-#include <linux/if_arp.h>
+ 
+ #include <gdhcp/gdhcp.h>
+ 
+diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c
+index 551cae9..371e2e2 100644
+--- a/tools/dnsproxy-test.c
++++ b/tools/dnsproxy-test.c
+@@ -24,6 +24,7 @@
+ #endif
+ 
+ #include <errno.h>
++#include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+diff --git a/tools/private-network-test.c b/tools/private-network-test.c
+index 3dd115b..2828bb3 100644
+--- a/tools/private-network-test.c
++++ b/tools/private-network-test.c
+@@ -32,7 +32,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <signal.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/signalfd.h>
+ #include <unistd.h>
+ 
+diff --git a/tools/tap-test.c b/tools/tap-test.c
+index fdc098a..ea9a567 100644
+--- a/tools/tap-test.c
++++ b/tools/tap-test.c
+@@ -29,7 +29,7 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <string.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/ioctl.h>
+ 
+ #include <netinet/in.h>
+-- 
+2.1.4
+
diff --git a/meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch b/meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch
new file mode 100644
index 0000000..28931c1
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch
@@ -0,0 +1,77 @@
+From 93bb904cc4e1e97152e6408077ba136fc883b6bb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 23:02:21 -0700
+Subject: [PATCH 3/4] resolve: musl does not implement res_ninit
+
+ported from
+http://git.alpinelinux.org/cgit/aports/plain/testing/connman/libresolv.patch
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gweb/gresolv.c | 33 ++++++++++++---------------------
+ 1 file changed, 12 insertions(+), 21 deletions(-)
+
+diff --git a/gweb/gresolv.c b/gweb/gresolv.c
+index c11a1d9..991b14c 100644
+--- a/gweb/gresolv.c
++++ b/gweb/gresolv.c
+@@ -876,8 +876,6 @@ GResolv *g_resolv_new(int index)
+ 	resolv->index = index;
+ 	resolv->nameserver_list = NULL;
+ 
+-	res_ninit(&resolv->res);
+-
+ 	return resolv;
+ }
+ 
+@@ -917,8 +915,6 @@ void g_resolv_unref(GResolv *resolv)
+ 
+ 	flush_nameservers(resolv);
+ 
+-	res_nclose(&resolv->res);
+-
+ 	g_free(resolv);
+ }
+ 
+@@ -1021,24 +1017,19 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname,
+ 	debug(resolv, "hostname %s", hostname);
+ 
+ 	if (!resolv->nameserver_list) {
+-		int i;
+-
+-		for (i = 0; i < resolv->res.nscount; i++) {
+-			char buf[100];
+-			int family = resolv->res.nsaddr_list[i].sin_family;
+-			void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr;
+-
+-			if (family != AF_INET &&
+-					resolv->res._u._ext.nsaddrs[i]) {
+-				family = AF_INET6;
+-				sa_addr = &resolv->res._u._ext.nsaddrs[i]->sin6_addr;
++		FILE *f = fopen("/etc/resolv.conf", "r");
++		if (f) {
++			char line[256], *s;
++			int i;
++			while (fgets(line, sizeof(line), f)) {
++				if (strncmp(line, "nameserver", 10) || !isspace(line[10]))
++					continue;
++				for (s = &line[11]; isspace(s[0]); s++);
++				for (i = 0; s[i] && !isspace(s[i]); i++);
++				s[i] = 0;
++				g_resolv_add_nameserver(resolv, s, 53, 0);
+ 			}
+-
+-			if (family != AF_INET && family != AF_INET6)
+-				continue;
+-
+-			if (inet_ntop(family, sa_addr, buf, sizeof(buf)))
+-				g_resolv_add_nameserver(resolv, buf, 53, 0);
++			fclose(f);
+ 		}
+ 
+ 		if (!resolv->nameserver_list)
+-- 
+2.1.4
+
diff --git a/meta/recipes-connectivity/connman/connman/0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch b/meta/recipes-connectivity/connman/connman/0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch
new file mode 100644
index 0000000..80a4831
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch
@@ -0,0 +1,43 @@
+From 6c1854401b4888fbf420ceb7b1e18097b91fb488 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 23:48:23 -0700
+Subject: [PATCH 4/4] tethering: Fix duplicate definitions issue with musl
+
+We just need this one define BRCTL_GET_VERSION
+from linux/if_bridge.h
+So lets define it if not defined already and remove
+including linux/if_bridge.h because it include's linux/in6.h
+which then conflicts with musl's netinet/in.h
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/tethering.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/tethering.c b/src/tethering.c
+index c44cb36..62fce36 100644
+--- a/src/tethering.c
++++ b/src/tethering.c
+@@ -34,14 +34,15 @@
+ #include <string.h>
+ #include <fcntl.h>
+ #include <netinet/in.h>
+-#include <linux/if_bridge.h>
+ 
+ #include "connman.h"
+ 
+ #include <gdhcp/gdhcp.h>
+ 
+ #include <gdbus.h>
+-
++#ifndef BRCTL_GET_VERSION
++#define BRCTL_GET_VERSION 0
++#endif
+ #ifndef DBUS_TYPE_UNIX_FD
+ #define DBUS_TYPE_UNIX_FD -1
+ #endif
+-- 
+2.1.4
+
diff --git a/meta/recipes-connectivity/connman/connman_1.28.bb b/meta/recipes-connectivity/connman/connman_1.28.bb
index 53e71fa..a395d63 100644
--- a/meta/recipes-connectivity/connman/connman_1.28.bb
+++ b/meta/recipes-connectivity/connman/connman_1.28.bb
@@ -3,6 +3,10 @@ require connman.inc
 SRC_URI  = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
             file://0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch \
             file://add_xuser_dbus_permission.patch \
+	    file://0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch \
+	    file://0002-musl-header-fixes.patch \
+	    file://0003-resolve-musl-does-not-implement-res_ninit.patch \
+	    file://0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch \
             file://connman \
             "
 SRC_URI[md5sum] = "6e07c93877f80bb73c9d4dbfc697f3fc"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 02/10] glibc, packagegroup-self-hosted, packagegroup-core-lsb: Consider non-glibc libcs
  2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
  2015-04-22  7:49 ` [PATCH 01/10] connman: Fix builds to compile on musl Khem Raj
@ 2015-04-22  7:49 ` Khem Raj
  2015-04-22  7:49 ` [PATCH 03/10] insserv: Fix build with gcc5 and clang Khem Raj
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

Make skipping expression simpler to check for given libc
Make sure glibc specific items are covered with right override

Change-Id: I8b4a0b7cbfe38ffdc9320f798038c79c7220552b
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-core/glibc/glibc_2.21.bb                        | 8 +++-----
 meta/recipes-core/packagegroups/packagegroup-self-hosted.bb  | 7 ++++---
 meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb | 9 +++++++++
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-core/glibc/glibc_2.21.bb b/meta/recipes-core/glibc/glibc_2.21.bb
index fcef4ff..58a9601 100644
--- a/meta/recipes-core/glibc/glibc_2.21.bb
+++ b/meta/recipes-core/glibc/glibc_2.21.bb
@@ -68,11 +68,9 @@ GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn
 # this helps in easing out parsing for non-glibc system libraries
 #
 python __anonymous () {
-    import re
-    notglibc = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None) or (re.match('.*musl$', d.getVar('TARGET_OS', True)) != None)
-    if notglibc:
-        raise bb.parse.SkipPackage("incompatible with target %s" %
-                                   d.getVar('TARGET_OS', True))
+    if d.getVar('TCLIBC', True) != "glibc":
+        raise bb.parse.SkipPackage("incompatible with %s C library" %
+                                   d.getVar('TCLIBC', True))
 }
 
 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
diff --git a/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
index 47589b6..531f729 100644
--- a/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
@@ -62,7 +62,6 @@ RRECOMMENDS_packagegroup-self-hosted-host-tools = "\
     kernel-module-iptable-filter \
 	"
 
-# glibc-utils: for rpcgen
 RDEPENDS_packagegroup-self-hosted-sdk = "\
     autoconf \
     automake \
@@ -73,7 +72,6 @@ RDEPENDS_packagegroup-self-hosted-sdk = "\
     cpp \
     cpp-symlinks \
     distcc \
-    glibc-utils \
     glibc-gconv-ibm850 \
     file \
     findutils \
@@ -98,7 +96,10 @@ RDEPENDS_packagegroup-self-hosted-sdk = "\
     quilt \
     sed \
     "
-
+# glibc-utils: for rpcgen
+RDEPENDS_packagegroup-self-hosted-sdk_append_libc-glibc = "\
+    glibc-utils \
+    "
 RDEPENDS_packagegroup-self-hosted-debug = " \
     gdb \
     gdbserver \
diff --git a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
index e0f32e0..a07a6ad 100644
--- a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
+++ b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
@@ -9,6 +9,15 @@ LICENSE = "MIT"
 
 inherit packagegroup
 
+#
+# We will skip parsing this packagegeoup for non-glibc systems
+#
+python __anonymous () {
+    if d.getVar('TCLIBC', True) != "glibc":
+        raise bb.parse.SkipPackage("incompatible with %s C library" %
+                                   d.getVar('TCLIBC', True))
+}
+
 PACKAGES = "\
     packagegroup-core-lsb \
     packagegroup-core-sys-extended \
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 03/10] insserv: Fix build with gcc5 and clang
  2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
  2015-04-22  7:49 ` [PATCH 01/10] connman: Fix builds to compile on musl Khem Raj
  2015-04-22  7:49 ` [PATCH 02/10] glibc, packagegroup-self-hosted, packagegroup-core-lsb: Consider non-glibc libcs Khem Raj
@ 2015-04-22  7:49 ` Khem Raj
  2015-04-22  7:49 ` [PATCH 04/10] xserver-xorg: Fix build with gcc-5 Khem Raj
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

Kill 2 bugs with one patch

| insserv.c:997:5: note: each undeclared identifier is reported only
once for each function it appears in
| insserv.c:997:15: error: expected ';' before 'char'
|      extension char buf[strlen(myname)+2+strlen(fmt)+1];
|                ^
| insserv.c: In function 'main':
| insserv.c:2379:5: error: 'extension' undeclared (first use in this
function)
|      extension char * argr[argc];
|      ^
| insserv.c:2379:15: error: expected ';' before 'char'
|      extension char * argr[argc];
|                ^
| insserv.c:2401:2: error: 'argr' undeclared (first use in this
function)
|   argr[c] = (char*)0;
|   ^

Change-Id: I36b7fb9e8baeda5a7cc252da10c0527401248226
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../161_bts777914_fix_undeclared_identifier.patch  | 36 ++++++++++++++++++++++
 meta/recipes-devtools/insserv/insserv_1.14.0.bb    |  1 +
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-devtools/insserv/files/161_bts777914_fix_undeclared_identifier.patch

diff --git a/meta/recipes-devtools/insserv/files/161_bts777914_fix_undeclared_identifier.patch b/meta/recipes-devtools/insserv/files/161_bts777914_fix_undeclared_identifier.patch
new file mode 100644
index 0000000..6ee9532
--- /dev/null
+++ b/meta/recipes-devtools/insserv/files/161_bts777914_fix_undeclared_identifier.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Pending
+
+insserv (1.14.0-5.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * moving definition of "extension" in listing.h outside of 
+    an if loop with condition related to __STDC_VERSION__.
+  * I observed that this gets build with gcc-4.9.2, as for gcc 
+    __STDC_VERSION__ is not defined.
+  * I got these error while using clang to build this package.
+  * I tested it with clang-3.5(__STDC_VERSION__ 199901L) and
+    clang 3.7(__STDC_VERSION__ 201112L) and getting same error 
+    described in in Bug #777914.
+
+ -- Mohit Bhakkad <mohit.bhakkad@gmail.com>  Sat, 04 Apr 2015 19:14:48 +0000
+
+ insserv (1.14.0-5) unstable; urgency=low
+ 
+   * Add +mountall-bootclean to $local_fs virtual facility definition in
+Index: insserv-1.14.0/listing.h
+===================================================================
+--- insserv-1.14.0.orig/listing.h
++++ insserv-1.14.0/listing.h
+@@ -47,9 +47,9 @@ typedef unsigned int uint;
+ # ifndef  asm
+ #  define asm			__asm__
+ # endif
+-# ifndef  extension
+-#  define extension		__extension__
+-# endif
++#endif
++#ifndef  extension
++# define extension             __extension__
+ #endif
+ #ifndef  attribute
+ # define attribute(attr)	__attribute__(attr)
diff --git a/meta/recipes-devtools/insserv/insserv_1.14.0.bb b/meta/recipes-devtools/insserv/insserv_1.14.0.bb
index 4a33e16..b66e98b 100644
--- a/meta/recipes-devtools/insserv/insserv_1.14.0.bb
+++ b/meta/recipes-devtools/insserv/insserv_1.14.0.bb
@@ -11,6 +11,7 @@ PR = "r1"
 SRC_URI = "ftp://ftp.suse.com/pub/projects/init/${BPN}-${PV}.tar.bz2 \
            file://makefile.patch \
            file://disable_runtests.patch \
+           file://161_bts777914_fix_undeclared_identifier.patch \
            file://insserv.conf \
            file://run-ptest \
 "
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 04/10] xserver-xorg: Fix build with gcc-5
  2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
                   ` (2 preceding siblings ...)
  2015-04-22  7:49 ` [PATCH 03/10] insserv: Fix build with gcc5 and clang Khem Raj
@ 2015-04-22  7:49 ` Khem Raj
  2015-04-22  7:49 ` [PATCH 05/10] u-boot-mkimage: Backport fix from upstream to fix " Khem Raj
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

Backport a patch from fedora details are in patch header

Change-Id: I6b8dfaae3b751071bf8b0d88b15a4f95c19877f6
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...sdksyms.sh-Make-sdksyms.sh-work-with-gcc5.patch | 50 ++++++++++++++++++++++
 .../xorg-xserver/xserver-xorg_1.16.3.bb            |  1 +
 2 files changed, 51 insertions(+)
 create mode 100644 meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-sdksyms.sh-Make-sdksyms.sh-work-with-gcc5.patch

diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-sdksyms.sh-Make-sdksyms.sh-work-with-gcc5.patch b/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-sdksyms.sh-Make-sdksyms.sh-work-with-gcc5.patch
new file mode 100644
index 0000000..215c044
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-sdksyms.sh-Make-sdksyms.sh-work-with-gcc5.patch
@@ -0,0 +1,50 @@
+Upstream-Status: Pending
+
+From 612eb45a2e7a0b35cc3790870e6d0cc42eb50c74 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Wed, 11 Feb 2015 16:26:40 +0100
+Subject: [PATCH] sdksyms.sh: Make sdksyms.sh work with gcc5.
+
+gcc5's cpp inserts patterns like this:
+
+extern
+      __attribute__((visibility("default")))
+                int WaitForSomething(int *
+    );
+
+This patch make sdksyms.sh work with this. Note my awk skills are weak, so
+there likely is a better way to deal with this.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+---
+ hw/xfree86/sdksyms.sh | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+Index: xorg-server-1.16.3/hw/xfree86/sdksyms.sh
+===================================================================
+--- xorg-server-1.16.3.orig/hw/xfree86/sdksyms.sh
++++ xorg-server-1.16.3/hw/xfree86/sdksyms.sh
+@@ -353,6 +353,23 @@ BEGIN {
+     if (sdk) {
+ 	n = 3;
+ 
++	# detect the following gcc5 cpp pattern and skip it:
++	# extern
++	# # 320 "../../include/os.h" 3 4
++	#     __attribute__((visibility("default")))
++	# # 320 "../../include/os.h"
++	# Note in this case the "extern " or "extern void " always has
++	# a trailing space
++	if ($0 ~ "^extern.* $") {
++	    getline;
++	    getline;
++	    getline;
++	    getline;
++	    n = 1;
++	    while ($n == " ")
++		n++;
++	}
++
+ 	# skip attribute, if any
+ 	while ($n ~ /^(__attribute__|__global)/ ||
+ 	    # skip modifiers, if any
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.16.3.bb b/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.16.3.bb
index 7eeadd1..780ece0 100644
--- a/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.16.3.bb
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.16.3.bb
@@ -9,6 +9,7 @@ SRC_URI += "file://fix_open_max_preprocessor_error.patch \
             file://0001-xkb-Don-t-swap-XkbSetGeometry-data-in-the-input-buff.patch \
             file://0001-xkb-Check-strings-length-against-request-size.patch \
             file://0001-use-__GLIBC__-guard-for-glibc-specific-code.patch \
+	    file://0001-sdksyms.sh-Make-sdksyms.sh-work-with-gcc5.patch \
            "
 
 SRC_URI[md5sum] = "afd93977235584a9caa7528a737c1b52"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 05/10] u-boot-mkimage: Backport fix from upstream to fix build with gcc-5
  2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
                   ` (3 preceding siblings ...)
  2015-04-22  7:49 ` [PATCH 04/10] xserver-xorg: Fix build with gcc-5 Khem Raj
@ 2015-04-22  7:49 ` Khem Raj
  2015-04-22  7:49 ` [PATCH 06/10] mdadm: Fix inline semantics Khem Raj
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

Change-Id: I5322f1ff8653009b45ddee1a2d3a0d96584d3327
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-bsp/u-boot/u-boot-mkimage/gcc5.patch | 91 +++++++++++++++++++++++
 meta/recipes-bsp/u-boot/u-boot-mkimage_2015.01.bb |  4 +-
 2 files changed, 94 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-bsp/u-boot/u-boot-mkimage/gcc5.patch

diff --git a/meta/recipes-bsp/u-boot/u-boot-mkimage/gcc5.patch b/meta/recipes-bsp/u-boot/u-boot-mkimage/gcc5.patch
new file mode 100644
index 0000000..12db94c
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/u-boot-mkimage/gcc5.patch
@@ -0,0 +1,91 @@
+Upstream-Status: Backport
+
+From 478b02f1a7043b673565075ea5016376f3293b23 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Sat, 7 Feb 2015 22:52:40 +0100
+Subject: [PATCH] Add linux/compiler-gcc5.h to fix builds with gcc5
+
+Add linux/compiler-gcc5/h from the kernel sources at:
+
+commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b
+Author: Steven Noonan <steven@uplinklabs.net>
+Date:   Sat Oct 25 15:09:42 2014 -0700
+
+    compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+---
+ include/linux/compiler-gcc5.h |   65 +++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 65 insertions(+)
+ create mode 100644 include/linux/compiler-gcc5.h
+
+Index: git/include/linux/compiler-gcc5.h
+===================================================================
+--- /dev/null
++++ git/include/linux/compiler-gcc5.h
+@@ -0,0 +1,65 @@
++#ifndef __LINUX_COMPILER_H
++#error "Please don't include <linux/compiler-gcc5.h> directly, include <linux/compiler.h> instead."
++#endif
++
++#define __used				__attribute__((__used__))
++#define __must_check			__attribute__((warn_unused_result))
++#define __compiler_offsetof(a, b)	__builtin_offsetof(a, b)
++
++/* Mark functions as cold. gcc will assume any path leading to a call
++   to them will be unlikely.  This means a lot of manual unlikely()s
++   are unnecessary now for any paths leading to the usual suspects
++   like BUG(), printk(), panic() etc. [but let's keep them for now for
++   older compilers]
++
++   Early snapshots of gcc 4.3 don't support this and we can't detect this
++   in the preprocessor, but we can live with this because they're unreleased.
++   Maketime probing would be overkill here.
++
++   gcc also has a __attribute__((__hot__)) to move hot functions into
++   a special section, but I don't see any sense in this right now in
++   the kernel context */
++#define __cold			__attribute__((__cold__))
++
++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
++
++#ifndef __CHECKER__
++# define __compiletime_warning(message) __attribute__((warning(message)))
++# define __compiletime_error(message) __attribute__((error(message)))
++#endif /* __CHECKER__ */
++
++/*
++ * Mark a position in code as unreachable.  This can be used to
++ * suppress control flow warnings after asm blocks that transfer
++ * control elsewhere.
++ *
++ * Early snapshots of gcc 4.5 don't support this and we can't detect
++ * this in the preprocessor, but we can live with this because they're
++ * unreleased.  Really, we need to have autoconf for the kernel.
++ */
++#define unreachable() __builtin_unreachable()
++
++/* Mark a function definition as prohibited from being cloned. */
++#define __noclone	__attribute__((__noclone__))
++
++/*
++ * Tell the optimizer that something else uses this function or variable.
++ */
++#define __visible __attribute__((externally_visible))
++
++/*
++ * GCC 'asm goto' miscompiles certain code sequences:
++ *
++ *   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
++ *
++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
++ *
++ * (asm goto is automatically volatile - the naming reflects this.)
++ */
++#define asm_volatile_goto(x...)	do { asm goto(x); asm (""); } while (0)
++
++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
++#define __HAVE_BUILTIN_BSWAP32__
++#define __HAVE_BUILTIN_BSWAP64__
++#define __HAVE_BUILTIN_BSWAP16__
++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
diff --git a/meta/recipes-bsp/u-boot/u-boot-mkimage_2015.01.bb b/meta/recipes-bsp/u-boot/u-boot-mkimage_2015.01.bb
index 076dff8..7735288 100644
--- a/meta/recipes-bsp/u-boot/u-boot-mkimage_2015.01.bb
+++ b/meta/recipes-bsp/u-boot/u-boot-mkimage_2015.01.bb
@@ -12,7 +12,9 @@ SRCREV = "92fa7f53f1f3f03296f8ffb14bdf1baefab83368"
 
 PV = "v2015.01+git${SRCPV}"
 
-SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
+SRC_URI = "git://git.denx.de/u-boot.git;branch=master \
+           file://gcc5.patch \
+	   "
 
 S = "${WORKDIR}/git"
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 06/10] mdadm: Fix inline semantics
  2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
                   ` (4 preceding siblings ...)
  2015-04-22  7:49 ` [PATCH 05/10] u-boot-mkimage: Backport fix from upstream to fix " Khem Raj
@ 2015-04-22  7:49 ` Khem Raj
  2015-04-22  7:49 ` [PATCH 07/10] lttng-tools: Add extern qualifier to declarations in .h file Khem Raj
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

With gcc-5 defaulting to gnu11 C we need to follow
c99 inline semantics

Change-Id: I397520c36c81634556b3f3782aebc532e4a79aed
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-extended/mdadm/files/inline.patch | 39 ++++++++++++++++++++++++++
 meta/recipes-extended/mdadm/mdadm_3.3.2.bb     |  1 +
 2 files changed, 40 insertions(+)
 create mode 100644 meta/recipes-extended/mdadm/files/inline.patch

diff --git a/meta/recipes-extended/mdadm/files/inline.patch b/meta/recipes-extended/mdadm/files/inline.patch
new file mode 100644
index 0000000..9009f06
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/inline.patch
@@ -0,0 +1,39 @@
+with gnu11 turning on a default with gcc-5 we have to abide by new inline semantics
+using 'inline' and using is in same translation unit means an external definition has to exist
+same like "external inline" in gnu89, we simply make the functions static inline since they
+are just meant to be used in this file
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: mdadm-3.3.2/bitmap.c
+===================================================================
+--- mdadm-3.3.2.orig/bitmap.c
++++ mdadm-3.3.2/bitmap.c
+@@ -20,7 +20,7 @@
+ 
+ #include "mdadm.h"
+ 
+-inline void sb_le_to_cpu(bitmap_super_t *sb)
++static inline void sb_le_to_cpu(bitmap_super_t *sb)
+ {
+ 	sb->magic = __le32_to_cpu(sb->magic);
+ 	sb->version = __le32_to_cpu(sb->version);
+@@ -34,7 +34,7 @@ inline void sb_le_to_cpu(bitmap_super_t
+ 	sb->write_behind = __le32_to_cpu(sb->write_behind);
+ }
+ 
+-inline void sb_cpu_to_le(bitmap_super_t *sb)
++static inline void sb_cpu_to_le(bitmap_super_t *sb)
+ {
+ 	sb_le_to_cpu(sb); /* these are really the same thing */
+ }
+@@ -74,7 +74,7 @@ typedef struct bitmap_info_s {
+ } bitmap_info_t;
+ 
+ /* count the dirty bits in the first num_bits of byte */
+-inline int count_dirty_bits_byte(char byte, int num_bits)
++static inline int count_dirty_bits_byte(char byte, int num_bits)
+ {
+ 	int num = 0;
+ 
diff --git a/meta/recipes-extended/mdadm/mdadm_3.3.2.bb b/meta/recipes-extended/mdadm/mdadm_3.3.2.bb
index 0742d73..87e06f5 100644
--- a/meta/recipes-extended/mdadm/mdadm_3.3.2.bb
+++ b/meta/recipes-extended/mdadm/mdadm_3.3.2.bb
@@ -12,6 +12,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
            file://mdadm-3.2.2_fix_for_x32.patch \
            file://gcc-4.9.patch \
            file://mdadm-3.3.2_x32_abi_time_t.patch \
+           file://inline.patch \
            file://run-ptest \
 	  "
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 07/10] lttng-tools: Add extern qualifier to declarations in .h file
  2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
                   ` (5 preceding siblings ...)
  2015-04-22  7:49 ` [PATCH 06/10] mdadm: Fix inline semantics Khem Raj
@ 2015-04-22  7:49 ` Khem Raj
  2015-04-22  7:49 ` [PATCH 08/10] subversion: Add -P to CPPFLAGS Khem Raj
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

This will ensure that compiler does not initialize the definitions
in header files

Change-Id: I1076201c667f96707c320a51a77d4a70e22df750
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../lttng/lttng-tools/extern-decls.patch           | 442 +++++++++++++++++++++
 meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb     |   1 +
 2 files changed, 443 insertions(+)
 create mode 100644 meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch

diff --git a/meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch b/meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch
new file mode 100644
index 0000000..199ef57
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch
@@ -0,0 +1,442 @@
+This make the declarations to be extern so they dont end up
+in duplicates in data.rel.ro sections
+
+avoid errors like
+
+| ../../../src/common/.libs/libcommon.a(mi-lttng.o):(.data.rel.ro.local+0x0): multiple definition of `mi_lttng_element_snapshots'
+| commands/enable_events.o:(.bss+0x48): first defined here
+| collect2: error: ld returned 1 exit status
+| Makefile:502: recipe for target 'lttng' failed
+| make[3]: *** [lttng] Error 1
+
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: git/src/common/config/config-session-abi.h
+===================================================================
+--- git.orig/src/common/config/config-session-abi.h
++++ git/src/common/config/config-session-abi.h
+@@ -18,95 +18,95 @@
+ #ifndef CONFIG_SESSION_INTERNAL_H
+ #define CONFIG_SESSION_INTERNAL_H
+ 
+-const char * const config_element_channel;
+-const char * const config_element_channels;
+-const char * const config_element_domain;
+-const char * const config_element_domains;
+-const char * const config_element_event;
+-const char * const config_element_events;
+-const char * const config_element_context;
+-const char * const config_element_contexts;
+-const char * const config_element_attributes;
+-const char * const config_element_exclusion;
+-const char * const config_element_exclusions;
+-const char * const config_element_function_attributes;
+-const char * const config_element_probe_attributes;
+-const char * const config_element_symbol_name;
+-const char * const config_element_address;
+-const char * const config_element_offset;
+-const char * const config_element_name;
+-const char * const config_element_enabled;
+-const char * const config_element_overwrite_mode;
+-const char * const config_element_subbuf_size;
+-const char * const config_element_num_subbuf;
+-const char * const config_element_switch_timer_interval;
+-const char * const config_element_read_timer_interval;
+-const char * const config_element_output;
+-const char * const config_element_output_type;
+-const char * const config_element_tracefile_size;
+-const char * const config_element_tracefile_count;
+-const char * const config_element_live_timer_interval;
+-const char * const config_element_type;
+-const char * const config_element_buffer_type;
+-const char * const config_element_session;
+-const char * const config_element_sessions;
+-const char * const config_element_perf;
+-const char * const config_element_config;
+-const char * const config_element_started;
+-const char * const config_element_snapshot_mode;
+-const char * const config_element_loglevel;
+-const char * const config_element_loglevel_type;
+-const char * const config_element_filter;
+-const char * const config_element_snapshot_outputs;
+-const char * const config_element_consumer_output;
+-const char * const config_element_destination;
+-const char * const config_element_path;
+-const char * const config_element_net_output;
+-const char * const config_element_control_uri;
+-const char * const config_element_data_uri;
+-const char * const config_element_max_size;
+-
+-const char * const config_domain_type_kernel;
+-const char * const config_domain_type_ust;
+-const char * const config_domain_type_jul;
+-const char * const config_domain_type_log4j;
+-
+-const char * const config_buffer_type_per_pid;
+-const char * const config_buffer_type_per_uid;
+-const char * const config_buffer_type_global;
+-
+-const char * const config_overwrite_mode_discard;
+-const char * const config_overwrite_mode_overwrite;
+-
+-const char * const config_output_type_splice;
+-const char * const config_output_type_mmap;
+-
+-const char * const config_loglevel_type_all;
+-const char * const config_loglevel_type_range;
+-const char * const config_loglevel_type_single;
+-
+-const char * const config_event_type_all;
+-const char * const config_event_type_tracepoint;
+-const char * const config_event_type_probe;
+-const char * const config_event_type_function;
+-const char * const config_event_type_function_entry;
+-const char * const config_event_type_noop;
+-const char * const config_event_type_syscall;
+-const char * const config_event_type_kprobe;
+-const char * const config_event_type_kretprobe;
+-
+-const char * const config_event_context_pid;
+-const char * const config_event_context_procname;
+-const char * const config_event_context_prio;
+-const char * const config_event_context_nice;
+-const char * const config_event_context_vpid;
+-const char * const config_event_context_tid;
+-const char * const config_event_context_vtid;
+-const char * const config_event_context_ppid;
+-const char * const config_event_context_vppid;
+-const char * const config_event_context_pthread_id;
+-const char * const config_event_context_hostname;
+-const char * const config_event_context_ip;
+-const char * const config_event_context_perf_thread_counter;
++extern const char * const config_element_channel;
++extern const char * const config_element_channels;
++extern const char * const config_element_domain;
++extern const char * const config_element_domains;
++extern const char * const config_element_event;
++extern const char * const config_element_events;
++extern const char * const config_element_context;
++extern const char * const config_element_contexts;
++extern const char * const config_element_attributes;
++extern const char * const config_element_exclusion;
++extern const char * const config_element_exclusions;
++extern const char * const config_element_function_attributes;
++extern const char * const config_element_probe_attributes;
++extern const char * const config_element_symbol_name;
++extern const char * const config_element_address;
++extern const char * const config_element_offset;
++extern const char * const config_element_name;
++extern const char * const config_element_enabled;
++extern const char * const config_element_overwrite_mode;
++extern const char * const config_element_subbuf_size;
++extern const char * const config_element_num_subbuf;
++extern const char * const config_element_switch_timer_interval;
++extern const char * const config_element_read_timer_interval;
++extern const char * const config_element_output;
++extern const char * const config_element_output_type;
++extern const char * const config_element_tracefile_size;
++extern const char * const config_element_tracefile_count;
++extern const char * const config_element_live_timer_interval;
++extern const char * const config_element_type;
++extern const char * const config_element_buffer_type;
++extern const char * const config_element_session;
++extern const char * const config_element_sessions;
++extern const char * const config_element_perf;
++extern const char * const config_element_config;
++extern const char * const config_element_started;
++extern const char * const config_element_snapshot_mode;
++extern const char * const config_element_loglevel;
++extern const char * const config_element_loglevel_type;
++extern const char * const config_element_filter;
++extern const char * const config_element_snapshot_outputs;
++extern const char * const config_element_consumer_output;
++extern const char * const config_element_destination;
++extern const char * const config_element_path;
++extern const char * const config_element_net_output;
++extern const char * const config_element_control_uri;
++extern const char * const config_element_data_uri;
++extern const char * const config_element_max_size;
++
++extern const char * const config_domain_type_kernel;
++extern const char * const config_domain_type_ust;
++extern const char * const config_domain_type_jul;
++extern const char * const config_domain_type_log4j;
++
++extern const char * const config_buffer_type_per_pid;
++extern const char * const config_buffer_type_per_uid;
++extern const char * const config_buffer_type_global;
++
++extern const char * const config_overwrite_mode_discard;
++extern const char * const config_overwrite_mode_overwrite;
++
++extern const char * const config_output_type_splice;
++extern const char * const config_output_type_mmap;
++
++extern const char * const config_loglevel_type_all;
++extern const char * const config_loglevel_type_range;
++extern const char * const config_loglevel_type_single;
++
++extern const char * const config_event_type_all;
++extern const char * const config_event_type_tracepoint;
++extern const char * const config_event_type_probe;
++extern const char * const config_event_type_function;
++extern const char * const config_event_type_function_entry;
++extern const char * const config_event_type_noop;
++extern const char * const config_event_type_syscall;
++extern const char * const config_event_type_kprobe;
++extern const char * const config_event_type_kretprobe;
++
++extern const char * const config_event_context_pid;
++extern const char * const config_event_context_procname;
++extern const char * const config_event_context_prio;
++extern const char * const config_event_context_nice;
++extern const char * const config_event_context_vpid;
++extern const char * const config_event_context_tid;
++extern const char * const config_event_context_vtid;
++extern const char * const config_event_context_ppid;
++extern const char * const config_event_context_vppid;
++extern const char * const config_event_context_pthread_id;
++extern const char * const config_event_context_hostname;
++extern const char * const config_event_context_ip;
++extern const char * const config_event_context_perf_thread_counter;
+ 
+ #endif /* CONFIG_SESSION_INTERNAL_H */
+Index: git/src/common/mi-lttng.h
+===================================================================
+--- git.orig/src/common/mi-lttng.h
++++ git/src/common/mi-lttng.h
+@@ -49,133 +49,133 @@ struct mi_lttng_version {
+ };
+ 
+ /* Strings related to command */
+-const char * const mi_lttng_element_command;
+-const char * const mi_lttng_element_command_action;
+-const char * const mi_lttng_element_command_add_context;
+-const char * const mi_lttng_element_command_calibrate;
+-const char * const mi_lttng_element_command_create;
+-const char * const mi_lttng_element_command_destroy;
+-const char * const mi_lttng_element_command_disable_channel;
+-const char * const mi_lttng_element_command_disable_event;
+-const char * const mi_lttng_element_command_enable_channels;
+-const char * const mi_lttng_element_command_enable_event;
+-const char * const mi_lttng_element_command_list;
+-const char * const mi_lttng_element_command_load;
+-const char * const mi_lttng_element_command_name;
+-const char * const mi_lttng_element_command_output;
+-const char * const mi_lttng_element_command_save;
+-const char * const mi_lttng_element_command_set_session;
+-const char * const mi_lttng_element_command_snapshot;
+-const char * const mi_lttng_element_command_snapshot_add;
+-const char * const mi_lttng_element_command_snapshot_del;
+-const char * const mi_lttng_element_command_snapshot_list;
+-const char * const mi_lttng_element_command_snapshot_record;
+-const char * const mi_lttng_element_command_start;
+-const char * const mi_lttng_element_command_stop;
+-const char * const mi_lttng_element_command_success;
+-const char * const mi_lttng_element_command_version;
++extern const char * const mi_lttng_element_command;
++extern const char * const mi_lttng_element_command_action;
++extern const char * const mi_lttng_element_command_add_context;
++extern const char * const mi_lttng_element_command_calibrate;
++extern const char * const mi_lttng_element_command_create;
++extern const char * const mi_lttng_element_command_destroy;
++extern const char * const mi_lttng_element_command_disable_channel;
++extern const char * const mi_lttng_element_command_disable_event;
++extern const char * const mi_lttng_element_command_enable_channels;
++extern const char * const mi_lttng_element_command_enable_event;
++extern const char * const mi_lttng_element_command_list;
++extern const char * const mi_lttng_element_command_load;
++extern const char * const mi_lttng_element_command_name;
++extern const char * const mi_lttng_element_command_output;
++extern const char * const mi_lttng_element_command_save;
++extern const char * const mi_lttng_element_command_set_session;
++extern const char * const mi_lttng_element_command_snapshot;
++extern const char * const mi_lttng_element_command_snapshot_add;
++extern const char * const mi_lttng_element_command_snapshot_del;
++extern const char * const mi_lttng_element_command_snapshot_list;
++extern const char * const mi_lttng_element_command_snapshot_record;
++extern const char * const mi_lttng_element_command_start;
++extern const char * const mi_lttng_element_command_stop;
++extern const char * const mi_lttng_element_command_success;
++extern const char * const mi_lttng_element_command_version;
+ 
+ /* Strings related to version command */
+-const char * const mi_lttng_element_version;
+-const char * const mi_lttng_element_version_commit;
+-const char * const mi_lttng_element_version_description;
+-const char * const mi_lttng_element_version_license;
+-const char * const mi_lttng_element_version_major;
+-const char * const mi_lttng_element_version_minor;
+-const char * const mi_lttng_element_version_patch_level;
+-const char * const mi_lttng_element_version_str;
+-const char * const mi_lttng_element_version_web;
++extern const char * const mi_lttng_element_version;
++extern const char * const mi_lttng_element_version_commit;
++extern const char * const mi_lttng_element_version_description;
++extern const char * const mi_lttng_element_version_license;
++extern const char * const mi_lttng_element_version_major;
++extern const char * const mi_lttng_element_version_minor;
++extern const char * const mi_lttng_element_version_patch_level;
++extern const char * const mi_lttng_element_version_str;
++extern const char * const mi_lttng_element_version_web;
+ 
+ /* String related to a lttng_event_field */
+-const char * const mi_lttng_element_event_field;
+-const char * const mi_lttng_element_event_fields;
++extern const char * const mi_lttng_element_event_field;
++extern const char * const mi_lttng_element_event_fields;
+ 
+ /* String related to lttng_event_context */
+-const char * const mi_lttng_context_type_perf_counter;
+-const char * const mi_lttng_context_type_perf_cpu_counter;
+-const char * const mi_lttng_context_type_perf_thread_counter;
++extern const char * const mi_lttng_context_type_perf_counter;
++extern const char * const mi_lttng_context_type_perf_cpu_counter;
++extern const char * const mi_lttng_context_type_perf_thread_counter;
+ 
+ /* String related to lttng_event_perf_counter_ctx */
+-const char * const mi_lttng_element_perf_counter_context;
++extern const char * const mi_lttng_element_perf_counter_context;
+ 
+ /* Strings related to pid */
+-const char * const mi_lttng_element_pids;
+-const char * const mi_lttng_element_pid;
+-const char * const mi_lttng_element_pid_id;
++extern const char * const mi_lttng_element_pids;
++extern const char * const mi_lttng_element_pid;
++extern const char * const mi_lttng_element_pid_id;
+ 
+ /* Strings related to save command */
+-const char * const mi_lttng_element_save;
++extern const char * const mi_lttng_element_save;
+ 
+ /* Strings related to load command */
+-const char * const mi_lttng_element_load;
++extern const char * const mi_lttng_element_load;
+ 
+ /* General element of mi_lttng */
+-const char * const mi_lttng_element_empty;
+-const char * const mi_lttng_element_id;
+-const char * const mi_lttng_element_nowrite;
+-const char * const mi_lttng_element_success;
+-const char * const mi_lttng_element_type_enum;
+-const char * const mi_lttng_element_type_float;
+-const char * const mi_lttng_element_type_integer;
+-const char * const mi_lttng_element_type_other;
+-const char * const mi_lttng_element_type_string;
++extern const char * const mi_lttng_element_empty;
++extern const char * const mi_lttng_element_id;
++extern const char * const mi_lttng_element_nowrite;
++extern const char * const mi_lttng_element_success;
++extern const char * const mi_lttng_element_type_enum;
++extern const char * const mi_lttng_element_type_float;
++extern const char * const mi_lttng_element_type_integer;
++extern const char * const mi_lttng_element_type_other;
++extern const char * const mi_lttng_element_type_string;
+ 
+ /* String related to loglevel */
+-const char * const mi_lttng_loglevel_str_alert;
+-const char * const mi_lttng_loglevel_str_crit;
+-const char * const mi_lttng_loglevel_str_debug;
+-const char * const mi_lttng_loglevel_str_debug_function;
+-const char * const mi_lttng_loglevel_str_debug_line;
+-const char * const mi_lttng_loglevel_str_debug_module;
+-const char * const mi_lttng_loglevel_str_debug_process;
+-const char * const mi_lttng_loglevel_str_debug_program;
+-const char * const mi_lttng_loglevel_str_debug_system;
+-const char * const mi_lttng_loglevel_str_debug_unit;
+-const char * const mi_lttng_loglevel_str_emerg;
+-const char * const mi_lttng_loglevel_str_err;
+-const char * const mi_lttng_loglevel_str_info;
+-const char * const mi_lttng_loglevel_str_notice;
+-const char * const mi_lttng_loglevel_str_unknown;
+-const char * const mi_lttng_loglevel_str_warning;
++extern const char * const mi_lttng_loglevel_str_alert;
++extern const char * const mi_lttng_loglevel_str_crit;
++extern const char * const mi_lttng_loglevel_str_debug;
++extern const char * const mi_lttng_loglevel_str_debug_function;
++extern const char * const mi_lttng_loglevel_str_debug_line;
++extern const char * const mi_lttng_loglevel_str_debug_module;
++extern const char * const mi_lttng_loglevel_str_debug_process;
++extern const char * const mi_lttng_loglevel_str_debug_program;
++extern const char * const mi_lttng_loglevel_str_debug_system;
++extern const char * const mi_lttng_loglevel_str_debug_unit;
++extern const char * const mi_lttng_loglevel_str_emerg;
++extern const char * const mi_lttng_loglevel_str_err;
++extern const char * const mi_lttng_loglevel_str_info;
++extern const char * const mi_lttng_loglevel_str_notice;
++extern const char * const mi_lttng_loglevel_str_unknown;
++extern const char * const mi_lttng_loglevel_str_warning;
+ 
+ /* String related to loglevel JUL */
+-const char * const mi_lttng_loglevel_str_jul_all;
+-const char * const mi_lttng_loglevel_str_jul_config;
+-const char * const mi_lttng_loglevel_str_jul_fine;
+-const char * const mi_lttng_loglevel_str_jul_finer;
+-const char * const mi_lttng_loglevel_str_jul_finest;
+-const char * const mi_lttng_loglevel_str_jul_info;
+-const char * const mi_lttng_loglevel_str_jul_off;
+-const char * const mi_lttng_loglevel_str_jul_severe;
+-const char * const mi_lttng_loglevel_str_jul_warning;
++extern const char * const mi_lttng_loglevel_str_jul_all;
++extern const char * const mi_lttng_loglevel_str_jul_config;
++extern const char * const mi_lttng_loglevel_str_jul_fine;
++extern const char * const mi_lttng_loglevel_str_jul_finer;
++extern const char * const mi_lttng_loglevel_str_jul_finest;
++extern const char * const mi_lttng_loglevel_str_jul_info;
++extern const char * const mi_lttng_loglevel_str_jul_off;
++extern const char * const mi_lttng_loglevel_str_jul_severe;
++extern const char * const mi_lttng_loglevel_str_jul_warning;
+ 
+ /* String related to loglevel Log4j */
+-const char * const mi_lttng_loglevel_str_log4j_off;
+-const char * const mi_lttng_loglevel_str_log4j_fatal;
+-const char * const mi_lttng_loglevel_str_log4j_error;
+-const char * const mi_lttng_loglevel_str_log4j_warn;
+-const char * const mi_lttng_loglevel_str_log4j_info;
+-const char * const mi_lttng_loglevel_str_log4j_debug;
+-const char * const mi_lttng_loglevel_str_log4j_trace;
+-const char * const mi_lttng_loglevel_str_log4j_all;
++extern const char * const mi_lttng_loglevel_str_log4j_off;
++extern const char * const mi_lttng_loglevel_str_log4j_fatal;
++extern const char * const mi_lttng_loglevel_str_log4j_error;
++extern const char * const mi_lttng_loglevel_str_log4j_warn;
++extern const char * const mi_lttng_loglevel_str_log4j_info;
++extern const char * const mi_lttng_loglevel_str_log4j_debug;
++extern const char * const mi_lttng_loglevel_str_log4j_trace;
++extern const char * const mi_lttng_loglevel_str_log4j_all;
+ 
+ /* String related to loglevel type */
+-const char * const mi_lttng_loglevel_type_all;
+-const char * const mi_lttng_loglevel_type_range;
+-const char * const mi_lttng_loglevel_type_single;
+-const char * const mi_lttng_loglevel_type_unknown;
++extern const char * const mi_lttng_loglevel_type_all;
++extern const char * const mi_lttng_loglevel_type_range;
++extern const char * const mi_lttng_loglevel_type_single;
++extern const char * const mi_lttng_loglevel_type_unknown;
+ 
+ /* Sting related to lttng_calibrate */
+-const char * const mi_lttng_element_calibrate;
+-const char * const mi_lttng_element_calibrate_function;
++extern const char * const mi_lttng_element_calibrate;
++extern const char * const mi_lttng_element_calibrate_function;
+ 
+ /* String related to a lttng_snapshot */
+-const char * const mi_lttng_element_snapshot_ctrl_url;
+-const char * const mi_lttng_element_snapshot_data_url;
+-const char * const mi_lttng_element_snapshot_max_size;
+-const char * const mi_lttng_element_snapshot_n_ptr;
+-const char * const mi_lttng_element_snapshot_session_name;
+-const char * const mi_lttng_element_snapshots;
++extern const char * const mi_lttng_element_snapshot_ctrl_url;
++extern const char * const mi_lttng_element_snapshot_data_url;
++extern const char * const mi_lttng_element_snapshot_max_size;
++extern const char * const mi_lttng_element_snapshot_n_ptr;
++extern const char * const mi_lttng_element_snapshot_session_name;
++extern const char * const mi_lttng_element_snapshots;
+ 
+ /* Utility string function  */
+ const char *mi_lttng_loglevel_string(int value, enum lttng_domain_type domain);
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb b/meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb
index f0969b5..8cc4220 100644
--- a/meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb
@@ -25,6 +25,7 @@ PACKAGECONFIG[kmod] = "--enable-kmod, --disable-kmod, kmod"
 
 SRC_URI = "git://git.lttng.org/lttng-tools.git;branch=stable-2.6 \
            file://runtest-2.4.0.patch \
+           file://extern-decls.patch \
            file://run-ptest \
 	  "
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 08/10] subversion: Add -P to CPPFLAGS
  2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
                   ` (6 preceding siblings ...)
  2015-04-22  7:49 ` [PATCH 07/10] lttng-tools: Add extern qualifier to declarations in .h file Khem Raj
@ 2015-04-22  7:49 ` Khem Raj
  2015-04-22  7:49 ` [PATCH 09/10] gnome-icon-theme: Needs nls.m4 Khem Raj
  2015-04-22  7:49 ` [PATCH 10/10] gtk+: Correct function prototype Khem Raj
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

see https://gcc.gnu.org/gcc-5/porting_to.html

we need to stop the preprocessor from generating the #line directives
or we run into issues like

| checking for apr_int64_t Python/C API format string...
| configure: error: failed to recognize APR_INT64_T_FMT on this platform
| Configure failed. The contents of all config.log files follows to aid
debugging
| ERROR: oe_runconf failed

Rightly subversion should be fixed but lets leave that to subversion
folks

Change-Id: I02a89798ff949f79967ab0a73adcddaa4218662d
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/subversion/subversion_1.8.11.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/subversion/subversion_1.8.11.bb b/meta/recipes-devtools/subversion/subversion_1.8.11.bb
index 8e4cd9d..d5295d8 100644
--- a/meta/recipes-devtools/subversion/subversion_1.8.11.bb
+++ b/meta/recipes-devtools/subversion/subversion_1.8.11.bb
@@ -7,7 +7,7 @@ HOMEPAGE = "http://subversion.tigris.org"
 
 BBCLASSEXTEND = "native"
 
-inherit gettext
+inherit gettext pythonnative
 
 SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
            file://libtool2.patch \
@@ -31,6 +31,7 @@ EXTRA_OECONF = " \
 inherit autotools
 
 export LDFLAGS += " -L${STAGING_LIBDIR} "
+CPPFLAGS += "-P"
 
 acpaths = "-I build/ -I build/ac-macros/"
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 09/10] gnome-icon-theme: Needs nls.m4
  2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
                   ` (7 preceding siblings ...)
  2015-04-22  7:49 ` [PATCH 08/10] subversion: Add -P to CPPFLAGS Khem Raj
@ 2015-04-22  7:49 ` Khem Raj
  2015-04-22  7:49 ` [PATCH 10/10] gtk+: Correct function prototype Khem Raj
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

it really needs nls, so lets add proper dependencies
and options

Change-Id: Ib01f066e9dadf2784686cbe28578d2784dfcba88
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-gnome/gnome/gnome-icon-theme_2.31.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-gnome/gnome/gnome-icon-theme_2.31.0.bb b/meta/recipes-gnome/gnome/gnome-icon-theme_2.31.0.bb
index ee018bd..fde2bc0 100644
--- a/meta/recipes-gnome/gnome/gnome-icon-theme_2.31.0.bb
+++ b/meta/recipes-gnome/gnome/gnome-icon-theme_2.31.0.bb
@@ -10,7 +10,7 @@ PR = "r5"
 
 DEPENDS = "icon-naming-utils-native glib-2.0 intltool-native libxml-simple-perl-native"
 
-inherit autotools perlnative gtk-icon-cache pkgconfig
+inherit autotools perlnative gtk-icon-cache pkgconfig gettext
 
 SRC_URI = "${GNOME_MIRROR}/${BPN}/2.31/${BPN}-${PV}.tar.bz2 \
            file://iconpath-option.patch"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 10/10] gtk+: Correct function prototype
  2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
                   ` (8 preceding siblings ...)
  2015-04-22  7:49 ` [PATCH 09/10] gnome-icon-theme: Needs nls.m4 Khem Raj
@ 2015-04-22  7:49 ` Khem Raj
  9 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22  7:49 UTC (permalink / raw)
  To: openembedded-core

This is turned on by default in gcc-5 so far
we have been getting by this issue but time to fix it
has now come

Change-Id: I012248731de0be7a9b7e232073746360fe6c83dd
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../gtk+/gtk+/strict-prototypes.patch              | 24 ++++++++++++++++++++++
 meta/recipes-gnome/gtk+/gtk+_2.24.27.bb            |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch

diff --git a/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch b/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch
new file mode 100644
index 0000000..96e1f5f
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch
@@ -0,0 +1,24 @@
+Fixes
+
+include/gtk-2.0/gtk/gtkitemfactory.h:47:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
+ typedef void (*GtkItemFactoryCallback)  ();
+
+gcc5 has -Wstrict-prototypes on by default for -Werror so this becomes a build failure for consumers
+of this header e.g. matchbox-panel-2
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: gtk+-2.24.27/gtk/gtkitemfactory.h
+===================================================================
+--- gtk+-2.24.27.orig/gtk/gtkitemfactory.h
++++ gtk+-2.24.27/gtk/gtkitemfactory.h
+@@ -44,7 +44,7 @@ typedef void	(*GtkPrintFunc)		   (gpoint
+  * (Note that if we are included from a C++ program () will mean
+  * (void) so an explicit cast will be needed.)
+  */
+-typedef	void	(*GtkItemFactoryCallback)  ();
++typedef	void	(*GtkItemFactoryCallback)  (void);
+ typedef	void	(*GtkItemFactoryCallback1) (gpointer		 callback_data,
+ 					    guint		 callback_action,
+ 					    GtkWidget		*widget);
diff --git a/meta/recipes-gnome/gtk+/gtk+_2.24.27.bb b/meta/recipes-gnome/gtk+/gtk+_2.24.27.bb
index b2693d5..4f664e4 100644
--- a/meta/recipes-gnome/gtk+/gtk+_2.24.27.bb
+++ b/meta/recipes-gnome/gtk+/gtk+_2.24.27.bb
@@ -9,6 +9,7 @@ SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-${PV}.tar.xz \
            file://hardcoded_libtool.patch \
            file://toggle-font.diff;striplevel=0 \
            file://doc-fixes.patch \
+           file://strict-prototypes.patch \
 	  "
 
 SRC_URI[md5sum] = "b1e890e15602c5bcb40d85b13fe046fd"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 01/10] connman: Fix builds to compile on musl
  2015-04-22  7:49 ` [PATCH 01/10] connman: Fix builds to compile on musl Khem Raj
@ 2015-04-22 10:27   ` Jukka Rissanen
  2015-04-22 16:11     ` Khem Raj
  0 siblings, 1 reply; 13+ messages in thread
From: Jukka Rissanen @ 2015-04-22 10:27 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

Hi,

On ke, 2015-04-22 at 07:49 +0000, Khem Raj wrote:
> Add explicit includes for headers which are indirectly included on glibc
> Dont use backtrace APIs on non-glibc C libs
> res_nimit is a glibc specific API in resolvers so we avoid it
> 
> Change-Id: I78a173f02f8c117ebb513311f27a48bc8d645efe
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  ...cktrace-API-only-when-compiling-for-glibc.patch |  41 ++++
>  .../connman/connman/0002-musl-header-fixes.patch   | 235 +++++++++++++++++++++
>  ...resolve-musl-does-not-implement-res_ninit.patch |  77 +++++++
>  ...Fix-duplicate-definitions-issue-with-musl.patch |  43 ++++
>  meta/recipes-connectivity/connman/connman_1.28.bb  |   4 +
>  5 files changed, 400 insertions(+)
>  create mode 100644 meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch
>  create mode 100644 meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch
>  create mode 100644 meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch
>  create mode 100644 meta/recipes-connectivity/connman/connman/0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch
> 
> diff --git a/meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch b/meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch
> new file mode 100644
> index 0000000..873843b
> --- /dev/null
> +++ b/meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch
> @@ -0,0 +1,41 @@
> +From b736e90681e135e0cccb143a9ce8b7049e1ec0f0 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Mon, 6 Apr 2015 22:57:20 -0700
> +Subject: [PATCH 1/4] Enable backtrace() API only when compiling for glibc
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +---
> + src/log.c | 6 ++++--
> + 1 file changed, 4 insertions(+), 2 deletions(-)
> +
> +diff --git a/src/log.c b/src/log.c
> +index a693bd0..3bf9fcc 100644
> +--- a/src/log.c
> ++++ b/src/log.c
> +@@ -30,7 +30,9 @@
> + #include <stdlib.h>
> + #include <string.h>
> + #include <syslog.h>
> ++#ifdef __GLIBC__
> + #include <execinfo.h>
> ++#endif

Should this be #ifdef HAVE_EXECINFO_H
and should this patch merged into 0002-musl-header-fixes.patch

> + #include <dlfcn.h>
> + 
> + #include "connman.h"
> +@@ -215,9 +217,9 @@ static void print_backtrace(unsigned int offset)
> + static void signal_handler(int signo)
> + {
> + 	connman_error("Aborting (signal %d) [%s]", signo, program_exec);
> +-
> ++#ifdef __GLIBC__
> + 	print_backtrace(2);
> +-
> ++#endif

The above is not needed as print_backtrace() is no-op if there is no
execinfo.h avaiable (in the next patch).


> + 	exit(EXIT_FAILURE);
> + }
> + 
> +-- 
> +2.1.4
> +
> diff --git a/meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch b/meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch
> new file mode 100644
> index 0000000..058f1dc
> --- /dev/null
> +++ b/meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch
> @@ -0,0 +1,235 @@
> +From b6ff3a5989e72307cd54a840179ea072c4e0213e Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Mon, 6 Apr 2015 22:59:55 -0700
> +Subject: [PATCH 2/4] musl header fixes
> +
> +ported from
> +http://git.alpinelinux.org/cgit/aports/plain/testing/connman/musl-fixes.patch
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +---
> + configure.ac                 | 1 +
> + gdhcp/common.c               | 6 +++++-
> + gweb/gresolv.c               | 1 +
> + plugins/wifi.c               | 3 +--
> + src/ippool.c                 | 2 +-
> + src/iptables.c               | 2 +-
> + src/log.c                    | 2 ++
> + src/ntp.c                    | 2 +-
> + src/tethering.c              | 2 --
> + tools/dhcp-test.c            | 1 -
> + tools/dnsproxy-test.c        | 1 +
> + tools/private-network-test.c | 2 +-
> + tools/tap-test.c             | 2 +-
> + 13 files changed, 16 insertions(+), 11 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 6fa01ba..493a5f1 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -165,6 +165,7 @@ fi
> + AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
> + AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
> + 
> ++AC_CHECK_HEADERS(execinfo.h)
> + AC_CHECK_HEADERS(resolv.h, dummy=yes,
> + 	AC_MSG_ERROR(resolver header files are required))
> + AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
> +diff --git a/gdhcp/common.c b/gdhcp/common.c
> +index 48fcdef..40ade87 100644
> +--- a/gdhcp/common.c
> ++++ b/gdhcp/common.c
> +@@ -22,6 +22,7 @@
> + #include <config.h>
> + #endif
> + 
> ++#define _GNU_SOURCE
> + #include <stdio.h>
> + #include <stdlib.h>
> + #include <errno.h>
> +@@ -31,7 +32,6 @@
> + #include <string.h>
> + #include <endian.h>
> + #include <net/if_arp.h>
> +-#include <linux/if.h>
> + #include <netpacket/packet.h>
> + #include <net/ethernet.h>
> + #include <arpa/inet.h>
> +@@ -40,6 +40,8 @@
> + #include "gdhcp.h"
> + #include "common.h"
> + 
> ++#include <linux/if.h>
> ++
> + static const DHCPOption client_options[] = {
> + 	{ OPTION_IP,			0x01 }, /* subnet-mask */
> + 	{ OPTION_IP | OPTION_LIST,	0x03 }, /* routers */
> +@@ -474,10 +476,12 @@ static const struct in6_addr in6addr_all_dhcp_relay_agents_and_servers_mc =
> + 	IN6ADDR_ALL_DHCP_RELAY_AGENTS_AND_SERVERS_MC_INIT;
> + 
> + /* from netinet/in.h */
> ++#if 0
> + struct in6_pktinfo {
> + 	struct in6_addr ipi6_addr;  /* src/dst IPv6 address */
> + 	unsigned int ipi6_ifindex;  /* send/recv interface index */
> + };
> ++#endif

This is already fixed by connman commit
e8784053a0a680ec8943ff20559c6561cb5b9a96 and will be available in 1.29

> + 
> + int dhcpv6_send_packet(int index, struct dhcpv6_packet *dhcp_pkt, int len)
> + {
> +diff --git a/gweb/gresolv.c b/gweb/gresolv.c
> +index 5cf7a9a..c11a1d9 100644
> +--- a/gweb/gresolv.c
> ++++ b/gweb/gresolv.c
> +@@ -24,6 +24,7 @@
> + #endif
> + 
> + #include <errno.h>
> ++#include <stdio.h>
> + #include <unistd.h>
> + #include <stdarg.h>
> + #include <string.h>
> +diff --git a/plugins/wifi.c b/plugins/wifi.c
> +index 1f90a31..427c552 100644
> +--- a/plugins/wifi.c
> ++++ b/plugins/wifi.c
> +@@ -30,9 +30,8 @@
> + #include <string.h>
> + #include <sys/ioctl.h>
> + #include <sys/socket.h>
> +-#include <linux/if_arp.h>
> +-#include <linux/wireless.h>
> + #include <net/ethernet.h>
> ++#include <linux/wireless.h>
> + 
> + #ifndef IFF_LOWER_UP
> + #define IFF_LOWER_UP	0x10000
> +diff --git a/src/ippool.c b/src/ippool.c
> +index bb8568d..f1eb1f3 100644
> +--- a/src/ippool.c
> ++++ b/src/ippool.c
> +@@ -28,7 +28,7 @@
> + #include <stdio.h>
> + #include <string.h>
> + #include <unistd.h>
> +-#include <sys/errno.h>
> ++#include <errno.h>
> + #include <sys/socket.h>
> + 
> + #include "connman.h"
> +diff --git a/src/iptables.c b/src/iptables.c
> +index 8d583ea..a91a451 100644
> +--- a/src/iptables.c
> ++++ b/src/iptables.c
> +@@ -28,7 +28,7 @@
> + #include <stdio.h>
> + #include <string.h>
> + #include <unistd.h>
> +-#include <sys/errno.h>
> ++#include <errno.h>
> + #include <sys/socket.h>
> + #include <xtables.h>
> + 
> +diff --git a/src/log.c b/src/log.c
> +index 3bf9fcc..3b9843f 100644
> +--- a/src/log.c
> ++++ b/src/log.c
> +@@ -114,6 +114,7 @@ void connman_debug(const char *format, ...)
> + 
> + static void print_backtrace(unsigned int offset)
> + {
> ++#ifdef HAVE_EXECINFO_H
> + 	void *frames[99];
> + 	size_t n_ptrs;
> + 	unsigned int i;
> +@@ -212,6 +213,7 @@ static void print_backtrace(unsigned int offset)
> + 
> + 	close(outfd[1]);
> + 	close(infd[0]);
> ++#endif /* HAVE_EXECINFO_H */
> + }
> + 
> + static void signal_handler(int signo)
> +diff --git a/src/ntp.c b/src/ntp.c
> +index abb2caa..dd50532 100644
> +--- a/src/ntp.c
> ++++ b/src/ntp.c
> +@@ -180,7 +180,7 @@ static void send_packet(int fd, const char *server, uint32_t timeout)
> + 	msg.xmttime.fraction = htonl(transmit_timeval.tv_usec * 1000);
> + 
> + 	len = sendto(fd, &msg, sizeof(msg), MSG_DONTWAIT,
> +-						&addr, sizeof(addr));
> ++						(struct sockaddr *) &addr, sizeof(addr));
> + 	if (len < 0) {
> + 		connman_error("Time request for server %s failed (%d/%s)",
> + 			server, errno, strerror(errno));
> +diff --git a/src/tethering.c b/src/tethering.c
> +index ceeec74..c44cb36 100644
> +--- a/src/tethering.c
> ++++ b/src/tethering.c
> +@@ -31,10 +31,8 @@
> + #include <stdio.h>
> + #include <sys/ioctl.h>
> + #include <net/if.h>
> +-#include <linux/sockios.h>
> + #include <string.h>
> + #include <fcntl.h>
> +-#include <linux/if_tun.h>
> + #include <netinet/in.h>
> + #include <linux/if_bridge.h>
> + 
> +diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c
> +index c34e10a..eae66fc 100644
> +--- a/tools/dhcp-test.c
> ++++ b/tools/dhcp-test.c
> +@@ -33,7 +33,6 @@
> + #include <arpa/inet.h>
> + #include <net/route.h>
> + #include <net/ethernet.h>
> +-#include <linux/if_arp.h>
> + 
> + #include <gdhcp/gdhcp.h>
> + 
> +diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c
> +index 551cae9..371e2e2 100644
> +--- a/tools/dnsproxy-test.c
> ++++ b/tools/dnsproxy-test.c
> +@@ -24,6 +24,7 @@
> + #endif
> + 
> + #include <errno.h>
> ++#include <stdio.h>
> + #include <stdlib.h>
> + #include <string.h>
> + #include <unistd.h>
> +diff --git a/tools/private-network-test.c b/tools/private-network-test.c
> +index 3dd115b..2828bb3 100644
> +--- a/tools/private-network-test.c
> ++++ b/tools/private-network-test.c
> +@@ -32,7 +32,7 @@
> + #include <stdlib.h>
> + #include <string.h>
> + #include <signal.h>
> +-#include <sys/poll.h>
> ++#include <poll.h>
> + #include <sys/signalfd.h>
> + #include <unistd.h>
> + 
> +diff --git a/tools/tap-test.c b/tools/tap-test.c
> +index fdc098a..ea9a567 100644
> +--- a/tools/tap-test.c
> ++++ b/tools/tap-test.c
> +@@ -29,7 +29,7 @@
> + #include <fcntl.h>
> + #include <unistd.h>
> + #include <string.h>
> +-#include <sys/poll.h>
> ++#include <poll.h>
> + #include <sys/ioctl.h>
> + 
> + #include <netinet/in.h>
> +-- 
> +2.1.4
> +
> diff --git a/meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch b/meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch
> new file mode 100644
> index 0000000..28931c1
> --- /dev/null
> +++ b/meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch
> @@ -0,0 +1,77 @@
> +From 93bb904cc4e1e97152e6408077ba136fc883b6bb Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Mon, 6 Apr 2015 23:02:21 -0700
> +Subject: [PATCH 3/4] resolve: musl does not implement res_ninit
> +
> +ported from
> +http://git.alpinelinux.org/cgit/aports/plain/testing/connman/libresolv.patch
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +---
> + gweb/gresolv.c | 33 ++++++++++++---------------------
> + 1 file changed, 12 insertions(+), 21 deletions(-)
> +
> +diff --git a/gweb/gresolv.c b/gweb/gresolv.c
> +index c11a1d9..991b14c 100644
> +--- a/gweb/gresolv.c
> ++++ b/gweb/gresolv.c
> +@@ -876,8 +876,6 @@ GResolv *g_resolv_new(int index)
> + 	resolv->index = index;
> + 	resolv->nameserver_list = NULL;
> + 
> +-	res_ninit(&resolv->res);
> +-
> + 	return resolv;
> + }
> + 
> +@@ -917,8 +915,6 @@ void g_resolv_unref(GResolv *resolv)
> + 
> + 	flush_nameservers(resolv);
> + 
> +-	res_nclose(&resolv->res);
> +-
> + 	g_free(resolv);
> + }
> + 
> +@@ -1021,24 +1017,19 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname,
> + 	debug(resolv, "hostname %s", hostname);
> + 
> + 	if (!resolv->nameserver_list) {
> +-		int i;
> +-
> +-		for (i = 0; i < resolv->res.nscount; i++) {
> +-			char buf[100];
> +-			int family = resolv->res.nsaddr_list[i].sin_family;
> +-			void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr;
> +-
> +-			if (family != AF_INET &&
> +-					resolv->res._u._ext.nsaddrs[i]) {
> +-				family = AF_INET6;
> +-				sa_addr = &resolv->res._u._ext.nsaddrs[i]->sin6_addr;
> ++		FILE *f = fopen("/etc/resolv.conf", "r");
> ++		if (f) {
> ++			char line[256], *s;
> ++			int i;
> ++			while (fgets(line, sizeof(line), f)) {
> ++				if (strncmp(line, "nameserver", 10) || !isspace(line[10]))
> ++					continue;
> ++				for (s = &line[11]; isspace(s[0]); s++);
> ++				for (i = 0; s[i] && !isspace(s[i]); i++);
> ++				s[i] = 0;
> ++				g_resolv_add_nameserver(resolv, s, 53, 0);
> + 			}
> +-
> +-			if (family != AF_INET && family != AF_INET6)
> +-				continue;
> +-
> +-			if (inet_ntop(family, sa_addr, buf, sizeof(buf)))
> +-				g_resolv_add_nameserver(resolv, buf, 53, 0);
> ++			fclose(f);
> + 		}
> + 
> + 		if (!resolv->nameserver_list)

Should the above be conditional and only for musl, for glibc we
could/should still use the resolv library?


> +-- 
> +2.1.4
> +
> diff --git a/meta/recipes-connectivity/connman/connman/0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch b/meta/recipes-connectivity/connman/connman/0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch
> new file mode 100644
> index 0000000..80a4831
> --- /dev/null
> +++ b/meta/recipes-connectivity/connman/connman/0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch
> @@ -0,0 +1,43 @@
> +From 6c1854401b4888fbf420ceb7b1e18097b91fb488 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Mon, 6 Apr 2015 23:48:23 -0700
> +Subject: [PATCH 4/4] tethering: Fix duplicate definitions issue with musl
> +
> +We just need this one define BRCTL_GET_VERSION
> +from linux/if_bridge.h
> +So lets define it if not defined already and remove
> +including linux/if_bridge.h because it include's linux/in6.h
> +which then conflicts with musl's netinet/in.h
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +---
> + src/tethering.c | 5 +++--
> + 1 file changed, 3 insertions(+), 2 deletions(-)
> +
> +diff --git a/src/tethering.c b/src/tethering.c
> +index c44cb36..62fce36 100644
> +--- a/src/tethering.c
> ++++ b/src/tethering.c
> +@@ -34,14 +34,15 @@
> + #include <string.h>
> + #include <fcntl.h>
> + #include <netinet/in.h>
> +-#include <linux/if_bridge.h>
> + 
> + #include "connman.h"
> + 
> + #include <gdhcp/gdhcp.h>
> + 
> + #include <gdbus.h>
> +-
> ++#ifndef BRCTL_GET_VERSION
> ++#define BRCTL_GET_VERSION 0
> ++#endif
> + #ifndef DBUS_TYPE_UNIX_FD
> + #define DBUS_TYPE_UNIX_FD -1
> + #endif
> +-- 
> +2.1.4
> +
> diff --git a/meta/recipes-connectivity/connman/connman_1.28.bb b/meta/recipes-connectivity/connman/connman_1.28.bb
> index 53e71fa..a395d63 100644
> --- a/meta/recipes-connectivity/connman/connman_1.28.bb
> +++ b/meta/recipes-connectivity/connman/connman_1.28.bb
> @@ -3,6 +3,10 @@ require connman.inc
>  SRC_URI  = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
>              file://0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch \
>              file://add_xuser_dbus_permission.patch \
> +	    file://0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch \
> +	    file://0002-musl-header-fixes.patch \
> +	    file://0003-resolve-musl-does-not-implement-res_ninit.patch \
> +	    file://0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch \
>              file://connman \
>              "
>  SRC_URI[md5sum] = "6e07c93877f80bb73c9d4dbfc697f3fc"
> -- 
> 2.1.4
> 

Have you considered sending these to ConnMan upstream?


Cheers,
Jukka





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 01/10] connman: Fix builds to compile on musl
  2015-04-22 10:27   ` Jukka Rissanen
@ 2015-04-22 16:11     ` Khem Raj
  0 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2015-04-22 16:11 UTC (permalink / raw)
  To: Jukka Rissanen; +Cc: openembedded-core

	
> On Apr 22, 2015, at 3:27 AM, Jukka Rissanen <jukka.rissanen@linux.intel.com> wrote:
> 
> Hi,
> 
> On ke, 2015-04-22 at 07:49 +0000, Khem Raj wrote:
>> Add explicit includes for headers which are indirectly included on glibc
>> Dont use backtrace APIs on non-glibc C libs
>> res_nimit is a glibc specific API in resolvers so we avoid it
>> 
>> Change-Id: I78a173f02f8c117ebb513311f27a48bc8d645efe
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>> ...cktrace-API-only-when-compiling-for-glibc.patch |  41 ++++
>> .../connman/connman/0002-musl-header-fixes.patch   | 235 +++++++++++++++++++++
>> ...resolve-musl-does-not-implement-res_ninit.patch |  77 +++++++
>> ...Fix-duplicate-definitions-issue-with-musl.patch |  43 ++++
>> meta/recipes-connectivity/connman/connman_1.28.bb  |   4 +
>> 5 files changed, 400 insertions(+)
>> create mode 100644 meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch
>> create mode 100644 meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch
>> create mode 100644 meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch
>> create mode 100644 meta/recipes-connectivity/connman/connman/0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch
>> 
>> diff --git a/meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch b/meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch
>> new file mode 100644
>> index 0000000..873843b
>> --- /dev/null
>> +++ b/meta/recipes-connectivity/connman/connman/0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch
>> @@ -0,0 +1,41 @@
>> +From b736e90681e135e0cccb143a9ce8b7049e1ec0f0 Mon Sep 17 00:00:00 2001
>> +From: Khem Raj <raj.khem@gmail.com>
>> +Date: Mon, 6 Apr 2015 22:57:20 -0700
>> +Subject: [PATCH 1/4] Enable backtrace() API only when compiling for glibc
>> +
>> +Upstream-Status: Pending
>> +
>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> +---
>> + src/log.c | 6 ++++--
>> + 1 file changed, 4 insertions(+), 2 deletions(-)
>> +
>> +diff --git a/src/log.c b/src/log.c
>> +index a693bd0..3bf9fcc 100644
>> +--- a/src/log.c
>> ++++ b/src/log.c
>> +@@ -30,7 +30,9 @@
>> + #include <stdlib.h>
>> + #include <string.h>
>> + #include <syslog.h>
>> ++#ifdef __GLIBC__
>> + #include <execinfo.h>
>> ++#endif
> 
> Should this be #ifdef HAVE_EXECINFO_H
> and should this patch merged into 0002-musl-header-fixes.patch

It could be yes

> 
>> + #include <dlfcn.h>
>> + 
>> + #include "connman.h"
>> +@@ -215,9 +217,9 @@ static void print_backtrace(unsigned int offset)
>> + static void signal_handler(int signo)
>> + {
>> + 	connman_error("Aborting (signal %d) [%s]", signo, program_exec);
>> +-
>> ++#ifdef __GLIBC__
>> + 	print_backtrace(2);
>> +-
>> ++#endif
> 
> The above is not needed as print_backtrace() is no-op if there is no
> execinfo.h avaiable (in the next patch).


this patch can be ignored for now since its not the updated one. I have to send a v3 of it
I would use libunwind for musl to get same functionality so may be thats a better option for backtrace()
> 
> 
>> + 	exit(EXIT_FAILURE);
>> + }
>> + 
>> +-- 
>> +2.1.4
>> +
>> diff --git a/meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch b/meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch
>> new file mode 100644
>> index 0000000..058f1dc
>> --- /dev/null
>> +++ b/meta/recipes-connectivity/connman/connman/0002-musl-header-fixes.patch
>> @@ -0,0 +1,235 @@
>> +From b6ff3a5989e72307cd54a840179ea072c4e0213e Mon Sep 17 00:00:00 2001
>> +From: Khem Raj <raj.khem@gmail.com>
>> +Date: Mon, 6 Apr 2015 22:59:55 -0700
>> +Subject: [PATCH 2/4] musl header fixes
>> +
>> +ported from
>> +http://git.alpinelinux.org/cgit/aports/plain/testing/connman/musl-fixes.patch
>> +
>> +Upstream-Status: Pending
>> +
>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> +---
>> + configure.ac                 | 1 +
>> + gdhcp/common.c               | 6 +++++-
>> + gweb/gresolv.c               | 1 +
>> + plugins/wifi.c               | 3 +--
>> + src/ippool.c                 | 2 +-
>> + src/iptables.c               | 2 +-
>> + src/log.c                    | 2 ++
>> + src/ntp.c                    | 2 +-
>> + src/tethering.c              | 2 --
>> + tools/dhcp-test.c            | 1 -
>> + tools/dnsproxy-test.c        | 1 +
>> + tools/private-network-test.c | 2 +-
>> + tools/tap-test.c             | 2 +-
>> + 13 files changed, 16 insertions(+), 11 deletions(-)
>> +
>> +diff --git a/configure.ac b/configure.ac
>> +index 6fa01ba..493a5f1 100644
>> +--- a/configure.ac
>> ++++ b/configure.ac
>> +@@ -165,6 +165,7 @@ fi
>> + AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
>> + AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
>> + 
>> ++AC_CHECK_HEADERS(execinfo.h)
>> + AC_CHECK_HEADERS(resolv.h, dummy=yes,
>> + 	AC_MSG_ERROR(resolver header files are required))
>> + AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
>> +diff --git a/gdhcp/common.c b/gdhcp/common.c
>> +index 48fcdef..40ade87 100644
>> +--- a/gdhcp/common.c
>> ++++ b/gdhcp/common.c
>> +@@ -22,6 +22,7 @@
>> + #include <config.h>
>> + #endif
>> + 
>> ++#define _GNU_SOURCE
>> + #include <stdio.h>
>> + #include <stdlib.h>
>> + #include <errno.h>
>> +@@ -31,7 +32,6 @@
>> + #include <string.h>
>> + #include <endian.h>
>> + #include <net/if_arp.h>
>> +-#include <linux/if.h>
>> + #include <netpacket/packet.h>
>> + #include <net/ethernet.h>
>> + #include <arpa/inet.h>
>> +@@ -40,6 +40,8 @@
>> + #include "gdhcp.h"
>> + #include "common.h"
>> + 
>> ++#include <linux/if.h>
>> ++
>> + static const DHCPOption client_options[] = {
>> + 	{ OPTION_IP,			0x01 }, /* subnet-mask */
>> + 	{ OPTION_IP | OPTION_LIST,	0x03 }, /* routers */
>> +@@ -474,10 +476,12 @@ static const struct in6_addr in6addr_all_dhcp_relay_agents_and_servers_mc =
>> + 	IN6ADDR_ALL_DHCP_RELAY_AGENTS_AND_SERVERS_MC_INIT;
>> + 
>> + /* from netinet/in.h */
>> ++#if 0
>> + struct in6_pktinfo {
>> + 	struct in6_addr ipi6_addr;  /* src/dst IPv6 address */
>> + 	unsigned int ipi6_ifindex;  /* send/recv interface index */
>> + };
>> ++#endif
> 
> This is already fixed by connman commit
> e8784053a0a680ec8943ff20559c6561cb5b9a96 and will be available in 1.29

yes, we can remove it when we upgrade.

> 
>> + 
>> + int dhcpv6_send_packet(int index, struct dhcpv6_packet *dhcp_pkt, int len)
>> + {
>> +diff --git a/gweb/gresolv.c b/gweb/gresolv.c
>> +index 5cf7a9a..c11a1d9 100644
>> +--- a/gweb/gresolv.c
>> ++++ b/gweb/gresolv.c
>> +@@ -24,6 +24,7 @@
>> + #endif
>> + 
>> + #include <errno.h>
>> ++#include <stdio.h>
>> + #include <unistd.h>
>> + #include <stdarg.h>
>> + #include <string.h>
>> +diff --git a/plugins/wifi.c b/plugins/wifi.c
>> +index 1f90a31..427c552 100644
>> +--- a/plugins/wifi.c
>> ++++ b/plugins/wifi.c
>> +@@ -30,9 +30,8 @@
>> + #include <string.h>
>> + #include <sys/ioctl.h>
>> + #include <sys/socket.h>
>> +-#include <linux/if_arp.h>
>> +-#include <linux/wireless.h>
>> + #include <net/ethernet.h>
>> ++#include <linux/wireless.h>
>> + 
>> + #ifndef IFF_LOWER_UP
>> + #define IFF_LOWER_UP	0x10000
>> +diff --git a/src/ippool.c b/src/ippool.c
>> +index bb8568d..f1eb1f3 100644
>> +--- a/src/ippool.c
>> ++++ b/src/ippool.c
>> +@@ -28,7 +28,7 @@
>> + #include <stdio.h>
>> + #include <string.h>
>> + #include <unistd.h>
>> +-#include <sys/errno.h>
>> ++#include <errno.h>
>> + #include <sys/socket.h>
>> + 
>> + #include "connman.h"
>> +diff --git a/src/iptables.c b/src/iptables.c
>> +index 8d583ea..a91a451 100644
>> +--- a/src/iptables.c
>> ++++ b/src/iptables.c
>> +@@ -28,7 +28,7 @@
>> + #include <stdio.h>
>> + #include <string.h>
>> + #include <unistd.h>
>> +-#include <sys/errno.h>
>> ++#include <errno.h>
>> + #include <sys/socket.h>
>> + #include <xtables.h>
>> + 
>> +diff --git a/src/log.c b/src/log.c
>> +index 3bf9fcc..3b9843f 100644
>> +--- a/src/log.c
>> ++++ b/src/log.c
>> +@@ -114,6 +114,7 @@ void connman_debug(const char *format, ...)
>> + 
>> + static void print_backtrace(unsigned int offset)
>> + {
>> ++#ifdef HAVE_EXECINFO_H
>> + 	void *frames[99];
>> + 	size_t n_ptrs;
>> + 	unsigned int i;
>> +@@ -212,6 +213,7 @@ static void print_backtrace(unsigned int offset)
>> + 
>> + 	close(outfd[1]);
>> + 	close(infd[0]);
>> ++#endif /* HAVE_EXECINFO_H */
>> + }
>> + 
>> + static void signal_handler(int signo)
>> +diff --git a/src/ntp.c b/src/ntp.c
>> +index abb2caa..dd50532 100644
>> +--- a/src/ntp.c
>> ++++ b/src/ntp.c
>> +@@ -180,7 +180,7 @@ static void send_packet(int fd, const char *server, uint32_t timeout)
>> + 	msg.xmttime.fraction = htonl(transmit_timeval.tv_usec * 1000);
>> + 
>> + 	len = sendto(fd, &msg, sizeof(msg), MSG_DONTWAIT,
>> +-						&addr, sizeof(addr));
>> ++						(struct sockaddr *) &addr, sizeof(addr));
>> + 	if (len < 0) {
>> + 		connman_error("Time request for server %s failed (%d/%s)",
>> + 			server, errno, strerror(errno));
>> +diff --git a/src/tethering.c b/src/tethering.c
>> +index ceeec74..c44cb36 100644
>> +--- a/src/tethering.c
>> ++++ b/src/tethering.c
>> +@@ -31,10 +31,8 @@
>> + #include <stdio.h>
>> + #include <sys/ioctl.h>
>> + #include <net/if.h>
>> +-#include <linux/sockios.h>
>> + #include <string.h>
>> + #include <fcntl.h>
>> +-#include <linux/if_tun.h>
>> + #include <netinet/in.h>
>> + #include <linux/if_bridge.h>
>> + 
>> +diff --git a/tools/dhcp-test.c b/tools/dhcp-test.c
>> +index c34e10a..eae66fc 100644
>> +--- a/tools/dhcp-test.c
>> ++++ b/tools/dhcp-test.c
>> +@@ -33,7 +33,6 @@
>> + #include <arpa/inet.h>
>> + #include <net/route.h>
>> + #include <net/ethernet.h>
>> +-#include <linux/if_arp.h>
>> + 
>> + #include <gdhcp/gdhcp.h>
>> + 
>> +diff --git a/tools/dnsproxy-test.c b/tools/dnsproxy-test.c
>> +index 551cae9..371e2e2 100644
>> +--- a/tools/dnsproxy-test.c
>> ++++ b/tools/dnsproxy-test.c
>> +@@ -24,6 +24,7 @@
>> + #endif
>> + 
>> + #include <errno.h>
>> ++#include <stdio.h>
>> + #include <stdlib.h>
>> + #include <string.h>
>> + #include <unistd.h>
>> +diff --git a/tools/private-network-test.c b/tools/private-network-test.c
>> +index 3dd115b..2828bb3 100644
>> +--- a/tools/private-network-test.c
>> ++++ b/tools/private-network-test.c
>> +@@ -32,7 +32,7 @@
>> + #include <stdlib.h>
>> + #include <string.h>
>> + #include <signal.h>
>> +-#include <sys/poll.h>
>> ++#include <poll.h>
>> + #include <sys/signalfd.h>
>> + #include <unistd.h>
>> + 
>> +diff --git a/tools/tap-test.c b/tools/tap-test.c
>> +index fdc098a..ea9a567 100644
>> +--- a/tools/tap-test.c
>> ++++ b/tools/tap-test.c
>> +@@ -29,7 +29,7 @@
>> + #include <fcntl.h>
>> + #include <unistd.h>
>> + #include <string.h>
>> +-#include <sys/poll.h>
>> ++#include <poll.h>
>> + #include <sys/ioctl.h>
>> + 
>> + #include <netinet/in.h>
>> +-- 
>> +2.1.4
>> +
>> diff --git a/meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch b/meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch
>> new file mode 100644
>> index 0000000..28931c1
>> --- /dev/null
>> +++ b/meta/recipes-connectivity/connman/connman/0003-resolve-musl-does-not-implement-res_ninit.patch
>> @@ -0,0 +1,77 @@
>> +From 93bb904cc4e1e97152e6408077ba136fc883b6bb Mon Sep 17 00:00:00 2001
>> +From: Khem Raj <raj.khem@gmail.com>
>> +Date: Mon, 6 Apr 2015 23:02:21 -0700
>> +Subject: [PATCH 3/4] resolve: musl does not implement res_ninit
>> +
>> +ported from
>> +http://git.alpinelinux.org/cgit/aports/plain/testing/connman/libresolv.patch
>> +
>> +Upstream-Status: Pending
>> +
>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> +---
>> + gweb/gresolv.c | 33 ++++++++++++---------------------
>> + 1 file changed, 12 insertions(+), 21 deletions(-)
>> +
>> +diff --git a/gweb/gresolv.c b/gweb/gresolv.c
>> +index c11a1d9..991b14c 100644
>> +--- a/gweb/gresolv.c
>> ++++ b/gweb/gresolv.c
>> +@@ -876,8 +876,6 @@ GResolv *g_resolv_new(int index)
>> + 	resolv->index = index;
>> + 	resolv->nameserver_list = NULL;
>> + 
>> +-	res_ninit(&resolv->res);
>> +-
>> + 	return resolv;
>> + }
>> + 
>> +@@ -917,8 +915,6 @@ void g_resolv_unref(GResolv *resolv)
>> + 
>> + 	flush_nameservers(resolv);
>> + 
>> +-	res_nclose(&resolv->res);
>> +-
>> + 	g_free(resolv);
>> + }
>> + 
>> +@@ -1021,24 +1017,19 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname,
>> + 	debug(resolv, "hostname %s", hostname);
>> + 
>> + 	if (!resolv->nameserver_list) {
>> +-		int i;
>> +-
>> +-		for (i = 0; i < resolv->res.nscount; i++) {
>> +-			char buf[100];
>> +-			int family = resolv->res.nsaddr_list[i].sin_family;
>> +-			void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr;
>> +-
>> +-			if (family != AF_INET &&
>> +-					resolv->res._u._ext.nsaddrs[i]) {
>> +-				family = AF_INET6;
>> +-				sa_addr = &resolv->res._u._ext.nsaddrs[i]->sin6_addr;
>> ++		FILE *f = fopen("/etc/resolv.conf", "r");
>> ++		if (f) {
>> ++			char line[256], *s;
>> ++			int i;
>> ++			while (fgets(line, sizeof(line), f)) {
>> ++				if (strncmp(line, "nameserver", 10) || !isspace(line[10]))
>> ++					continue;
>> ++				for (s = &line[11]; isspace(s[0]); s++);
>> ++				for (i = 0; s[i] && !isspace(s[i]); i++);
>> ++				s[i] = 0;
>> ++				g_resolv_add_nameserver(resolv, s, 53, 0);
>> + 			}
>> +-
>> +-			if (family != AF_INET && family != AF_INET6)
>> +-				continue;
>> +-
>> +-			if (inet_ntop(family, sa_addr, buf, sizeof(buf)))
>> +-				g_resolv_add_nameserver(resolv, buf, 53, 0);
>> ++			fclose(f);
>> + 		}
>> + 
>> + 		if (!resolv->nameserver_list)
> 
> Should the above be conditional and only for musl, for glibc we
> could/should still use the resolv library?

I would think code depending on glibc might not be good option since it adds dependency
and having ifdefs is as bad

> 
>> +	    file://0001-Enable-backtrace-API-only-when-compiling-for-glibc.patch \
>> +	    file://0002-musl-header-fixes.patch \
>> +	    file://0003-resolve-musl-does-not-implement-res_ninit.patch \
>> +	    file://0004-tethering-Fix-duplicate-definitions-issue-with-musl.patch \
>>             file://connman \
>>             "
>> SRC_URI[md5sum] = "6e07c93877f80bb73c9d4dbfc697f3fc"
>> -- 
>> 2.1.4
>> 
> 
> Have you considered sending these to ConnMan upstream?
> 

Not yet



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-04-22 16:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-22  7:49 [PATCH 00/10] World build fixes with gcc-5 Khem Raj
2015-04-22  7:49 ` [PATCH 01/10] connman: Fix builds to compile on musl Khem Raj
2015-04-22 10:27   ` Jukka Rissanen
2015-04-22 16:11     ` Khem Raj
2015-04-22  7:49 ` [PATCH 02/10] glibc, packagegroup-self-hosted, packagegroup-core-lsb: Consider non-glibc libcs Khem Raj
2015-04-22  7:49 ` [PATCH 03/10] insserv: Fix build with gcc5 and clang Khem Raj
2015-04-22  7:49 ` [PATCH 04/10] xserver-xorg: Fix build with gcc-5 Khem Raj
2015-04-22  7:49 ` [PATCH 05/10] u-boot-mkimage: Backport fix from upstream to fix " Khem Raj
2015-04-22  7:49 ` [PATCH 06/10] mdadm: Fix inline semantics Khem Raj
2015-04-22  7:49 ` [PATCH 07/10] lttng-tools: Add extern qualifier to declarations in .h file Khem Raj
2015-04-22  7:49 ` [PATCH 08/10] subversion: Add -P to CPPFLAGS Khem Raj
2015-04-22  7:49 ` [PATCH 09/10] gnome-icon-theme: Needs nls.m4 Khem Raj
2015-04-22  7:49 ` [PATCH 10/10] gtk+: Correct function prototype Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.