diff options
author | Bernhard Rosenkränzer <bernhard.rosenkraenzer.ext@huawei.com> | 2021-03-18 16:04:08 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-07-14 09:53:49 -0700 |
commit | f8904424faebf1018fd8c6b30a9cb8b47d893cc6 (patch) | |
tree | be13eb2a0e4b291027167962b051b2bc479a8b45 | |
parent | cf8aac3eb49192400634db109cb9bd53f562d397 (diff) | |
download | meta-clang-f8904424faebf1018fd8c6b30a9cb8b47d893cc6.tar.gz |
Fix building ltp and logrotate with clang 12 (and gcc >= 10)
Modern compilers default to -fno-common -- fixing the way in which
multiply defined symbols are handled. Some code needs to be adapted.
Signed-off-by: Bernhard Rosenkränzer <bernhard.rosenkraenzer.ext@huawei.com>
-rw-r--r-- | recipes-extended/logrotate/logrotate/logrotate-3.15.1-fno-common.patch | 30 | ||||
-rw-r--r-- | recipes-extended/logrotate/logrotate_%.bbappend | 2 | ||||
-rw-r--r-- | recipes-extended/ltp/ltp_%.bbappend | 4 |
3 files changed, 36 insertions, 0 deletions
diff --git a/recipes-extended/logrotate/logrotate/logrotate-3.15.1-fno-common.patch b/recipes-extended/logrotate/logrotate/logrotate-3.15.1-fno-common.patch new file mode 100644 index 0000000..a5bb8de --- /dev/null +++ b/recipes-extended/logrotate/logrotate/logrotate-3.15.1-fno-common.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | This patch fixes building logrotate 3.15.1 with modern compilers | ||
2 | that default to -fno-common (such as clang >= 10, gcc >= 10) | ||
3 | |||
4 | Signed-off-by: Bernhard Rosenkraenzer <bernhard.rosenkraenzer.ext@huawei.com> | ||
5 | |||
6 | diff -up logrotate-3.15.1/logrotate.h.omv~ logrotate-3.15.1/logrotate.h | ||
7 | --- logrotate-3.15.1/logrotate.h.omv~ 2021-03-18 13:48:57.662529086 +0100 | ||
8 | +++ logrotate-3.15.1/logrotate.h 2021-03-18 13:49:28.983736070 +0100 | ||
9 | @@ -89,7 +89,8 @@ struct logInfo { | ||
10 | TAILQ_ENTRY(logInfo) list; | ||
11 | }; | ||
12 | |||
13 | -TAILQ_HEAD(logInfoHead, logInfo) logs; | ||
14 | +TAILQ_HEAD(logInfoHead, logInfo); | ||
15 | +extern struct logInfoHead logs; | ||
16 | |||
17 | extern int numLogs; | ||
18 | extern int debug; | ||
19 | diff -up logrotate-3.15.1/config.c.omv~ logrotate-3.15.1/config.c | ||
20 | --- logrotate-3.15.1/config.c.omv~ 2021-03-18 18:22:09.897571389 +0100 | ||
21 | +++ logrotate-3.15.1/config.c 2021-03-18 18:22:24.023660076 +0100 | ||
22 | @@ -32,6 +32,8 @@ | ||
23 | #include "log.h" | ||
24 | #include "logrotate.h" | ||
25 | |||
26 | +struct logInfoHead logs; | ||
27 | + | ||
28 | #if !defined(GLOB_ABORTED) && defined(GLOB_ABEND) | ||
29 | #define GLOB_ABORTED GLOB_ABEND | ||
30 | #endif | ||
diff --git a/recipes-extended/logrotate/logrotate_%.bbappend b/recipes-extended/logrotate/logrotate_%.bbappend new file mode 100644 index 0000000..884c4df --- /dev/null +++ b/recipes-extended/logrotate/logrotate_%.bbappend | |||
@@ -0,0 +1,2 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
2 | SRC_URI_append = " file://logrotate-3.15.1-fno-common.patch" | ||
diff --git a/recipes-extended/ltp/ltp_%.bbappend b/recipes-extended/ltp/ltp_%.bbappend new file mode 100644 index 0000000..e9ff911 --- /dev/null +++ b/recipes-extended/ltp/ltp_%.bbappend | |||
@@ -0,0 +1,4 @@ | |||
1 | # Old versions of ltp assume the compiler defaults to -fcommon | ||
2 | # This can be removed when moving to a newer version of ltp. | ||
3 | # The fix is also needed when building with gcc >= 10. | ||
4 | CFLAGS_append = " -fcommon" | ||