2014-10-02 12:01 GMT+02:00 Olaf <[email protected]>:

> Hi,
>
>  We have just released 7.6.6 of the v7-stable branch.
>>
>
>
> I've got a build error in 7.6.6:
>
>
> make[4]: Entering directory `/usr/src/rsyslog-7.6.6/grammar'
> /bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
> -I..  -I../runtime -I.. -I../grammar  -I/usr/include/json-c  -W -Wall
> -Wformat-security -Wshadow -Wcast-align -Wpointer-arith
> -Wmissing-format-attribute -g   -Os -march=i486 -mtune=pentium -pipe
> -fomit-frame-pointer -MT libgrammar_la-grammar.lo -MD -MP -MF
> .deps/libgrammar_la-grammar.Tpo -c -o libgrammar_la-grammar.lo `test -f
> 'grammar.c' || echo './'`grammar.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I../runtime -I..
> -I../grammar -I/usr/include/json-c -W -Wall -Wformat-security -Wshadow
> -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g -Os -march=i486
> -mtune=pentium -pipe -fomit-frame-pointer -MT libgrammar_la-grammar.lo -MD
> -MP -MF .deps/libgrammar_la-grammar.Tpo -c grammar.c  -fPIC -DPIC -o
> .libs/libgrammar_la-grammar.o
> mv -f .deps/libgrammar_la-grammar.Tpo .deps/libgrammar_la-grammar.Plo
> /bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
> -I..  -I../runtime -I.. -I../grammar  -I/usr/include/json-c  -W -Wall
> -Wformat-security -Wshadow -Wcast-align -Wpointer-arith
> -Wmissing-format-attribute -g   -Os -march=i486 -mtune=pentium -pipe
> -fomit-frame-pointer -MT libgrammar_la-lexer.lo -MD -MP -MF
> .deps/libgrammar_la-lexer.Tpo -c -o libgrammar_la-lexer.lo `test -f
> 'lexer.c' || echo './'`lexer.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I../runtime -I..
> -I../grammar -I/usr/include/json-c -W -Wall -Wformat-security -Wshadow
> -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g -Os -march=i486
> -mtune=pentium -pipe -fomit-frame-pointer -MT libgrammar_la-lexer.lo -MD
> -MP -MF .deps/libgrammar_la-lexer.Tpo -c lexer.c  -fPIC -DPIC -o
> .libs/libgrammar_la-lexer.o
> lexer.l:34: error: conflicting types for 'strdup'
> make[4]: *** [libgrammar_la-lexer.lo] Error 1
> make[4]: Leaving directory `/usr/src/rsyslog-7.6.6/grammar'
>
>
> offending line seems line 1462 in lexer.c:
>  extern char *strdup(char*); /* somehow we do not get this from
> string.h... */
>
> If I drop that line build is OK.
> My string.h does have strdup, but defined as: extern char *strdup(__const
> char*);
>

Yeah, I banged my head on this for many hours before I finally gave up. I
have some build environments where string.h contains what is needed, but
even if I explicitly include it, the prototype is not there! On 64 bit
systems, that can lead to a segfault (acutally, this was the problem we
sawn with 7.6.5 on CENTOS). Again, I never found an explanation, and I
would still like to get one...

Following patch also works:
>
> diff --git a/grammar/lexer.l b/grammar/lexer.l
> index 796815c..4da4b8d 100644
> --- a/grammar/lexer.l
> +++ b/grammar/lexer.l
> @@ -31,7 +31,7 @@
>  %{
>  #include "config.h"
>  #include "parserif.h"
> -extern char *strdup(char*); /* somehow we do not get this from
> string.h... */
> +extern char *strdup(__const char*); /* somehow we may not get this from
> string.h... */
>  %}
>
>  %option noyywrap nodefault case-insensitive yylineno
>
>
Thanks, that was right in time. I had finalized a new build and could just
sneak it in (announcement will follow in a few minutes).


>
> But I do not know if that matches all variants of strdup that may be out
> there.
>
>
At least on the Fedora, openSuse, Ubuntu (thus Debian) I had quickly at
hand it worked. Which platform did you use?

Thanks again,
Rainer


> FWIW 7.6.3 builds OK, have not tried 7.6.4/5
>
>
>
> Olaf
>
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
> What's up with rsyslog? Follow https://twitter.com/rgerhards
> NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad
> of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you
> DON'T LIKE THAT.
>
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to