[PATCH] add simple attribute introspection
Martin Sebor
msebor@gmail.com
Sun Nov 25 20:40:00 GMT 2018
On 11/25/18 7:11 AM, Rainer Orth wrote:
> Hi Martin,
>
>>> I'm seeing the same on sparc-sun-solaris2.11, plus
>>>
>>> +FAIL: c-c++-common/builtin-has-attribute-3.c -std=gnu++14 (test for
>>> excess errors)
>>> +FAIL: c-c++-common/builtin-has-attribute-3.c -std=gnu++17 (test for
>>> excess errors)
>>> +FAIL: c-c++-common/builtin-has-attribute-3.c -std=gnu++98 (test for
>>> excess errors)
>>
>> I see these errors with my sparc-sun-solaris2.11 cross-compiler:
>>
>> /ssd/src/gcc/svn/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:197:3:
>> error: constructor priorities are not supported
>>
>> Apparently the sparc-sun-solaris2.11 target doesn't like ctor and
>> dtor priorities. The error comes from here:
> [...]
>> The manual doesn't mention anything about this. It makes it sound
>> like ctor/dtor priorities are supported everywhere.
>
> They're not, obviously, and we do have an effective-target keyword for
> this: init_priority.
>
>> Does Solaris really not support these even with Binutils? If not,
>> I'll adjust the test (and the manual to make it clear the attribute
>> isn't supported everywhere).
>
> The test is in gcc/configure.ac (gcc_AC_INITFINI_ARRAY), defined in
> acinclude.m4. It requires not only target binutils, but also target
> headers to work; however, you can override it with
> --enable-initfini-array. You may have pass the same option when
> configuring binutils at least on Solaris/SPARC (don't remember the
> details offhand).
>
> However, that wasn't the problem in the Solaris 11.4+ results I reported:
> it *does* support constructor priority even with as/ld and the failures
> have nothing to do with that issue. Here are the errors/warnings I'm
> seeing:
>
> +FAIL: c-c++-common/builtin-has-attribute-3.c -std=gnu++14 (test for excess errors)
> +FAIL: c-c++-common/builtin-has-attribute-3.c -std=gnu++17 (test for excess errors)
> +FAIL: c-c++-common/builtin-has-attribute-3.c -std=gnu++98 (test for excess errors)
>
> Excess errors:
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:11:25: error: alignment for 'void faligned_1()' must be at least 4
Right, these are the same issue as those noted by Christophe on
aarch64 and arm. I mentioned this issue in my question to
the gcc list: https://gcc.gnu.org/ml/gcc/2018-11/msg00127.html
I have a patch to let GCC accept less restrictive alignments that
I plan to submit (unless someone knows of a reason that makes
rejecting this code is necessary).
> +FAIL: gcc.dg/builtin-has-attribute.c (test for excess errors)
>
> Excess errors:
> /vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/builtin-has-attribute.c:12:15: error: size of array 'Assert' is negative
>
> +UNRESOLVED: gcc.dg/builtin-has-attribute.c compilation failed to produce executable
This one also affects other targets. I explained what causes
it in my response here:
https://gcc.gnu.org/ml/gcc-patches/2018-11/msg02013.html
Fixing it will need a small tweak to the builtin. I'll take
care of it this week.
>
> The error about missing construcot priority support does occur, however,
> on Solaris 10 up to 11.3 with ld, in addition to the ones above.
>
> As for the test, it would be best to split it into two: one for the bulk
> that doesn't need constructor priority support and can work everywhere,
> and another smaller one for the rest, guarded by
> dg-require-effective-target init_priority.
I agree. I'll take care of this as well this week.
Martin
More information about the Gcc-patches
mailing list