Upstreaming OpenRISC with GCC mainline

Stafford Horne shorne@gmail.com
Sat Oct 30 08:56:02 GMT 2021


On Sat, Oct 30, 2021 at 12:08:18AM +0900, Stafford Horne wrote:
> On Fri, Oct 29, 2021, 11:43 PM Joseph Myers <joseph@codesourcery.com> wrote:
> 
> > On Fri, 29 Oct 2021, Stafford Horne wrote:
> >
> > >     $ or1k-glibc-linux-gnu-gcc tst-mqueue5.c -c -std=gnu11
> > -fgnu89-inline  -g -O -Wall -Wwrite-strings -Wundef -Werror
> > -fmerge-all-constants -frounding-math -fno-stack-protector -fno-c....
> >
> > That's -O, i.e. -O1, which is expected to have extra warnings.  Making
> > glibc build cleanly with different optimization options would be good, but
> > should be handled separately from new ports.
> >
> 
> Oh, you are right, I reset CFLAGS before the build so I didn't think
> anything would be coming in. I'll try to figure out where those extra flags
> are coming from.

Alright, now that I am using -g -O2 I am almost getting a clean run of
build-many-glibcs.py, using the following branches:

    GLIBC: mainline (2021-10-29 b3cf94ef15 + or1k port)
    GCC  : mainline (2021-10-29 518bc4ef87e)

I am now getting the below for both x86_64-linux-gnu and or1k-linux-gnu-soft.

It seems to be related to -frounding-math, removing that flag fixes the issue.
GCC has 2 patches related to this recently committed:

   2021-10-28 81342e95827 Richard Biener   middle-end/84407 - honor -frounding-math for int to float conversion
   2021-10-28 a84b9d5373c Richard Biener   middle-end/57245 - honor -frounding-math in real truncation

Error:

    or1k-glibc-linux-gnu-gcc tst-timespec.c -fdump-analyzer -fdump-lang-all -fdump-tree-all -c -fgnu89-inline  -g -O2 -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -fno-common -Wstrict-prototypes -Wold-style-definition -fmath-errno            -I../include -I/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/support  -I/home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc  -I../sysdeps/unix/sysv/linux/or1k  -I../sysdeps/or1k/nptl  -I../sysdeps/unix/sysv/linux/generic/wordsize-32  -I../sysdeps/unix/sysv/linux/generic  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/or1k/nofpu  -I../sysdeps/ieee754/soft-fp  -I../sysdeps/or1k  -I../sysdeps/wordsize-32  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I.  -D_LIBC_REENTRANT -include /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/libc-modules.h -DMODULE_NAME=testsuite -include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc -o /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/support/tst-timespec.o -MD -MP -MF /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/support/tst-timespec.o.dt -MT /home/shorne/work/gnu-toolchain/build-many/build/glibcs/or1k-linux-gnu-soft/glibc/support/tst-timespec.o
    In file included from tst-timespec.c:22:
    ../include/intprops.h:57:3: error: initializer element is not computable at load time
       57 |   ((t) (! TYPE_SIGNED (t)                                               \
	  |   ^
    tst-timespec.c:48:20: note: in expansion of macro ‘TYPE_MAXIMUM’
       48 | #define TIME_T_MAX TYPE_MAXIMUM (time_t)
	  |                    ^~~~~~~~~~~~
    tst-timespec.c:290:19: note: in expansion of macro ‘TIME_T_MAX’
      290 |    .upper_bound = TIME_T_MAX, .lower_bound = 1, .result = 1,
	  |                   ^~~~~~~~~~
    ../include/intprops.h:57:3: note: (near initialization for ‘check_cases[20].upper_bound’)
       57 |   ((t) (! TYPE_SIGNED (t)                                               \
	  |   ^
    tst-timespec.c:48:20: note: in expansion of macro ‘TYPE_MAXIMUM’
       48 | #define TIME_T_MAX TYPE_MAXIMUM (time_t)
	  |                    ^~~~~~~~~~~~
    tst-timespec.c:290:19: note: in expansion of macro ‘TIME_T_MAX’
      290 |    .upper_bound = TIME_T_MAX, .lower_bound = 1, .result = 1,
	  |                   ^~~~~~~~~~

So maybe we need some more DIAG_* macros here now?

-Stafford


More information about the Libc-alpha mailing list