-Qunused-arguments and clang

Niclas Zeising niclas.zeising at gmail.com
Tue Jun 28 21:33:33 UTC 2011


[Changing subject since previous was erroneous]

On 2011-06-28 23:10, Eric McCorkle wrote:
> On 6/28/11 4:06 PM, Niclas Zeising wrote:
>> On 2011-06-28 21:19, Pan Tsu wrote:
>>> Niclas Zeising<zeising at daemonic.se>  writes:
>>>
>>>> Sorry for hijacking this thread, and cross posting.
>>>>
>>>> On 2011-06-26 03:07, Gabor PALI wrote:
>>>>>
>>>>>
>>>>>> With Clang, an error occurs in one of the configure scripts, because
>>>>>> Clang warns about unused command-line arguments, and the configure
>>>>>> script assumes that to be a compiler error.  You can deal with
>>>>>> this by
>>>>>> adding -Qunused-parameter to CFLAGS.
>>>>>
>>>>> Thanks for investigating this.
>>>>>
>>>>
>>>> This should probably be made the default, at least for ports when clang
>>>> is compiled, since the output generated when not using
>>>> -Qunused-parameter confuses configure scripts, and stops at least
>>>> FireFox 5 from compiling, that I know of.
>>>
>>> Do you use ccache? Try without.
>>>
>>> For example, the combo confuses libtool
>>>
>>
>> It has nothing to do with cccache. The issue is that clang by default
>> warns when passed flags (-std= -f -W etc.) that's not used during the
>> compilation/linking. This can be silenced with -Qunused-arguments, and
>> if not, it confuses configure scripts that believe this is an error in
>> the code it uses to test for features.
>>
>> Regards!
> 
> Example: In the GHC port, the configure script tries to figure out
> whether the ISA supports PC-relative indexing.  It does this by
> generating a simple program, which contains some asm containing
> PC-relative indexing, compiling it, and seeing if the compiler generates
> a warning.  If clang warns about unused arguments, then the configure
> script assumes (falsely) that the ISA does not support PC-relative
> indexing, and generates bad assembly code, which causes trouble downstream.

Firefox 5 does similar things, but it's looking for pc relative
addressing instead, which is supported on my test system, although
without -Qunused-arguments the configure script thinks otherwise, and
generates bad asm.  I think that option should be added by default,
since this is a big difference from gcc, and bound to cause trouble in
several places.

Regards!
-- 
Niclas


More information about the freebsd-ports mailing list