Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syslog-ng v3.4.8 issue on solaris sparc 8 #174

Closed
lojha opened this issue Jul 28, 2014 · 6 comments
Closed

syslog-ng v3.4.8 issue on solaris sparc 8 #174

lojha opened this issue Jul 28, 2014 · 6 comments
Labels

Comments

@lojha
Copy link

lojha commented Jul 28, 2014

Attempting to compile syslog-ng v3.4.8 from source on solaris sparc 8 fails with

logsource.c: In function ‘log_source_msg_ack’:
logsource.c:85: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function)
logsource.c:85: error: (Each undeclared identifier is reported only once
logsource.c:85: error: for each function it appears in.)

@algernon algernon added the bug label Jul 28, 2014
@algernon
Copy link
Contributor

Can you try adding this line to the top of lib/logsource.c, below all the #include lines?

#ifndef CLOCK_MONOTONIC
#define CLOCK_MONOTONIC CLOCK_REALTIME
#endif

@lojha
Copy link
Author

lojha commented Jul 28, 2014

Thanks a lot for your quick response !!

That fixed the issue related to 'CLOCK_MONOTONIC'. but again it failed with below errors:

CCLD examples/amqp_bind
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_connection.o): In function amqp_d64': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference tontohll'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_connection.o): In function amqp_send_frame': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_connection.c:415: undefined reference tosend'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_connection.o): In function amqp_e64': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference tohtonll'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_framing.o): In function amqp_d64': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference tontohll'
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference to ntohll' /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference tontohll'
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference to ntohll' /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference tontohll'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_framing.o):/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: more undefined references to ntohll' follow librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_framing.o): In functionamqp_e64':
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference to htonll' /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference tohtonll'
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference to htonll' /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference tohtonll'
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference to htonll' librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_framing.o):/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: more undefined references tohtonll' follow
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_socket.o): In function amqp_open_socket': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:66: undefined reference togetaddrinfo'
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:79: undefined reference to socket' /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:93: undefined reference tosetsockopt'
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:107: undefined reference to freeaddrinfo' /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:93: undefined reference toconnect'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_socket.o): In function amqp_send_header': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:121: undefined reference tosend'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_socket.o): In function wait_frame_inner': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:211: undefined reference torecv'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_table.o): In function amqp_d64': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference tontohll'
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference to ntohll' librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_table.o): In functionamqp_e64':
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference to hton librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_table.o): In functionamqp_encode_field_value':
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference to hton librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_table.o): In functionamqp_e64':
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference to hton /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h:251: undefined reference tohton
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-socket.o): In function amqp_socket_socket': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/unix/socket.c:60: undefined reference tosocket
collect2: ld returned 1 exit status
make[6]: *** [examples/amqp_bind] Error 1
make[6]: Leaving directory `/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c'
make[5]: *** [all] Error 2

To get a workaround related to 'ntohll' added file 'modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h' as suggested in

http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2012-October/023165.html

#if defined(__sparc)
#define ntohll(x) (x)
#define htonll(x) (x)
#endif

that fixed complaining about 'ntohll' and 'htonll' but again failed with:

CCLD examples/amqp_bind
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_connection.o): In function amqp_send_frame': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_connection.c:415: undefined reference tosend'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_socket.o): In function amqp_open_socket': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:66: undefined reference togetaddrinfo'
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:79: undefined reference to socket' /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:93: undefined reference tosetsockopt'
/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:107: undefined reference to freeaddrinfo' /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:93: undefined reference toconnect'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_socket.o): In function amqp_send_header': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:121: undefined reference tosend'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-amqp_socket.o): In function wait_frame_inner': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:211: undefined reference torecv'
librabbitmq/.libs/librabbitmq.a(librabbitmq_librabbitmq_la-socket.o): In function amqp_socket_socket': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/unix/socket.c:60: undefined reference tosocket'
collect2: ld returned 1 exit status
make[6]: *** [examples/amqp_bind] Error 1
make[6]: Leaving directory /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c' make[5]: *** [all] Error 2 make[5]: Leaving directory/export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c'
make[4]: *** [all-recursive] Error 1

@algernon
Copy link
Contributor

That can also be fixed with forcing an -lsocket when linking librabbitmq-c, but... if you don't need the amqp destination, you can turn it off entirely with --disable-amqp passed to configure, and all of the above mess could be avoided that way.

If you need the amqp destination... well, the fix is a little bit more involved in that case.

@lojha
Copy link
Author

lojha commented Jul 29, 2014

what could be the fix......is it just commenting the line of code which has referenced symbol names??

for eg...if I comment line number 121 in amqp_socket.c....it is not complaining about this sysmbol.

amqp_send_header': /export/syslog/syslog-ng-3.4.8/modules/afamqp/rabbitmq-c/librabbitmq/amqp_socket.c:121: undefined reference tosend'

Also is it safe if we do modify the code like this way? will it impact any of syslog functionality ?

@algernon
Copy link
Contributor

If you want to be able to send to an AMQP broker, then yes, modifying the code this way would break that functionality. If not, it is easier to use --disable-amqp. The problem is that on Solaris, if you use network functions like socket, you need to link with -lsocket. The rabbitmq-c library syslog-ng bundles does not do that, hence your issues. Fixing that is a little bit problematic, as rabbitmq-c is not under our control.

Disabling AMQP will not impact the normal syslog functionality, though, so that's the easiest way.

Another way is to edit modules/afamqp/rabbitmq-c/Makefile.am, and add a line like AM_LDFLAGS = -lsocket -lnsl to it.

@lojha
Copy link
Author

lojha commented Jul 29, 2014

Thank you for prompt replies and solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants