ftbfs: gnat cross targeting powerpc

Bug #1836045 reported by Matthias Klose
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-8-cross (Ubuntu)
Fix Released
High
Unassigned
gcc-9-cross (Ubuntu)
Fix Released
High
Unassigned
linux (Ubuntu)
Fix Released
High
Unassigned

Bug Description

both seen with gcc-8-cross and gcc-9-cross (search the build logs for "unfinished":

/<<PKGBUILDDIR>>/gcc/build/./gcc/xgcc -B/<<PKGBUILDDIR>>/gcc/build/./gcc/ -B/usr/powerpc-linux-gnu/bin/ -B/usr/powerpc-li
nux-gnu/lib/ -isystem /usr/powerpc-linux-gnu/include -isystem /usr/powerpc-linux-gnu/sys-include -isystem /<<PKGBUILDDIR>
>/gcc/build/sys-include -c -g -O2 -W -Wall -gnatpg -nostdinc -gnatn a-direct.adb -o a-direct.o
a-direct.adb:734:27: "NAME_MAX" is undefined
a-direct.adb:743:28: "SIZEOF_struct_dirent_alloc" is undefined
a-direct.adb:1210:24: "ENOENT" is undefined
s-filatt.ads:62:18: "SIZEOF_struct_file_attributes" not declared in "OS_Constants"
s-oscons.ads:50:26: "Target_OS" is undefined
s-oscons.ads:54:01: (style) multiple blank lines
s-oscons.ads:59:01: (style) multiple blank lines
s-oscons.ads:64:01: (style) multiple blank lines
s-oscons.ads:69:01: (style) multiple blank lines
s-oscons.ads:74:01: (style) multiple blank lines
s-oscons.ads:79:01: (style) multiple blank lines
s-oscons.ads:86:01: (style) multiple blank lines
s-oscons.ads:91:01: (style) multiple blank lines
s-oscons.ads:96:01: (style) multiple blank lines
s-oscons.ads:101:01: (style) multiple blank lines
s-oscons.ads:106:01: (style) multiple blank lines
s-oscons.ads:111:01: (style) multiple blank lines
s-oscons.ads:116:01: (style) multiple blank lines
s-oscons.ads:121:01: (style) multiple blank lines
s-oscons.ads:126:01: (style) multiple blank lines
s-oscons.ads:131:01: (style) multiple blank lines
s-oscons.ads:136:01: (style) multiple blank lines
s-oscons.ads:147:01: (style) multiple blank lines
s-oscons.ads:166:01: (style) multiple blank lines
s-oscons.ads:173:01: (style) multiple blank lines
s-oscons.ads:176:01: (style) multiple blank lines
s-oscons.ads:181:01: (style) multiple blank lines
make[9]: *** [../gcc-interface/Makefile:299: a-direct.o] Error 1
make[9]: Leaving directory '/<<PKGBUILDDIR>>/gcc/build/gcc/ada/rts'
make[8]: *** [gcc-interface/Makefile:623: gnatlib] Error 2

Revision history for this message
Matthias Klose (doko) wrote :

last successful builds were in mid June in eoan

Changed in gcc-8-cross (Ubuntu):
status: New → Confirmed
Changed in gcc-9-cross (Ubuntu):
status: New → Confirmed
Changed in gcc-8-cross (Ubuntu):
importance: Undecided → High
Changed in gcc-9-cross (Ubuntu):
importance: Undecided → High
tags: added: ftbfs
Revision history for this message
Matthias Klose (doko) wrote : Re: ftbfs: gnat cross targeting powerpc on ppc64el

not specific on the host, ftbfs on amd64 as well

summary: - fftbfs: gnat cross targeting powerpc on ppc64el
+ ftbfs: gnat cross targeting powerpc on ppc64el
Revision history for this message
Matthias Klose (doko) wrote :
Download full text (4.2 KiB)

(cd rts ; \
    /<<PKGBUILDDIR>>/gcc/build/./gcc/xgcc -B/<<PKGBUILDDIR>>/gcc/build/./gcc/ -B/usr/powerpc-linux-gnu/bin/ -B/usr/powerp
c-linux-gnu/lib/ -isystem /usr/powerpc-linux-gnu/include -isystem /usr/powerpc-linux-gnu/sys-include -isystem /<<PKGBUILD
DIR>>/gcc/build/sys-include -W -Wall -g -O2 -g -O2 -fexceptions -DIN_RTS -DHAVE_GETIPINFO -E -C -DTARGET=\"powerpc-u
nknown-linux-gnu\" -iquote /<<PKGBUILDDIR>>/gcc/src/gcc/ada /<<PKGBUILDDIR>>/gcc/src/gcc/ada/s-oscons-tmplt.c > s-oscons-
tmplt.i ; \
    /<<PKGBUILDDIR>>/gcc/build/./gcc/xgcc -B/<<PKGBUILDDIR>>/gcc/build/./gcc/ -B/usr/powerpc-linux-gnu/bin/ -B/usr/powerp
c-linux-gnu/lib/ -isystem /usr/powerpc-linux-gnu/include -isystem /usr/powerpc-linux-gnu/sys-include -isystem /<<PKGBUILD
DIR>>/gcc/build/sys-include -W -Wall -g -O2 -g -O2 -fexceptions -DIN_RTS -DHAVE_GETIPINFO -S s-oscons-tmplt.i ; \
    ../bldtools/oscons/xoscons s-oscons)
In file included from /usr/powerpc-linux-gnu/include/bits/libc-header-start.h:33,
                 from /usr/powerpc-linux-gnu/include/limits.h:26,
                 from /<<PKGBUILDDIR>>/gcc/build/gcc/include-fixed/limits.h:194,
                 from /<<PKGBUILDDIR>>/gcc/build/gcc/include-fixed/syslimits.h:7,
                 from /<<PKGBUILDDIR>>/gcc/build/gcc/include-fixed/limits.h:34,
                 from /<<PKGBUILDDIR>>/gcc/src/gcc/ada/gsocket.h:177,
                 from /<<PKGBUILDDIR>>/gcc/src/gcc/ada/s-oscons-tmplt.c:103:
/usr/powerpc-linux-gnu/include/features.h:185:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEF
AULT_SOURCE" [-Wcpp]
 # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
   ^~~~~~~
/<<PKGBUILDDIR>>/gcc/src/gcc/ada/s-oscons-tmplt.c: In function 'main':
/<<PKGBUILDDIR>>/gcc/src/gcc/ada/s-oscons-tmplt.c:1256:46: error: 'SO_SNDTIMEO_OLD' undeclared (first use in this function)
 CND(SO_SNDTIMEO, "Emission timeout")
                                              ^
/<<PKGBUILDDIR>>/gcc/src/gcc/ada/s-oscons-tmplt.c:1256:46: note: each undeclared identifier is reported only once for each function it appears in
/<<PKGBUILDDIR>>/gcc/src/gcc/ada/s-oscons-tmplt.c:1261:46: error: 'SO_RCVTIMEO_OLD' undeclared (first use in this function)
 CND(SO_RCVTIMEO, "Reception timeout")
                                              ^
test -f rts/s-oscons.ads || exit 1

[...]

/<<PKGBUILDDIR>>/gcc/build/./gcc/xgcc -B/<<PKGBUILDDIR>>/gcc/build/./gcc/ -B/usr/powerpc-linux-gnu/bin/ -B/usr/powerpc-li
nux-gnu/lib/ -isystem /usr/powerpc-linux-gnu/include -isystem /usr/powerpc-linux-gnu/sys-include -isystem /<<PKGBUILDDIR>
>/gcc/build/sys-include -c -g -O2 -W -Wall -gnatpg -nostdinc -gnatn a-direct.adb -o a-direct.o
checking for sinl... a-direct.adb:722:27: "NAME_MAX" is undefined
a-direct.adb:731:28: "SIZEOF_struct_dirent_alloc" is undefined
a-direct.adb:1099:24: "ENOENT" is undefined
s-filatt.ads:62:18: "SIZEOF_struct_file_attributes" not declared in "OS_Constants"
s-oscons.ads:50:26: "Target_OS" is undefined
s-oscons.ads:54:01: (style) multiple blank lines
s-oscons.ads:59:01: (style) multiple blank lines
s-oscons.ads:64:01: (style) multiple blank lines
s-oscons.ad...

Read more...

Matthias Klose (doko)
summary: - ftbfs: gnat cross targeting powerpc on ppc64el
+ ftbfs: gnat cross targeting powerpc
Revision history for this message
Seth Forshee (sforshee) wrote :

SO_SNDTIMEO_OLD and SO_RCVTIMEO_OLD are new in 5.1, due to some shuffling to support y2038-safe socket timeout options. They should be defined in headers installed by linux-libc-dev, as follows:

usr/include/asm-generic/socket.h:
  #define SO_RCVTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_RCVTIMEO_OLD : SO_RCVTIMEO_NEW)
  #define SO_SNDTIMEO (sizeof(time_t) == sizeof(__kernel_long_t) ? SO_SNDTIMEO_OLD : SO_SNDTIMEO_NEW)

usr/include/powerpc64le-linux-gnu/asm/socket.h:
  #define SO_RCVTIMEO_OLD 18
  #define SO_SNDTIMEO_OLD 19

So it seems likely that the would be coming from the SO_RCVTIMEO/SO_SNDTIMEO definitions, which should get pulled in from the ppc asm header pulling in the asm-generic header. But I can't see how it would end up with those definitions but not the definitions for the corresponding *_OLD symbols.

Looking at kernel changes since 5.0, as far as I can tell nothing has changed wrt NAME_MAX and ENOENT. The other symbols don't appear to be from the kernel.

Revision history for this message
Matthias Klose (doko) wrote :

comparing the source trees of 5.0 and 5.2, it looks like all architectures except powerpc were updated (fgrep -r SO_RCVTIMEO). So this is a blocker for the powerpc cross compilers, which we need to build some firmware.

Changed in linux (Ubuntu):
status: New → Confirmed
importance: Undecided → High
tags: added: rls-ee-incoming
Revision history for this message
Seth Forshee (sforshee) wrote :

That's not true; most architectures don't have a match for SO_RCVTIMEO, as they're using the definition from asm-generic, just as powerpc should be. The others were updated differently because they do not include asm-generic/socket.h. And powerpc clearly does have a definition for it, since the build complains that SO_RCVTIMEO_OLD is not defined and not SO_RCVTIMEO. The question is why isn't SO_RCVTIMEO_OLD defined.

I tried cross-compiling the following for ppc64el and did not receive any errors about SO_RCVTIMEO or SO_RCVTIMEO_OLD being undefined, nor did it complain when I used SO_RCVTIMEO_OLD, so it seems like it's working as intended. That leaves me wondering whether something isn't including asm-generic/socket.h when it should be including asm/socket.h, or something like that. I don't see any such mistakes in linux-libc-dev though.

#include <stdio.h>
#include <sys/socket.h>

int main(void)
{
        printf("%d\n", SO_RCVTIMEO);
        return 0;
}

Revision history for this message
Matthias Klose (doko) wrote :

gcc/ada/gsocket.h:#include <sys/socket.h>

so this is using the glibc header, no kernel header directly.

It looks like that with linux-libc-dev built using linux 5.2, I'm able to build the cross compiler. I'll update once the build finishes.

Revision history for this message
Matthias Klose (doko) wrote :

> /usr/include/powerpc64le-linux-gnu/asm/socket.h:

this is the wrong header, I am talking about the powerpc-linux-gnu target.

Revision history for this message
Matthias Klose (doko) wrote :

now built linux-libc-dev-powerpc-cross from the linux 5.2 sources, and the cross builds are working again. I'm currently not spending time to investigate that further.

Revision history for this message
Steve Langasek (vorlon) wrote :

If the cross-builds are working again, it sounds like this is resolved.

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
Changed in gcc-9-cross (Ubuntu):
status: Confirmed → Fix Released
Changed in gcc-8-cross (Ubuntu):
status: Confirmed → Fix Released
Brad Figg (brad-figg)
tags: added: cscc
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.