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
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:12:25:
 error: alignment for 'void faligned_2()' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:39:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:40:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:47:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:48:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:50:3:
 error: size of array 'Assert' is negative
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:52:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:52:3:
 error: size of array 'Assert' is negative
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:53:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:56:3:
 error: size of array 'Assert' is negative
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:58:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:59:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:59:3:
 error: size of array 'Assert' is negative

+FAIL: c-c++-common/builtin-has-attribute-3.c  -Wc++-compat  (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 'faligned_1' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:12:25:
 error: alignment for 'faligned_2' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:39:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:40:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:47:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:48:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:50:3:
 error: size of array 'Assert' is negative
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:52:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:52:3:
 error: size of array 'Assert' is negative
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:53:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:56:3:
 error: size of array 'Assert' is negative
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:58:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:59:3:
 error: alignment for '__builtin_has_attribute_tmp.' must be at least 4
/vol/gcc/src/hg/trunk/local/gcc/testsuite/c-c++-common/builtin-has-attribute-3.c:59:3:
 error: size of array 'Assert' is negative

+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

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.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to