pre_stage2 fails to link: x86_64-pc-linux-gnu-gcc -m32 -fno-strict-aliasing -march=i686 -fno-reorder-functions -fno-builtin -n ostdinc -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -DSUPPORT_GRAPHICS=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 - DFSYS_FFS=1 -DFSYS_UFS2=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 -DFSYS_JFS=1 -DFSYS_XFS=1 -DFSYS_ISO9660=1 -DUSE_MD5_PASSWORDS=1 -O2 -fno-strict-aliasing -march=core2 -msse4.1 -mcx16 -msahf -pipe -nostdlib -Wl,-N -Wl,-Ttext -Wl,8200 -Wl,-O1 -Wl,--as-needed -fuse-ld=bfd -Wl,--build-id=none -o pre_stage2.exec pre_stage2_exec-asm.o pre_stage2_exec-bios.o pre_stage2_exec-boot.o pre_stage2_e xec-builtins.o pre_stage2_exec-char_io.o pre_stage2_exec-cmdline.o pre_stage2_exec-common.o pre_stag e2_exec-console.o pre_stage2_exec-disk_io.o pre_stage2_exec-fsys_ext2fs.o pre_stage2_exec-fsys_fat.o pre_stage2_exec-fsys_ffs.o pre_stage2_exec-fsys_iso9660.o pre_stage2_exec-fsys_jfs.o pre_stage2_exe c-fsys_minix.o pre_stage2_exec-fsys_reiserfs.o pre_stage2_exec-fsys_ufs2.o pre_stage2_exec-fsys_vsta fs.o pre_stage2_exec-fsys_xfs.o pre_stage2_exec-gunzip.o pre_stage2_exec-hercules.o pre_stage2_exec- md5.o pre_stage2_exec-serial.o pre_stage2_exec-smp-imps.o pre_stage2_exec-stage2.o pre_stage2_exec-t erminfo.o pre_stage2_exec-tparm.o pre_stage2_exec-graphics.o pre_stage2_exec-bios.o: In function `get_diskinfo': bios.c:(.text+0x33a): undefined reference to `__stack_chk_fail' pre_stage2_exec-boot.o: In function `load_image': boot.c:(.text+0xf9c): undefined reference to `__stack_chk_fail' pre_stage2_exec-builtins.o: In function `vbeprobe_func': builtins.c:(.text+0x632): undefined reference to `__stack_chk_fail' pre_stage2_exec-builtins.o: In function `testvbe_func': builtins.c:(.text+0x90b): undefined reference to `__stack_chk_fail' pre_stage2_exec-builtins.o: In function `embed_func': builtins.c:(.text+0x12c9): undefined reference to `__stack_chk_fail' pre_stage2_exec-builtins.o:builtins.c:(.text+0x1489): more undefined references to `__stack_chk_fail ' follow collect2: error: ld returned 1 exit status Makefile:1066: recipe for target 'pre_stage2.exec' failed Reproducible: Always Steps to Reproduce: 1. emerge grub:0
Created attachment 392884 [details] emerge --info
Just try without custom-cflags. And as per equery u grub:0 -> - - custom-cflags : Build with user-specified CFLAGS (unsupported) I'd say it could be invalid.
(In reply to Agostino Sarubbo from comment #2) > I'd say it could be invalid. Or at least it could be: sys-boot/grub:0[custom-cflags] is broken by default with gcc:4.8 because of -fstack-protector.
Thank you for that hint, switching off custom cflags indeed solved the problem.