Opened 2 weeks ago

Closed 11 days ago

#60698 closed defect (fixed)

mod_gnutls: error: use of unknown builtin '__builtin_add_overflow'

Reported by: ryandesign (Ryan Schmidt) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: yosemite mavericks mountainlion lion Cc:
Port: mod_gnutls


mod_gnutls doesn't build on 10.7 thru 10.10 inclusive:

gnutls_sni.c:48:9: warning: implicit declaration of function 'bswap_16' is invalid in C99 [-Wimplicit-function-declaration]
    u = bswap_16(u);
gnutls_io.c:624:16: error: use of unknown builtin '__builtin_add_overflow' [-Wimplicit-function-declaration]
            && __builtin_add_overflow(readbytes, 0, &len))
gnutls_ocsp.c:476:9: error: use of unknown builtin '__builtin_add_overflow' [-Wimplicit-function-declaration]
    if (__builtin_add_overflow(fplen, 0, &fingerprint.size))
1 error generated.
make[1]: *** [mod_gnutls_la-gnutls_io.lo] Error 1

It does build on 10.6 using clang 9 so adding compiler.blacklist-append {clang < 800} could be one solution. However if the code can be fixed to work with old compilers that would be preferable.

Change History (4)

comment:1 Changed 2 weeks ago by Schamschula (Marius Schamschula)

The sqlite folks have run into the same issue. Their workaround actually goes in the other direction, i.e. don't blacklist any clang version:

comment:2 Changed 2 weeks ago by ryandesign (Ryan Schmidt)

Well. sqlite appears to have been using the clang version to decide which features are available, which is terrible; they should have been using __has_feature or something. And they were using open source clang numbers, not understanding that Apple has a different clang version numbering scheme.

If mod_gnutls is doing the same thing in their code, then indeed they should fix their code too. I don't think that's what they're doing though. Looking at their code briefly, they seem to assume that all clangs support __builtin_add_overflow, which evidently they don't.

comment:3 Changed 2 weeks ago by Schamschula (Marius Schamschula)

I haven't had time to check. I've been slightly distracted trying to get some of my standard tools to work on some central CA coast OS...

comment:4 Changed 11 days ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: assignedclosed

It looks like blacklisting compilers is the only option.

Note: See TracTickets for help on using tickets.