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

fix build on SmartOS #1186

Merged
merged 1 commit into from
Apr 21, 2017
Merged

Conversation

misterdjules
Copy link
Contributor

SmartOS is a derivative of Illumos, itself a derivative of Solaris. Building librdkafka's master branch on a 15.4 image of SmartOS failed with the following error:

[root@e31d952d-043b-4188-e3fa-9ae120820740 /var/tmp/gh-repos/librdkafka]# make -j 6
make[1]: Entering directory '/var/tmp/gh-repos/librdkafka/src'
gcc -MD -MP -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D__EXTENSIONS__ -DLIBRDKAFKA_GIT_VERSION="\"v0.9.4-132-g386516-dirty\""  -c rdkafka.c -o rdkafka.o
gcc -MD -MP -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D__EXTENSIONS__ -DLIBRDKAFKA_GIT_VERSION="\"v0.9.4-132-g386516-dirty\""  -c rdkafka_broker.c -o rdkafka_broker.o
gcc -MD -MP -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D__EXTENSIONS__ -DLIBRDKAFKA_GIT_VERSION="\"v0.9.4-132-g386516-dirty\""  -c rdkafka_msg.c -o rdkafka_msg.o
gcc -MD -MP -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D__EXTENSIONS__ -DLIBRDKAFKA_GIT_VERSION="\"v0.9.4-132-g386516-dirty\""  -c rdkafka_topic.c -o rdkafka_topic.o
In file included from /usr/include/stdio.h:37:0,
                 from rd.h:43,
                 from rdkafka_msg.c:29:
/usr/include/sys/feature_tests.h:400:2: error: #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications       require the use of c99"
 #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \
  ^
gcc -MD -MP -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D__EXTENSIONS__ -DLIBRDKAFKA_GIT_VERSION="\"v0.9.4-132-g386516-dirty\""  -c rdkafka_conf.c -o rdkafka_conf.o
In file included from /usr/include/stdio.h:37:0,
                 from rd.h:43,
                 from rdkafka_topic.c:29:
/usr/include/sys/feature_tests.h:400:2: error: #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications       require the use of c99"
 #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \
  ^
gcc -MD -MP -g -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D__EXTENSIONS__ -DLIBRDKAFKA_GIT_VERSION="\"v0.9.4-132-g386516-dirty\""  -c rdkafka_timer.c -o rdkafka_timer.o
../mklove/Makefile.base:77: recipe for target 'rdkafka_msg.o' failed
make[1]: *** [rdkafka_msg.o] Error 1
make[1]: *** Waiting for unfinished jobs....
../mklove/Makefile.base:77: recipe for target 'rdkafka_topic.o' failed
make[1]: *** [rdkafka_topic.o] Error 1
make[1]: Leaving directory '/var/tmp/gh-repos/librdkafka/src'
Makefile:20: recipe for target 'libs' failed
make: *** [libs] Error 2
[root@e31d952d-043b-4188-e3fa-9ae120820740 /var/tmp/gh-repos/librdkafka]#

The changes in this PR allows users of SmartOS to build librdkafka without any error.

@edenhill
Copy link
Contributor

Looks good to me.
@rthalley can you have a look as well?

@rthalley
Copy link
Contributor

I'm OK with those changes. We always use a compiler in c99 mode and we also remove the define for _XOPEN_SOURCE

@edenhill edenhill merged commit 90efd24 into confluentinc:master Apr 21, 2017
@edenhill
Copy link
Contributor

Thanks!

@misterdjules
Copy link
Contributor Author

@rthalley

Just to make sure that I understand correctly, when you mentioned:

We always use a compiler in c99 mode and we also remove the define for _XOPEN_SOURCE

Do you mean in librdkafka's source? If so, where is that done?

Thank you very much @edenhill and @rthalley for considering these changes and merging them!

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

Successfully merging this pull request may close these issues.

3 participants