[Buildroot] [PATCH] chrony: fix build with musl

Subsystems: the rest

4 messages, 2 authors, 2017-11-16 · open the first message on its own page

[Buildroot] [PATCH] chrony: fix build with musl

From: Baruch Siach <baruch@tkos.co.il>
Date: 2017-11-14 11:37:54

The SCM_TIMESTAMPING_PKTINFO macro is missing from the socket.h header
that musl libc provides as of version 1.1.16 that we currently use in
Buildroot. Patch the code to add this macro locally until we update
musl.

Fixes:
http://autobuild.buildroot.net/results/aab/aab3210d6d0c60fb07415d9bbdb09f2d4091446c/
http://autobuild.buildroot.net/results/fc8/fc8440db025f51c176240ca127bc68a367add21c/

Cc: Nathan Lynch <redacted>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 .../chrony/0001-ntp-fix-build-with-musl-libc.patch | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/chrony/0001-ntp-fix-build-with-musl-libc.patch
diff --git a/package/chrony/0001-ntp-fix-build-with-musl-libc.patch b/package/chrony/0001-ntp-fix-build-with-musl-libc.patch
new file mode 100644
index 000000000000..c927b343f754
--- /dev/null
+++ b/package/chrony/0001-ntp-fix-build-with-musl-libc.patch
@@ -0,0 +1,39 @@
+From 1e64bc4c4379ae3e55be3c518e0e3e22c8c4ae77 Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Tue, 14 Nov 2017 13:23:57 +0200
+Subject: [PATCH] ntp: fix build with musl libc
+
+The configure script enables HAVE_LINUX_TIMESTAMPING_OPT_PKTINFO based
+on the existence of struct scm_ts_pktinfo and
+SOF_TIMESTAMPING_OPT_PKTINFO that were introduced in Linux kernel v4.13
+in the linux/net_tstamp.h kernel header. But this feature also requires
+SCM_TIMESTAMPING_PKTINFO that is defined in the socket.h header. musl
+libc provides its own version of socket.h, and as of musl version 1.1.16
+this macro is missing. Define this macro in the code as a temporary
+measure until musl is updated to its latest version.
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+---
+Upstream status: not upstreamable
+---
+ ntp_io_linux.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ntp_io_linux.c b/ntp_io_linux.c
+index 00caed06f7ba..2214a6f6f6c5 100644
+--- a/ntp_io_linux.c
++++ b/ntp_io_linux.c
+@@ -574,6 +574,10 @@ extract_udp_data(unsigned char *msg, NTP_Remote_Address *remote_addr, int len)
+ 
+ /* ================================================== */
+ 
++#ifndef SCM_TIMESTAMPING_PKTINFO
++#define SCM_TIMESTAMPING_PKTINFO 58
++#endif
++
+ int
+ NIO_Linux_ProcessMessage(NTP_Remote_Address *remote_addr, NTP_Local_Address *local_addr,
+                          NTP_Local_Timestamp *local_ts, struct msghdr *hdr, int length)
+-- 
+2.15.0
+
-- 
2.15.0

[Buildroot] [PATCH] chrony: fix build with musl

From: Thomas Petazzoni <hidden>
Date: 2017-11-15 22:11:41

Hello,

On Tue, 14 Nov 2017 13:37:54 +0200, Baruch Siach wrote:
The SCM_TIMESTAMPING_PKTINFO macro is missing from the socket.h header
that musl libc provides as of version 1.1.16 that we currently use in
Buildroot. Patch the code to add this macro locally until we update
musl.

Fixes:
http://autobuild.buildroot.net/results/aab/aab3210d6d0c60fb07415d9bbdb09f2d4091446c/
http://autobuild.buildroot.net/results/fc8/fc8440db025f51c176240ca127bc68a367add21c/

Cc: Nathan Lynch <redacted>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 .../chrony/0001-ntp-fix-build-with-musl-libc.patch | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/chrony/0001-ntp-fix-build-with-musl-libc.patch
Applied to master, thanks. Is the problem fixed in upstream musl? If
not, did you report the problem?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[Buildroot] [PATCH] chrony: fix build with musl

From: Baruch Siach <baruch@tkos.co.il>
Date: 2017-11-16 04:01:30

Hi Thomas,

On Wed, Nov 15, 2017 at 11:11:41PM +0100, Thomas Petazzoni wrote:
On Tue, 14 Nov 2017 13:37:54 +0200, Baruch Siach wrote:
quoted
The SCM_TIMESTAMPING_PKTINFO macro is missing from the socket.h header
that musl libc provides as of version 1.1.16 that we currently use in
Buildroot. Patch the code to add this macro locally until we update
musl.

Fixes:
http://autobuild.buildroot.net/results/aab/aab3210d6d0c60fb07415d9bbdb09f2d4091446c/
http://autobuild.buildroot.net/results/fc8/fc8440db025f51c176240ca127bc68a367add21c/

Cc: Nathan Lynch <redacted>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 .../chrony/0001-ntp-fix-build-with-musl-libc.patch | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/chrony/0001-ntp-fix-build-with-musl-libc.patch
Applied to master, thanks. Is the problem fixed in upstream musl? If
not, did you report the problem?
musl version 1.1.18 defines the SCM_TIMESTAMPING_PKTINFO macro. So once we 
bump musl and rebuild the toolchain, we can remove this patch.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

[Buildroot] [PATCH] chrony: fix build with musl

From: Thomas Petazzoni <hidden>
Date: 2017-11-16 07:46:19

Hello,

On Thu, 16 Nov 2017 06:01:30 +0200, Baruch Siach wrote:
quoted
quoted
 .../chrony/0001-ntp-fix-build-with-musl-libc.patch | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/chrony/0001-ntp-fix-build-with-musl-libc.patch  
Applied to master, thanks. Is the problem fixed in upstream musl? If
not, did you report the problem?  
musl version 1.1.18 defines the SCM_TIMESTAMPING_PKTINFO macro. So once we 
bump musl and rebuild the toolchain, we can remove this patch.
OK, thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help