Skip to contentSkip to conversation

roms/seabios-hppa can't be built with gcc-10: -fno-ipa-sra

DISCUSSION Michael Tokarev 2 participants 2 messages Jul 23, 2020 – Jul 24, 2020

lore
Share & tools
lore
#0 lore raw

Switching to gcc-10 makes seabios-hppa unbuildable. It fails at the final linking step with a lot of missing references to memcpy & memcmp all over the places.

The notable difference between gcc-10 and previous gcc is that ccode32flat.o does _not_ have the text for these two functions but have two .isra.0:

$ hppa-linux-gnu-nm ccode32flat.o | grep mem[sc]
000003e0 t memcmp
         U memcpy
00002f38 t memcpy.isra.0
         U memset
00003a84 t memset.isra.0

while previous version of the compiler did have them:

$ hppa-linux-gnu-nm ccode32flat.o | grep mem[sc]
000002fc t memcmp
0000370c t memcpy
0000036c t memset

After adding -fno-ipa-sra to the gcc flags, the firmware is built successfully.

I don't know what to make out of this. Previous versions of gcc apparently accepts -fno-ipa-sra too, for quite some time. So maybe add this to the flags unconditionally?

Thanks,

/mjt

#1 lore raw
Quoted 17 lines · Michael Tokarev

Switching to gcc-10 makes seabios-hppa unbuildable. It fails at the final linking step with a lot of missing references to memcpy & memcmp all over the places.

The notable difference between gcc-10 and previous gcc is that ccode32flat.o does _not_ have the text for these two functions but have two .isra.0:

$ hppa-linux-gnu-nm ccode32flat.o | grep mem[sc]
000003e0 t memcmp
         U memcpy
00002f38 t memcpy.isra.0
         U memset
00003a84 t memset.isra.0
Quoted 6 lines

while previous version of the compiler did have them:

$ hppa-linux-gnu-nm ccode32flat.o | grep mem[sc]
000002fc t memcmp
0000370c t memcpy
0000036c t memset

I believe this is a compiler bug in gcc-10.
Adding other flags like -fno-builtin or similiar doesn't fix the issue.

Quoted 6 lines

After adding -fno-ipa-sra to the gcc flags, the firmware is built successfully.

I don't know what to make out of this. Previous versions of gcc apparently accepts -fno-ipa-sra too, for quite some time. So maybe add this to the flags unconditionally?

I think this is currently the best way forward.
Do you want to send a patch, or should I just add this upstream to seabios-hppa?

Helge