Sorry for the cross-post, but the problem is so weird that I'm confused 
what nature it is.

For complicated reasons (see below for details), I'm trying to build lang/gcc8 
so that it uses gas/gld from devel/binutils instead of /usr/bin/{as,ld}. I put
        DEPENDS+=               binutils-[0-9]*:../../devel/binutils
        CONFIGURE_ARGS.NetBSD+= --with-gnu-ld --with-ld=${PREFIX}/bin/gld
        CONFIGURE_ARGS.NetBSD+= --with-gnu-as --with-as=${PREFIX}/bin/gas
in Makefile.

After quite some build time, some intermediate step chokes with:
        checking for x86_64--netbsd-gcc... 
/var/work/pkgsrc/lang/gcc8/work/build/./gcc/xgcc 
-B/var/work/pkgsrc/lang/gcc8/work/build/./gcc/ 
-B/usr/pkg.compiler_boot/gcc8/x86_64--netbsd/bin/ 
-B/usr/pkg.compiler_boot/gcc8/x86_64--netbsd/lib/ -isystem 
/usr/pkg.compiler_boot/gcc8/x86_64--netbsd/include -isystem 
/usr/pkg.compiler_boot/gcc8/x86_64--netbsd/sys-include   
        checking for suffix of object files... configure: error: in 
`/var/work/pkgsrc/lang/gcc8/work/build/x86_64--netbsd/libgcc':
        configure: error: cannot compute suffix of object files: cannot compile
        See `config.log' for more details.
        gmake[2]: *** [Makefile:20348: configure-stage2-target-libgcc] Error 1
        gmake[2]: Leaving directory '/var/work/pkgsrc/lang/gcc8/work/build'
        gmake[1]: *** [Makefile:26109: stage2-bubble] Error 2
        gmake[1]: Leaving directory '/var/work/pkgsrc/lang/gcc8/work/build'
        gmake: *** [Makefile:949: all] Error 2
        *** Error code 2
        
        Stop.
        make[1]: stopped in /usr/pkgsrc/lang/gcc8
        *** Error code 1
        
        Stop.
        make: stopped in /usr/pkgsrc/lang/gcc8

According to config.log, the failing command is
        /var/work/pkgsrc/lang/gcc8/work/build/./gcc/xgcc 
-B/var/work/pkgsrc/lang/gcc8/work/build/./gcc/ 
-B/usr/pkg.compiler_boot/gcc8/x86_64--netbsd/bin/ 
-B/usr/pkg.compiler_boot/gcc8/x86_64--netbsd/lib/ -isystem 
/usr/pkg.compiler_boot/gcc8/x86_64--netbsd/include -isystem 
/usr/pkg.compiler_boot/gcc8/x86_64--netbsd/sys-include    -c -g -O2 
-D_FORTIFY_SOURCE=2 -I/usr/include -I/usr/pkg.compiler_boot/include/python3.10  
conftest.c >&5

ktrace-ing that manually reveals
        cc1      CALL  
mmap(0,0x100000,PROT_READ|PROT_WRITE,0x14001002<PRIVATE,ANONYMOUS,ALIGN=1MB>,0xffffffff,0,0)
        cc1      RET   mmap 137581005111296/0x7d2112f00000
        cc1      PSIG  SIGSEGV caught handler=0xa2e336 mask=(11): 
code=SEGV_MAPERR, addr=0x8, trap=6)

I even have no idea what xgcc is.

Any hints?


That's on 8.2_STABLE.

What I'm really trying to do is to build for 6.1 using a chroot and kver.
Without the patch to make gcc8 use pkgsrc binutils, it builds and seems to work 
(it can build itself into the standard LOCALBASE), but it fails on 
archivers/zstd because gcc emits a .S file (no inline involved) which 
/usr/bin/as can't assemble (tzcntl and shrx).

Any hints on that welcome, too!

Reply via email to