bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: __builtin_mul_overflow_p support with llvm 5.0


From: Paul Eggert
Subject: Re: __builtin_mul_overflow_p support with llvm 5.0
Date: Mon, 30 Oct 2017 23:49:30 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Paul Eggert wrote:
Sorry, what's the context here?

Ah, I see it now, here:

https://github.com/coreutils/coreutils/issues/11

where Bernhard Rosenkränzer wrote:

"Our clang package is (intentionally) patched to return GNUC == 7 because clang 5.0 is closer to gcc 7.x than to any other version of gcc"

That's the problem. A goodly amount of GNU code assumes that if __GNUC__ is 5 then your compiler supports the features of GCC 5 or later, and similarly for other values of __GNUC__. Since your implementation of Clang does not support all relevant GCC 7 features, it should not define __GNUC__ to 7. So I suggest reverting the patch that you mentioned.

This problem is not limited to the two Gnulib modules that you mention: it's in several other places in GNU code. If you can't fix your compiler, you can work around the problem by running 'configure' with something like the following command:

./configure CC=clang CFLAGS='-U__GNUC__ -D__GNUC__=4'

Since you already are invoking 'configure' with special options, it shouldn't be much trouble to add another option to work around this problem with your compiler.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]