https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98171
Bug ID: 98171 Summary: adaint.c doesn't compile on AIX 7.2 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: ro at gcc dot gnu.org CC: charlet at gcc dot gnu.org, dje at gcc dot gnu.org Target Milestone: --- Host: powerpc-ibm-aix7.2.0.0 Target: powerpc-ibm-aix7.2.0.0 Build: powerpc-ibm-aix7.2.0.0 I recently tried building master on AIX 7.2 in the cfarm (gcc119) with --enable-languages=all and a self-compiled gcc 8.4.0 as bootstrap compiler. This already failed in stage 1 compiling adaint.c: /home/ro/gcc/src/gcc-master/gcc/ada/adaint.c: In function 'int __gnat_copy_attri bs(char*, char*, int)': /home/ro/gcc/src/gcc-master/gcc/ada/adaint.c:3289:21: error: no match for 'opera tor=' (operand types are 'timespec' and 'st_timespec_t' {aka 'st_timespec'}) tbuf[0] = fbuf.st_atim; ^~~~~~~ In file included from /usr/include/sys/resource.h:57, from /home/ro/gcc/8/lib/gcc/powerpc-ibm-aix7.2.0.0/8.4.0/includ e-fixed/sys/wait.h:56, from /home/ro/gcc/8/lib/gcc/powerpc-ibm-aix7.2.0.0/8.4.0/includ e-fixed/stdlib.h:386, from /home/ro/gcc/8/include/c++/8.4.0/cstdlib:75, from /home/ro/gcc/8/include/c++/8.4.0/stdlib.h:36, from /home/ro/gcc/src/gcc-master/gcc/system.h:259, from /home/ro/gcc/src/gcc-master/gcc/ada/adaint.c:144: /usr/include/sys/time.h:197:8: note: candidate: 'timespec& timespec::operator=(c onst timespec&)' struct timespec { ^~~~~~~~ /usr/include/sys/time.h:197:8: note: no known conversion for argument 1 from ' st_timespec_t' {aka 'st_timespec'} to 'const timespec&' /usr/include/sys/time.h:197:8: note: candidate: 'timespec& timespec::operator=(t imespec&&)' /usr/include/sys/time.h:197:8: note: no known conversion for argument 1 from ' st_timespec_t' {aka 'st_timespec'} to 'timespec&&' and similarly for tbuf[1]/fbuf.st_mtim. I managed to avoid this by assigning the members (tv_sec, tv_nsec) individually. In addition, I enabled the largefile functions in adaint.h given that gcc/auto-host.h defines _LARGE_FILES 1. However, I believe that this maze of platform-specific #ifdefs just cries for proper autoconf tests, as has already been remarked on gcc-patches recently IIRC. (I can't attach the actual patch since gcc119 has been unaccessible for more than a day now). While those changes allowed the compilation to finish, gnat1 still doesn't link due to PR ada/95549.