[Opendnssec-user] Compilation problems in 2.1.9
Fred. Zwarts
F.Zwarts at KVI.nl
Mon Jun 14 11:18:04 UTC 2021
Op 06.mei.2021 om 15:17 schreef Berry van Halderen via Opendnssec-user:
> On 2021-05-06 13:40, Fred. Zwarts via Opendnssec-user wrote:
>> From these errors I concluded that I had to add the "-std=c99" option
>> to the compiler, so I used:
>>
>> export CFLAGS="-std=c99"
>> ./configure
>> make clean
>> make
>>
>> But then another errors was printed:
>>
>>> ./wire/notify.h:64:21: error: field ‘timeout’ has incomplete type
>>> struct timespec timeout;
>>> ^
>>> Makefile:801: recipe for target 'daemon/signertasks.o' failed
>>> make[2]: *** [daemon/signertasks.o] Error 1
>>> make[2]: Leaving directory '/downloads/opendnssec-2.1.9/signer/src'
>>> Makefile:483: recipe for target 'all-recursive' failed
>>> make[1]: *** [all-recursive] Error 1
>>> make[1]: Leaving directory '/downloads/opendnssec-2.1.9/signer'
>>> Makefile:534: recipe for target 'all-recursive' failed
>>> make: *** [all-recursive] Error 1
>>
>>
>> I finally found a work-around with
>>
>> unset CFLAGS
>> ./configure
>> make clean
>> make
>>
>> Then, when the above error caused an exit of the make, I entered the
>> signer/src directory and I copied/pasted the latest gcc command shown,
>> adding the -std=c99 option. Then I returned to the main directory and
>> used "make" again, which continued to compile other source files. This
>> I had to do for about three source files.
>> I have the impression that I now have a working set of programs,
>> although I am a little bit worried having linked object files with
>> different compiler options.
>>
>> So, two questions:
>>
>> 1) Is there a way to use configure such that the compilation does not
>> end with errors?
>
> I think if you use
> -std=gnu11
That worked.
> in stead of -std=c11 or -std=c99 you are in the clear. So:
> CFLAGS=-std=gnu11 ./configure
We used this and it worked.
> This is caused because in some installation they use a compiler which
> supports c11,
> but do not have the erratum for c11 included.
>
>> 2) Is a mix of object files with and without the -std=c99 option
>> dangerous?
>
> I think the linking will fail in this specific case because one part
> assumes
> some names to be defined while the other doesn't include them. In
> general it
> is sometimes permissible, but I would avoid this.
>
> \Berry
Will this work-around be needed in future versions, or can you fix it in
the build procedure or the code?
More information about the Opendnssec-user
mailing list