Bug#760428: grub2: FTBFS on x32: error: gcc-4.9 failed to produce assembly code

Daniel Schepler dschepler at gmail.com
Thu Sep 4 01:50:08 UTC 2014


Source: grub2
Version: 2.02~beta2-11
Severity: important
Justification: essential package for x32

grub2 failed to build on the x32 buildd:

checking whether -fno-dwarf2-cfi-asm works... yes
checking whether -fno-asynchronous-unwind-tables works... yes
checking whether option -mcmodel=large works... yes
checking whether option -Qn works... no
checking whether `gcc-4.9' has `-fPIE' as default... no
checking whether `gcc-4.9' has `-fPIC' as default... no
checking whether `gcc-4.9' accepts `-fstack-protector'... no
checking whether `gcc-4.9' accepts `-mstack-arg-probe'... no
configure: error: gcc-4.9 failed to produce assembly code
dh_auto_configure: ../../configure --build=x86_64-linux-gnux32 --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --libexecdir=${prefix}/lib/grub2 --disable-maintainer-mode --disable-dependency-tracking PACKAGE_VERSION=2.02~beta2-11 PACKAGE_STRING=GRUB 2.02~beta2-11 CC=gcc-4.9 TARGET_CC=gcc-4.9 --enable-grub-mkfont --with-platform=emu returned exit code 1
make[1]: *** [debian/stamps/configure-grub-emu] Error 2
checking if C symbols get an underscore after compilation... debian/rules:141: recipe for target 'debian/stamps/configure-grub-emu' failed
make[1]: Leaving directory '/«PKGBUILDDIR»'
make: *** [build-arch] Error 2
debian/rules:101: recipe for target 'build-arch' failed
dpkg-buildpackage: error: debian/rules build-arch gave error exit status 2

(Full build log at:
http://buildd.debian-ports.org/status/fetch.php?pkg=grub2&arch=x32&ver=2.02~beta2-11&stamp=1409791730
.)

Digging into the config.log file, I see:

configure:25265: checking whether option -mcmodel=large works
configure:25283: gcc-4.9 -c  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -freg-struct-return -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -m64 -mcmodel=large -Wno-unused-but-set-variable -Wall -W -I$(top_srcdir)/include -I$(top_builddir)/include  -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=X86_64_EMU conftest.c >&5
configure:25283: $? = 0
configure:25291: result: yes
...
configure:25715: checking if C symbols get an underscore after compilation
configure:25731: gcc-4.9  -Os -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit-Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations  -Wextra -Wattributes -Wendif-labels -Winit-self 
-Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -freg-struct-return -fno-dwarf2-cfi-asm -fno-asynchronous-unwind-tables -mcmodel=large -nostdlib -Wno-error -S conftest.c
conftest.c:1:0: error: code model 'large' not supported in x32 mode
 int func (int *);
 ^
configure:25734: $? = 1
configure:25738: error: gcc-4.9 failed to produce assembly code

I'm not sure why -m64 is present in the first test but gets dropped in the
second, but that's probably the reason the test for -mcmodel=large succeeds
but then causes problems down the line.
-- 
Daniel Schepler


More information about the Pkg-grub-devel mailing list