Skip to contentSkip to conversation

syslog-ng: Link against librt

PATCH New Chris Packham 2 participants 6 messages Oct 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syslog-ng: Link against librt

Some of the rabbit-mq tools need to link against librt, specify LIBS=-lrt when configuring.

Fixes:
http://autobuild.buildroot.net/results/a3d/a3dfdebd76d47df11a8e26a215bb88fbce8dc6f7
http://autobuild.buildroot.net/results/7d2/7d26e8efe67bf958162a309acb20800e669543e4
http://autobuild.buildroot.net/results/7b5/7b5370d12a2ff8937cba3a201d4edce3dcd12a6e
http://autobuild.buildroot.net/results/bab/babbb089ce1a7750495323248f21402960fb6c80

---
 package/syslog-ng/syslog-ng.mk | 2 ++
 1 file changed, 2 insertions(+)
package/syslog-ng/syslog-ng.mk +2 -0
index 1ade7cf..3441751 100644
@@ -11,6 +11,8 @@ SYSLOG_NG_LICENSE = LGPLv2.1+ (syslog-ng core), GPLv2+ (modules)
 SYSLOG_NG_LICENSE_FILES = COPYING
 SYSLOG_NG_DEPENDENCIES = host-bison host-flex host-pkgconf \
 	eventlog libglib2 openssl pcre
+# rabbit-mq needs -lrt
+SYSLOG_NG_CONF_ENV = LIBS=-lrt
 SYSLOG_NG_CONF_OPTS = --disable-manpages
 SYSLOG_NG_PATCH = \
 	https://github.com/dnsjts/syslog-ng/commit/7b2b673ae2640ce9ad396f538fc25acb6e4405ec.patch \
Signature · 1 line
2.5.3
#1 lore raw

PATCH 1/1 syslog-ng: Link against librt

Dear Chris Packham,

package/syslog-ng/syslog-ng.mk SYSLOG_NG_LICENSE = LGPLv2.1+ (syslog-ng core), GPLv2+ (modules) · line 15

Quoted 2 lines · Chris Packham
package/syslog-ng/syslog-ng.mk +2 -0
+# rabbit-mq needs -lrt
+SYSLOG_NG_CONF_ENV = LIBS=-lrt

While this works, I believe a better solution is to fix the configure.ac. It already checks if nanosleep is in librt, and if so, links against librt.

It should the same for those functions, if the rabbitmq support is enabled.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 syslog-ng: Link against librt

Hi Thomas,

Quoted 11 lines · Thomas Petazzoni

Dear Chris Packham,

package/syslog-ng/syslog-ng.mk SYSLOG_NG_LICENSE = LGPLv2.1+ (syslog-ng core), GPLv2+ (modules) · line 15

Quoted 2 lines · Chris Packham
package/syslog-ng/syslog-ng.mk +2 -0
+# rabbit-mq needs -lrt
+SYSLOG_NG_CONF_ENV = LIBS=-lrt

While this works, I believe a better solution is to fix the configure.ac. It already checks if nanosleep is in librt, and if so, links against librt.

Quoted 2 lines

It should the same for those functions, if the rabbitmq support is enabled.

Hmm. Syslog-ng distributes rabbitmq-c as a sub package. The looking at included rabbitmq-c sources and the upstream package[1] it is checking for clock_gettime which it thinks it should find in librt. But looking at the config.log[2] for rabbitmq-c it has decided that no library is required. Is there something unexpected about clock_gettime with uclibc?

[1] - https://github.com/alanxz/rabbitmq-c/blob/master/configure.ac#L104
[2] - http://autobuild.buildroot.net/results/a3d/a3dfdebd76d47df11a8e26a215bb88fbce8dc6f7/syslog-ng-3.7.1/modules/afamqp/rabbitmq-c/config.log

Quoted 8 lines

Thanks!

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

#3 lore raw

PATCH 1/1 syslog-ng: Link against librt

Quoted 25 lines · Chris Packham

Hi Thomas,

Quoted 11 lines · Thomas Petazzoni

Dear Chris Packham,

package/syslog-ng/syslog-ng.mk SYSLOG_NG_LICENSE = LGPLv2.1+ (syslog-ng core), GPLv2+ (modules) · line 15

Quoted 2 lines · Chris Packham
package/syslog-ng/syslog-ng.mk +2 -0
+# rabbit-mq needs -lrt
+SYSLOG_NG_CONF_ENV = LIBS=-lrt

While this works, I believe a better solution is to fix the configure.ac. It already checks if nanosleep is in librt, and if so, links against librt.

Quoted 2 lines

It should the same for those functions, if the rabbitmq support is enabled.

Hmm. Syslog-ng distributes rabbitmq-c as a sub package. The looking at included rabbitmq-c sources and the upstream package[1] it is checking for clock_gettime which it thinks it should find in librt. But looking at the config.log[2] for rabbitmq-c it has decided that no library is required. Is there something unexpected about clock_gettime with uclibc?

Quoted 3 lines

[1] - https://github.com/alanxz/rabbitmq-c/blob/master/configure.ac#L104
[2] - http://autobuild.buildroot.net/results/a3d/a3dfdebd76d47df11a8e26a215bb88fbce8dc6f7/syslog-ng-3.7.1/modules/afamqp/rabbitmq-c/config.log

Digging a bit deeper it looks like clock_gettime is in both libc and librt. According to the (glibc) man page -lrt was needed prior to glibc 2.17 so I'm guessing this is some kind of backwards compatibility check that would happen to satisfy the posix_spawn requirements. I'll see about an upstream patch to rabbitmq-c.

Quoted 8 lines
Quoted 8 lines

Thanks!

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

#4 lore raw

PATCH 1/1 syslog-ng: Link against librt

Quoted 30 lines · Chris Packham
Quoted 25 lines · Chris Packham

Hi Thomas,

Quoted 11 lines · Thomas Petazzoni

Dear Chris Packham,

package/syslog-ng/syslog-ng.mk SYSLOG_NG_LICENSE = LGPLv2.1+ (syslog-ng core), GPLv2+ (modules) · line 15

Quoted 2 lines · Chris Packham
package/syslog-ng/syslog-ng.mk +2 -0
+# rabbit-mq needs -lrt
+SYSLOG_NG_CONF_ENV = LIBS=-lrt

While this works, I believe a better solution is to fix the configure.ac. It already checks if nanosleep is in librt, and if so, links against librt.

Quoted 2 lines

It should the same for those functions, if the rabbitmq support is enabled.

Hmm. Syslog-ng distributes rabbitmq-c as a sub package. The looking at included rabbitmq-c sources and the upstream package[1] it is checking for clock_gettime which it thinks it should find in librt. But looking at the config.log[2] for rabbitmq-c it has decided that no library is required. Is there something unexpected about clock_gettime with uclibc?

Quoted 3 lines

[1] - https://github.com/alanxz/rabbitmq-c/blob/master/configure.ac#L104
[2] - http://autobuild.buildroot.net/results/a3d/a3dfdebd76d47df11a8e26a215bb88fbce8dc6f7/syslog-ng-3.7.1/modules/afamqp/rabbitmq-c/config.log

Quoted 6 lines

Digging a bit deeper it looks like clock_gettime is in both libc and librt. According to the (glibc) man page -lrt was needed prior to glibc 2.17 so I'm guessing this is some kind of backwards compatibility check that would happen to satisfy the posix_spawn requirements. I'll see about an upstream patch to rabbitmq-c.

And here's a link to the pull request
https://github.com/alanxz/rabbitmq-c/pull/322

#5 lore raw

PATCH 1/1 syslog-ng: Link against librt

In reply to Chris Packham

Dear Chris Packham,

Quoted 9 lines · Chris Packham

Some of the rabbit-mq tools need to link against librt, specify LIBS=-lrt when configuring.

Fixes:
http://autobuild.buildroot.net/results/a3d/a3dfdebd76d47df11a8e26a215bb88fbce8dc6f7
http://autobuild.buildroot.net/results/7d2/7d26e8efe67bf958162a309acb20800e669543e4
http://autobuild.buildroot.net/results/7b5/7b5370d12a2ff8937cba3a201d4edce3dcd12a6e
http://autobuild.buildroot.net/results/bab/babbb089ce1a7750495323248f21402960fb6c80

Quoted 5 lines
---
 package/syslog-ng/syslog-ng.mk | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks. I still think a better fix would be to change configure.ac, and submit the change upstream.

Thomas

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