| Summary: | Grub2 fails to build for x86_64 | ||
|---|---|---|---|
| Product: | buildroot | Reporter: | Dr I J Ormshaw <ian_ormshaw> |
| Component: | Other | Assignee: | Erico Nunes <nunes.erico> |
| Status: | RESOLVED FIXED | ||
| Severity: | major | CC: | buildroot, ian_ormshaw |
| Priority: | P5 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | Config file | ||
|
Description
Dr I J Ormshaw
2017-08-29 07:49:51 UTC
Configuration detail:
>>> grub2 2.02 Configuring
(cd /home/ian/projects/dev/builds/x86_64-5006295/buildroot/build/grub2-2.02/ && rm -rf config.cache && PATH="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin:/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/sbin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/ian/.local/bin:/home/ian/bin" AR="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-ar" AS="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-as" LD="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-ld" NM="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-nm" CC="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-gcc" GCC="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-gcc" CPP="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-cpp" CXX="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-g++" FC="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-gfortran" F77="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-gfortran" RANLIB="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-ranlib" READELF="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-readelf" STRIP="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-strip" OBJCOPY="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-objcopy" OBJDUMP="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-objdump" AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as" CC_FOR_BUILD="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/ccache /usr/lib64/ccache/gcc" GCC_FOR_BUILD="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/ccache /usr/lib64/ccache/gcc" CXX_FOR_BUILD="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/ccache /usr/lib64/ccache/g++" LD_FOR_BUILD="/usr/bin/ld" CPPFLAGS_FOR_BUILD="-I/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/include" CFLAGS_FOR_BUILD="-O2 -I/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/include" CXXFLAGS_FOR_BUILD="-O2 -I/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/include" LDFLAGS_FOR_BUILD="-L/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/lib -Wl,-rpath,/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/lib" FCFLAGS_FOR_BUILD="" DEFAULT_ASSEMBLER="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-as" DEFAULT_LINKER="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-ld" CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fstack-protector-all" CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fstack-protector-all -fstack-protector-all" LDFLAGS="" FCFLAGS=" -O2 -fstack-protector-all" FFLAGS=" -O2 -fstack-protector-all" PKG_CONFIG="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/pkg-config" STAGING_DIR="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/x86_64-buildroot-linux-gnu/sysroot" INTLTOOL_PERL=/usr/bin/perl ac_cv_lbl_unaligned_fail=no ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_memcmp_working=yes ac_cv_have_decl_malloc=yes gl_cv_func_malloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes ac_cv_func_calloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes lt_cv_sys_lib_search_path_spec="" ac_cv_c_bigendian=no PATH="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin:/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/sbin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/ian/.local/bin:/home/ian/bin" PKG_CONFIG="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/lib/pkgconfig:/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/share/pkgconfig" AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/ccache /usr/lib64/ccache/gcc" GCC="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/ccache /usr/lib64/ccache/gcc" CXX="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/ccache /usr/lib64/ccache/g++" CPP="/usr/bin/cpp" OBJCOPY="/usr/bin/objcopy" RANLIB="/usr/bin/ranlib" CPPFLAGS="-I/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/include" CFLAGS="-O2 -I/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/include" CXXFLAGS="-O2 -I/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/include" LDFLAGS="-L/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/lib -Wl,-rpath,/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/lib" INTLTOOL_PERL=/usr/bin/perl CPP="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/ccache /usr/lib64/ccache/gcc -E" TARGET_CC="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-gcc" TARGET_CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fstack-protector-all" TARGET_CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" TARGET_LDFLAGS="" NM="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-nm" OBJCOPY="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-objcopy" STRIP="/home/ian/projects/dev/builds/x86_64-5006295/buildroot/host/bin/x86_64-buildroot-linux-gnu-strip" CONFIG_SITE=/dev/null ./configure --target=x86_64-buildroot-linux-gnu --host=x86_64-buildroot-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --localstatedir=/var --program-prefix="" --disable-gtk-doc --disable-gtk-doc-html --disable-doc --disable-docs --disable-documentation --with-xmlto=no --with-fop=no --disable-dependency-tracking --enable-ipv6 --disable-nls --disable-static --enable-shared --target=x86_64 --with-platform=efi --prefix=/ --exec-prefix=/ --disable-grub-mkfont --enable-efiemu=no ac_cv_lib_lzma_lzma_code=no --enable-device-mapper=no --enable-libzfs=no --disable-werror )
configure: WARNING: unrecognized options: --disable-gtk-doc, --disable-gtk-doc-html, --disable-doc, --disable-docs, --disable-documentation, --with-xmlto, --with-fop, --enable-ipv6, --disable-static, --enable-shared
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-buildroot-linux-gnu
checking target system type... x86_64-pc-none
I have done a lot of grub2 builds for x86_64 on Fedora 25 and even recently tested the pc_x86_64_bios_defconfig and pc_x86_64_efi_defconfig configs on Fedora 26 as well and did not hit this issue. Is this a clean build (make clean all)? Can you please attach a .config file where you see the problem, for us to try to reproduce it? Created attachment 7216 [details]
Config file
Sorry I thought I had attached the config file, but it turns out it is too large to attach. So I've bzip2'ed it now
It was a clean build. I've but to check I've done a make clean all, and sill get the same error I am able to reproduce the issue with your config, running Fedora 26 if that matters. Had to remove some of your user specific settings such as ones pointing to your BR2_EXTERNAL, but nevertheless reproduced: > checking whether -fno-asynchronous-unwind-tables works... yes > checking whether -fno-unwind-tables works... yes > checking for target linking format... unknown > configure: error: no suitable link format found I retested and am not able to reproduce a grub2 build failure with pc_x86_64_efi_defconfig, so it must be one of your changes. So now we need to narrow down which of your changes caused this, might be the changes in the grub2 config or more likely some of your optimization settings. Also we might consider retesting this with the v2 patchset on patchwork at [1] since it did some better separation between the host part and target part of grub2 which I wouldn't discard being a cause here (this would be one more reason to have something like that merged). I plan to respin that for 2017.11. [1] https://patchwork.ozlabs.org/project/buildroot/list/?submitter=46481&q=grub2&archive=&delegate=&state=* It turns out that grub2 fails to build with BR2_SSP_ALL=y. The following defconfig is enough to reproduce the issue: BR2_x86_64=y BR2_SSP_ALL=y BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_TARGET_GRUB2=y BR2_TARGET_GRUB2_X86_64_EFI=y We already had Bug 8946 in the past with a very similar issue and from which we can borrow a solution. So I sent the following patch as an attempt to address this issue before 2017.08 is cut out: https://patchwork.ozlabs.org/patch/807377/ Fixed by https://git.buildroot.org/buildroot/commit/?id=2a27294e9ade6130a12ced9a1f152c51431a870e. Thanks Erico! |