* [PATCH 0/3] Clang fixes
@ 2020-01-20 17:52 Khem Raj
2020-01-20 17:52 ` [PATCH 1/3] gettext: Fix overloadable error with clang Khem Raj
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Khem Raj @ 2020-01-20 17:52 UTC (permalink / raw)
To: openembedded-core
These changes are found with clang and makes oe-core build again with
clang
The following changes since commit 6265facc75c3d980dd39494399251bf9121c25cb:
epiphany: Add missing mime-xgd inherit (2020-01-19 23:49:39 +0000)
are available in the Git repository at:
git://git.yoctoproject.org/poky-contrib kraj/pu
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=kraj/pu
Khem Raj (3):
gettext: Fix overloadable error with clang
mesa: Help compile with clang/mips
tcp-wrappers: Remove redundant forward declarations
.../gettext/gettext-0.20.1/overloadable.patch | 22 ++++++++++
meta/recipes-core/gettext/gettext_0.20.1.bb | 1 +
...0001-Remove-fgets-extern-declaration.patch | 43 +++++++++++++++++++
.../tcp-wrappers/tcp-wrappers_7.6.bb | 1 +
...sdetects-64bit-atomics-on-mips-clang.patch | 27 ++++++++++++
meta/recipes-graphics/mesa/mesa_19.3.1.bb | 1 +
6 files changed, 95 insertions(+)
create mode 100644 meta/recipes-core/gettext/gettext-0.20.1/overloadable.patch
create mode 100644 meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Remove-fgets-extern-declaration.patch
create mode 100644 meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch
--
2.25.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] gettext: Fix overloadable error with clang
2020-01-20 17:52 [PATCH 0/3] Clang fixes Khem Raj
@ 2020-01-20 17:52 ` Khem Raj
2020-01-20 17:52 ` [PATCH 2/3] mesa: Help compile with clang/mips Khem Raj
2020-01-20 17:52 ` [PATCH 3/3] tcp-wrappers: Remove redundant forward declarations Khem Raj
2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2020-01-20 17:52 UTC (permalink / raw)
To: openembedded-core
Clang detects that getcwd is being re-declared and signatures don't
match, simple solution is to let clang use overloadable attribute
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
.../gettext/gettext-0.20.1/overloadable.patch | 22 +++++++++++++++++++
meta/recipes-core/gettext/gettext_0.20.1.bb | 1 +
2 files changed, 23 insertions(+)
create mode 100644 meta/recipes-core/gettext/gettext-0.20.1/overloadable.patch
diff --git a/meta/recipes-core/gettext/gettext-0.20.1/overloadable.patch b/meta/recipes-core/gettext/gettext-0.20.1/overloadable.patch
new file mode 100644
index 0000000000..1b41cb464e
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.20.1/overloadable.patch
@@ -0,0 +1,22 @@
+Use overloadable attribute to aid clang
+
+Fixes
+dcigettext.c:147:7: error: redeclaration of 'getcwd' must have the 'overloadable' attribute
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+--- a/gettext-runtime/intl/dcigettext.c
++++ b/gettext-runtime/intl/dcigettext.c
+@@ -144,7 +144,11 @@ char *getwd ();
+ # if VMS
+ # define getcwd(buf, max) (getcwd) (buf, max, 0)
+ # else
+-char *getcwd ();
++char
++#ifdef __clang__
++__attribute__((overloadable))
++#endif
++*getcwd ();
+ # endif
+ # endif
+ # ifndef HAVE_STPCPY
diff --git a/meta/recipes-core/gettext/gettext_0.20.1.bb b/meta/recipes-core/gettext/gettext_0.20.1.bb
index 09628bc4a3..3b576f45e9 100644
--- a/meta/recipes-core/gettext/gettext_0.20.1.bb
+++ b/meta/recipes-core/gettext/gettext_0.20.1.bb
@@ -25,6 +25,7 @@ SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
file://serial-tests-config.patch \
file://0001-msgmerge-Fix-behaviour-of-for-msgfmt-on-PO-files-wit.patch \
file://0001-tests-autopoint-3-unset-MAKEFLAGS.patch \
+ file://overloadable.patch \
"
SRC_URI[md5sum] = "bb5b0c0caa028105f3ca1905ddc306e2"
--
2.25.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] mesa: Help compile with clang/mips
2020-01-20 17:52 [PATCH 0/3] Clang fixes Khem Raj
2020-01-20 17:52 ` [PATCH 1/3] gettext: Fix overloadable error with clang Khem Raj
@ 2020-01-20 17:52 ` Khem Raj
2020-01-20 17:52 ` [PATCH 3/3] tcp-wrappers: Remove redundant forward declarations Khem Raj
2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2020-01-20 17:52 UTC (permalink / raw)
To: openembedded-core
meson is detecting it does not support 64bit attomics but then when
defining local suppliments confused clang
../mesa-19.3.1/src/util/u_atomic.c:38:1: error: cannot redeclare builtin function '__sync_add_and_fetch_8'
__sync_add_and_fetch_8(uint64_t *ptr, uint64_t val)
^
../mesa-19.3.1/src/util/u_atomic.c:38:1: note: '__sync_add_and_fetch_8' is a builtin with type 'long long (volatile long long *, long long, ...)'
../mesa-19.3.1/src/util/u_atomic.c:38:1: error: definition of builtin function '__sync_add_and_fetch_8'
__sync_add_and_fetch_8(uint64_t *ptr, uint64_t val)
^
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
...sdetects-64bit-atomics-on-mips-clang.patch | 27 +++++++++++++++++++
meta/recipes-graphics/mesa/mesa_19.3.1.bb | 1 +
2 files changed, 28 insertions(+)
create mode 100644 meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch
diff --git a/meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch b/meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch
new file mode 100644
index 0000000000..15485feb71
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-meson-misdetects-64bit-atomics-on-mips-clang.patch
@@ -0,0 +1,27 @@
+From bb2f0bea553d51d659a9bc46f7ae186885405151 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Jan 2020 15:23:47 -0800
+Subject: [PATCH] meson misdetects 64bit atomics on mips/clang
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/util/u_atomic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/util/u_atomic.c b/src/util/u_atomic.c
+index e4bffa8..58e1ddd 100644
+--- a/src/util/u_atomic.c
++++ b/src/util/u_atomic.c
+@@ -21,7 +21,7 @@
+ * IN THE SOFTWARE.
+ */
+
+-#if defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD)
++#if !defined(__clang__) && defined(MISSING_64BIT_ATOMICS) && defined(HAVE_PTHREAD)
+
+ #include <stdint.h>
+ #include <pthread.h>
+--
+2.24.1
+
diff --git a/meta/recipes-graphics/mesa/mesa_19.3.1.bb b/meta/recipes-graphics/mesa/mesa_19.3.1.bb
index 855b7f23cd..b889f092e3 100644
--- a/meta/recipes-graphics/mesa/mesa_19.3.1.bb
+++ b/meta/recipes-graphics/mesa/mesa_19.3.1.bb
@@ -6,6 +6,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \
file://0003-Allow-enable-DRI-without-DRI-drivers.patch \
file://0004-Revert-mesa-Enable-asm-unconditionally-now-that-gen_.patch \
file://0005-vc4-use-intmax_t-for-formatted-output-of-timespec-me.patch \
+ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
"
SRC_URI[md5sum] = "5c5965db31993af47fee82c9a7ccba5e"
--
2.25.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] tcp-wrappers: Remove redundant forward declarations
2020-01-20 17:52 [PATCH 0/3] Clang fixes Khem Raj
2020-01-20 17:52 ` [PATCH 1/3] gettext: Fix overloadable error with clang Khem Raj
2020-01-20 17:52 ` [PATCH 2/3] mesa: Help compile with clang/mips Khem Raj
@ 2020-01-20 17:52 ` Khem Raj
2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2020-01-20 17:52 UTC (permalink / raw)
To: openembedded-core
fgets is already in stdio.h, and it can confuse the compilers when using
fortified headers, therefore remove the declarations
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
...0001-Remove-fgets-extern-declaration.patch | 43 +++++++++++++++++++
.../tcp-wrappers/tcp-wrappers_7.6.bb | 1 +
2 files changed, 44 insertions(+)
create mode 100644 meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Remove-fgets-extern-declaration.patch
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Remove-fgets-extern-declaration.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Remove-fgets-extern-declaration.patch
new file mode 100644
index 0000000000..88c8d9cae7
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/0001-Remove-fgets-extern-declaration.patch
@@ -0,0 +1,43 @@
+From 24d10919b4bc5e37a2d80b274d2cd2ee77b03549 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Jan 2020 14:25:47 -0800
+Subject: [PATCH] Remove fgets() extern declaration
+
+These sources already include <stdio.h> which should bring the correct
+declaration
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ hosts_access.c | 1 -
+ misc.c | 2 --
+ 2 files changed, 3 deletions(-)
+
+diff --git a/hosts_access.c b/hosts_access.c
+index 329b35e..0133e5e 100644
+--- a/hosts_access.c
++++ b/hosts_access.c
+@@ -44,7 +44,6 @@ static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22";
+ #include <netdb.h>
+ #endif
+
+-extern char *fgets();
+ extern int errno;
+
+ #ifndef INADDR_NONE
+diff --git a/misc.c b/misc.c
+index 74ca319..9a5e73a 100644
+--- a/misc.c
++++ b/misc.c
+@@ -18,8 +18,6 @@ static char sccsic[] = "@(#) misc.c 1.2 96/02/11 17:01:29";
+
+ #include "tcpd.h"
+
+-extern char *fgets();
+-
+ #ifndef INADDR_NONE
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+ #endif
+--
+2.24.1
+
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb b/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
index bd0c84c242..e903b9db14 100644
--- a/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
@@ -49,6 +49,7 @@ SRC_URI = "http://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \
file://0001-Fix-build-with-clang.patch \
file://fix_warnings.patch \
file://fix_warnings2.patch \
+ file://0001-Remove-fgets-extern-declaration.patch \
"
SRC_URI[md5sum] = "e6fa25f71226d090f34de3f6b122fb5a"
--
2.25.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-20 17:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-20 17:52 [PATCH 0/3] Clang fixes Khem Raj
2020-01-20 17:52 ` [PATCH 1/3] gettext: Fix overloadable error with clang Khem Raj
2020-01-20 17:52 ` [PATCH 2/3] mesa: Help compile with clang/mips Khem Raj
2020-01-20 17:52 ` [PATCH 3/3] tcp-wrappers: Remove redundant forward declarations Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox