rsyslog: fixes musl libc build
PATCH 1/1 rsyslog: fixes musl libc build
From: Ming Liu <[email protected]>
- struct timeval is defined in sys/time.h with a musl libc.
- GLOB_BRACE is not defined in posix and thus not implemented in musl libc.
--- .../rsyslog/rsyslog/0001-Include-sys-time-h.patch | 33 ++++++++++++++++++++ .../rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch | 35 ++++++++++++++++++++++ meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb | 5 ++++ 3 files changed, 73 insertions(+) create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch
meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 3c3c21f4735eb215206273bc714c57c969926d3d Mon Sep 17 00:00:00 2001 +From: Ming Liu <[email protected]> +Date: Sun, 26 Feb 2017 14:10:21 +0100 +Subject: [PATCH] Include sys/time.h + +struct timeval is defined in sys/time.h with a musl libc. + +Upstream-Status: Inappropriate [musl libc specific] + +Signed-off-by: Ming Liu <[email protected]> +--- + tests/msleep.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/tests/msleep.c b/tests/msleep.c +index 26a8206..ca818be 100644 +--- a/tests/msleep.c ++++ b/tests/msleep.c +@@ -26,11 +26,7 @@ + #include "config.h" + #include <stdio.h> + #include <stdlib.h> +-#if defined(__FreeBSD__) + #include <sys/time.h> +-#else +-#include <time.h> +-#endif + + int main(int argc, char *argv[]) + { +-- +1.9.1 +
meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 6746e3a9615d1566bf228e9012d0841b15178810 Mon Sep 17 00:00:00 2001 +From: Ming Liu <[email protected]> +Date: Sun, 26 Feb 2017 13:50:33 +0100 +Subject: [PATCH] Undefine GLOB_BRACE + +GLOB_BRACE is not defined in posix and thus not implemented in musl libc. + +Fixed by defining it to 0 if it is undefined. + +Upstream-Status: Inappropriate [musl libc specific] + +Signed-off-by: Ming Liu <[email protected]> +--- + plugins/imfile/imfile.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c +index d20471f..f9aff81 100644 +--- a/plugins/imfile/imfile.c ++++ b/plugins/imfile/imfile.c +@@ -85,6 +85,11 @@ static int bLegacyCnfModGlobalsPermitted;/* are legacy module-global config para + + #define ADD_METADATA_UNSPECIFIED -1 + ++/* fixes build with musl libc */ ++#ifndef GLOB_BRACE ++#define GLOB_BRACE 0 ++#endif ++ + /* this structure is used in pure polling mode as well one of the support + * structures for inotify. + */ +-- +1.9.1 +
meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +5 -0
@@ -26,6 +26,11 @@ SRC_URI = "http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.t file://rsyslog-fix-ptest-not-finish.patch \ " +SRC_URI_append_libc-musl = " \ + file://0001-Undefine-GLOB_BRACE.patch \ + file://0001-Include-sys-time-h.patch \ +" + SRC_URI[md5sum] = "ad0f25f429aa2daa326732950a5eeb6c" SRC_URI[sha256sum] = "06e2884181333dccecceaca82827ae24ca7a258b4fbf7b1e07a80d4caae640ca"
Signature · 1 line
1.9.1
Quoted 112 lines · On Tue, Mar 7, 2017 at 3:10 AM <[email protected]> wrote:
From: Ming Liu <[email protected]>
- struct timeval is defined in
sys/time.hwith a musl libc.
-GLOB_BRACEis not defined in posix and thus not implemented in musl libc.Signed-off-by Ming Liu <[email protected]>--- .../rsyslog/rsyslog/0001-Include-sys-time-h.patch | 33 ++++++++++++++++++++ .../rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch | 35 ++++++++++++++++++++++ meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb | 5 ++++ 3 files changed, 73 insertions(+) create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch create mode 100644
meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patchdiff --git
a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patchb/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patchnew file mode 100644
index 0000000..23c0f25
---/dev/null
+++b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patchmeta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch new file +33
-0@@ -0,0 +1,33 @@ +From 3c3c21f4735eb215206273bc714c57c969926d3d Mon Sep 17 00:00:00 2001 +From: Ming Liu <[email protected]> +Date: Sun, 26 Feb 2017 14:10:21 +0100 +Subject: [PATCH] Include sys/time.h + +struct timeval is defined in sys/time.h with a musl libc. + +Upstream-Status: Inappropriate [musl libc specific] + +Signed-off-by: Ming Liu <[email protected]> +--- + tests/msleep.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/tests/msleep.c b/tests/msleep.c +index 26a8206..ca818be 100644 +--- a/tests/msleep.c ++++ b/tests/msleep.c +@@ -26,11 +26,7 @@ + #include "config.h" + #include <stdio.h> + #include <stdlib.h> +-#if defined(__FreeBSD__) + #include <sys/time.h> +-#else +-#include <time.h> +-#endif + + int main(int argc, char *argv[]) + { +-- +1.9.1 +diff --git
a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patchb/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patchnew file mode 100644
index 0000000..7903bb1
---/dev/null
+++b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patchmeta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch new file +21
-0@@ -0,0 +1,35 @@ +From 6746e3a9615d1566bf228e9012d0841b15178810 Mon Sep 17 00:00:00 2001 +From: Ming Liu <[email protected]> +Date: Sun, 26 Feb 2017 13:50:33 +0100 +Subject: [PATCH] Undefine GLOB_BRACE + +GLOB_BRACE is not defined in posix and thus not implemented in musl libc. + +Fixed by defining it to 0 if it is undefined. + +Upstream-Status: Inappropriate [musl libc specific] + +Signed-off-by: Ming Liu <[email protected]> +--- + plugins/imfile/imfile.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c +index d20471f..f9aff81 100644 +--- a/plugins/imfile/imfile.c ++++ b/plugins/imfile/imfile.c +@@ -85,6 +85,11 @@ static int bLegacyCnfModGlobalsPermitted;/* are legacymodule-global config para
meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch new file +14
-0+ + #define ADD_METADATA_UNSPECIFIED -1 + ++/* fixes build with musl libc */ ++#ifndef GLOB_BRACE ++#define GLOB_BRACE 0 ++#endif ++ + /* this structure is used in pure polling mode as well one of the support + * structures for inotify. + */ +-- +1.9.1 +meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +0
-0@@ -26,6 +26,11 @@ SRC_URI = "http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.t
Quoted 4 lines
file://rsyslog-fix-ptest-not-finish.patch \"
+SRC_URI_append_libc-musl = " \
Do they have to be applied conditionally?
I would suggest to make it portable across All libc
Quoted 18 lines
meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +4
-0+ file://0001-Undefine-GLOB_BRACE.patch \ + file://0001-Include-sys-time-h.patch \ +" + SRC_URI[md5sum] = "ad0f25f429aa2daa326732950a5eeb6c" SRC_URI[sha256sum] ="
06e2884181333dccecceaca82827ae24ca7a258b4fbf7b1e07a80d4caae640ca"--
1.9.1--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
A message that is not in the archive (sent off-list or not yet received): VI1PR0301MB191902ED0C0BB1DB7F1F1F36E32E0@VI1PR0301MB1919.eurprd03.prod.outlook.com
Quoted 132 lines · Peter Liu
From: Khem Raj <[email protected]>
Sent: Wednesday, March 8, 2017 12:54:27 AM
To: [email protected]; [email protected]
Cc: Peter Liu
Subject: Re: [oe] [meta-oe] [PATCH] rsyslog: fixes musl libc buildQuoted 115 lines · On Tue, Mar 7, 2017 at 3:10 AM <[email protected]> wrote:
From: Ming Liu <[email protected]>
- struct timeval is defined in
sys/time.hwith a musl libc.
-GLOB_BRACEis not defined in posix and thus not implemented in musl libc.Signed-off-by Ming Liu <[email protected]>--- .../rsyslog/rsyslog/0001-Include-sys-time-h.patch | 33 ++++++++++++++++++++ .../rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch | 35 ++++++++++++++++++++++ meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb | 5 ++++ 3 files changed, 73 insertions(+) create mode 100644 meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch create mode 100644
meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patchdiff --git
a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patchb/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patchnew file mode 100644
index 0000000..23c0f25
---/dev/null
+++b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patchmeta-oe/recipes-extended/rsyslog/rsyslog/0001-Include-sys-time-h.patch new file +33
-0@@ -0,0 +1,33 @@ +From 3c3c21f4735eb215206273bc714c57c969926d3d Mon Sep 17 00:00:00 2001 +From: Ming Liu <[email protected]> +Date: Sun, 26 Feb 2017 14:10:21 +0100 +Subject: [PATCH] Include sys/time.h + +struct timeval is defined in sys/time.h with a musl libc. + +Upstream-Status: Inappropriate [musl libc specific] + +Signed-off-by: Ming Liu <[email protected]> +--- + tests/msleep.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/tests/msleep.c b/tests/msleep.c +index 26a8206..ca818be 100644 +--- a/tests/msleep.c ++++ b/tests/msleep.c +@@ -26,11 +26,7 @@ + #include "config.h" + #include <stdio.h> + #include <stdlib.h> +-#if defined(__FreeBSD__) + #include <sys/time.h> +-#else +-#include <time.h> +-#endif + + int main(int argc, char *argv[]) + { +-- +1.9.1 +diff --git
a/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patchb/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patchnew file mode 100644
index 0000000..7903bb1
---/dev/null
+++b/meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patchmeta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch new file +21
-0@@ -0,0 +1,35 @@ +From 6746e3a9615d1566bf228e9012d0841b15178810 Mon Sep 17 00:00:00 2001 +From: Ming Liu <[email protected]> +Date: Sun, 26 Feb 2017 13:50:33 +0100 +Subject: [PATCH] Undefine GLOB_BRACE + +GLOB_BRACE is not defined in posix and thus not implemented in musl libc. + +Fixed by defining it to 0 if it is undefined. + +Upstream-Status: Inappropriate [musl libc specific] + +Signed-off-by: Ming Liu <[email protected]> +--- + plugins/imfile/imfile.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c +index d20471f..f9aff81 100644 +--- a/plugins/imfile/imfile.c ++++ b/plugins/imfile/imfile.c +@@ -85,6 +85,11 @@ static int bLegacyCnfModGlobalsPermitted;/* are legacymodule-global config para
meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch new file +9
-0+ + #define ADD_METADATA_UNSPECIFIED -1 + ++/* fixes build with musl libc */ ++#ifndef GLOB_BRACE ++#define GLOB_BRACE 0 ++#endif ++ + /* this structure is used in pure polling mode as well one of thesupport
meta-oe/recipes-extended/rsyslog/rsyslog/0001-Undefine-GLOB_BRACE.patch new file +5
-0+ * structures for inotify. + */ +-- +1.9.1 +meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +0
-0@@ -26,6 +26,11 @@ SRC_URI ="http://www.rsyslog.com/download/files/download/rsyslog/${BPN}-${PV}.t
Quoted 4 lines
file://rsyslog-fix-ptest-not-finish.patch \"
+SRC_URI_append_libc-musl = " \
Do they have to be applied conditionally?
I would suggest to make it portable across All libc
Quoted 3 lines
OK, attempt to say that the changes would not cause problems in glibc as well, although glibc does not have the problem, will verify it and send a V2.
glibc wont have issues without patch sure. However making the patch apply unconditionally makes maintaining easier.