Modify

Opened 3 years ago

Last modified 2 years ago

#20017 new defect

grub2 compilation error (uclibc, x86)

Reported by: anonymous Owned by: developers
Priority: normal Milestone:
Component: packages Version: Trunk
Keywords: grub2 Cc:

Description

i486-openwrt-linux-uclibc-gcc -DHAVE_CONFIG_H -I.  -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_FILE=\"grub-core/osdep/hostdisk.c\" -I. -I. -I. -I. -I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/  -I./grub-core/gnulib -I./grub-core/gnulib -I/home/development/src/openwrt-trunk/openwrt/staging_dir/target-i386_i486_uClibc-0.9.33.2/usr/include -I/home/development/src/openwrt-trunk/openwrt/staging_dir/target-i386_i486_uClibc-0.9.33.2/include -I/home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/include  -fno-builtin-gettext -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 -Wcast-align  -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-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2  -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Os -pipe -march=i486 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -MT grub-core/osdep/libgrubkern_a-hostdisk.o -MD -MP -MF grub-core/osdep/.deps-util/libgrubkern_a-hostdisk.Tpo -c -o grub-core/osdep/libgrubkern_a-hostdisk.o `test -f 'grub-core/osdep/hostdisk.c' || echo './'`grub-core/osdep/hostdisk.c
mv -f grub-core/osdep/.deps-util/libgrubkern_a-hostdisk.Tpo grub-core/osdep/.deps-util/libgrubkern_a-hostdisk.Po
i486-openwrt-linux-uclibc-gcc -DHAVE_CONFIG_H -I.  -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_FILE=\"grub-core/osdep/unix/hostdisk.c\" -I. -I. -I. -I. -I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/  -I./grub-core/gnulib -I./grub-core/gnulib -I/home/development/src/openwrt-trunk/openwrt/staging_dir/target-i386_i486_uClibc-0.9.33.2/usr/include -I/home/development/src/openwrt-trunk/openwrt/staging_dir/target-i386_i486_uClibc-0.9.33.2/include -I/home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_i486_gcc-4.8-linaro_uClibc-0.9.33.2/include  -fno-builtin-gettext -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 -Wcast-align  -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-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2  -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Os -pipe -march=i486 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -MT grub-core/osdep/unix/libgrubkern_a-hostdisk.o -MD -MP -MF grub-core/osdep/unix/.deps-util/libgrubkern_a-hostdisk.Tpo -c -o grub-core/osdep/unix/libgrubkern_a-hostdisk.o `test -f 'grub-core/osdep/unix/hostdisk.c' || echo './'`grub-core/osdep/unix/hostdisk.c
grub-core/osdep/unix/hostdisk.c: In function 'grub_util_fd_seek':
grub-core/osdep/unix/hostdisk.c:87:14: error: invalid storage class for function '_llseek'
   static int _llseek (uint filedes, ulong hi, ulong lo,
              ^
grub-core/osdep/unix/hostdisk.c:89:3: warning: implicit declaration of function '_syscall5' [-Wimplicit-function-declaration]
   _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
   ^
grub-core/osdep/unix/hostdisk.c:89:3: warning: nested extern declaration of '_syscall5' [-Wnested-externs]
grub-core/osdep/unix/hostdisk.c:89:14: error: expected expression before 'int'
   _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
              ^
grub-core/osdep/unix/hostdisk.c:93:3: warning: implicit declaration of function '_llseek' [-Wimplicit-function-declaration]
   if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET))
   ^
grub-core/osdep/unix/hostdisk.c:93:3: warning: nested extern declaration of '_llseek' [-Wnested-externs]
make[6]: *** [grub-core/osdep/unix/libgrubkern_a-hostdisk.o] Error 1
make[6]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/build_dir/target-i386_i486_uClibc-0.9.33.2/linux-x86_kvm_guest/grub-2.02~beta2'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/build_dir/target-i386_i486_uClibc-0.9.33.2/linux-x86_kvm_guest/grub-2.02~beta2'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/build_dir/target-i386_i486_uClibc-0.9.33.2/linux-x86_kvm_guest/grub-2.02~beta2'
make[3]: *** [/home/development/src/openwrt-trunk/openwrt/build_dir/target-i386_i486_uClibc-0.9.33.2/linux-x86_kvm_guest/grub-2.02~beta2/.built] Error 2
make[3]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/package/boot/grub2'
make[2]: *** [package/boot/grub2/compile] Error 2
make[2]: Leaving directory `/home/development/src/openwrt-trunk/openwrt'
make[1]: *** [/home/development/src/openwrt-trunk/openwrt/staging_dir/target-i386_i486_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/development/src/openwrt-trunk/openwrt'
make: *** [world] Error 2

Attachments (0)

Change History (7)

comment:1 Changed 3 years ago by dubek

Removing package/boot/grub2/patches/100-musl-compat.patch which was added recently solved the problem for me. I guess that commit solved a problem with musl but created a problem with uClibc (at least on x86).

comment:2 Changed 3 years ago by anonymous

This issue remains with latest trunk r46197 (note: this problem only exists on x86) ...

comment:3 Changed 3 years ago by anonymous

Problem remains with latest trunk r46266

comment:4 Changed 3 years ago by anonymous

Problem remains with latest trunk r46369

mv -f grub-core/osdep/.deps-util/libgrubkern_a-hostdisk.Tpo grub-core/osdep/.deps-util/libgrubkern_a-hostdisk.Po
i486-openwrt-linux-uclibc-gcc -DHAVE_CONFIG_H -I.  -Wall -W -I./include -DGRUB_UTIL=1 -DGRUB_FILE=\"grub-core/osdep/unix/hostdisk.c\" -I. -I. -I. -I. -I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/  -I./grub-core/gnulib -I./grub-core/gnulib -I/home/development/src/openwrt-trunk/openwrt/staging_dir/target-i386_pentium4_uClibc-0.9.33.2/usr/include -I/home/development/src/openwrt-trunk/openwrt/staging_dir/target-i386_pentium4_uClibc-0.9.33.2/include -I/home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_pentium4_gcc-4.8-linaro_uClibc-0.9.33.2/usr/include -I/home/development/src/openwrt-trunk/openwrt/staging_dir/toolchain-i386_pentium4_gcc-4.8-linaro_uClibc-0.9.33.2/include  -fno-builtin-gettext -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 -Wcast-align  -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-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2  -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Os -pipe -march=pentium4 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -MT grub-core/osdep/unix/libgrubkern_a-hostdisk.o -MD -MP -MF grub-core/osdep/unix/.deps-util/libgrubkern_a-hostdisk.Tpo -c -o grub-core/osdep/unix/libgrubkern_a-hostdisk.o `test -f 'grub-core/osdep/unix/hostdisk.c' || echo './'`grub-core/osdep/unix/hostdisk.c
grub-core/osdep/unix/hostdisk.c: In function 'grub_util_fd_seek':
grub-core/osdep/unix/hostdisk.c:87:14: error: invalid storage class for function '_llseek'
   static int _llseek (uint filedes, ulong hi, ulong lo,
              ^
grub-core/osdep/unix/hostdisk.c:89:3: warning: implicit declaration of function '_syscall5' [-Wimplicit-function-declaration]
   _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
   ^
grub-core/osdep/unix/hostdisk.c:89:3: warning: nested extern declaration of '_syscall5' [-Wnested-externs]
grub-core/osdep/unix/hostdisk.c:89:14: error: expected expression before 'int'
   _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
              ^
grub-core/osdep/unix/hostdisk.c:93:3: warning: implicit declaration of function '_llseek' [-Wimplicit-function-declaration]
   if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET))
   ^
grub-core/osdep/unix/hostdisk.c:93:3: warning: nested extern declaration of '_llseek' [-Wnested-externs]
make[6]: *** [grub-core/osdep/unix/libgrubkern_a-hostdisk.o] Error 1
make[6]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/build_dir/target-i386_pentium4_uClibc-0.9.33.2/linux-x86_kvm_guest/grub-2.02~beta2'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/build_dir/target-i386_pentium4_uClibc-0.9.33.2/linux-x86_kvm_guest/grub-2.02~beta2'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/build_dir/target-i386_pentium4_uClibc-0.9.33.2/linux-x86_kvm_guest/grub-2.02~beta2'
make[3]: *** [/home/development/src/openwrt-trunk/openwrt/build_dir/target-i386_pentium4_uClibc-0.9.33.2/linux-x86_kvm_guest/grub-2.02~beta2/.built] Error 2
make[3]: Leaving directory `/home/development/src/openwrt-trunk/openwrt/package/boot/grub2'
make[2]: *** [package/boot/grub2/compile] Error 2
make[2]: Leaving directory `/home/development/src/openwrt-trunk/openwrt'
make[1]: *** [/home/development/src/openwrt-trunk/openwrt/staging_dir/target-i386_pentium4_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/development/src/openwrt-trunk/openwrt'
make: *** [world] Error 2

comment:5 Changed 3 years ago by anonymous

Is uClibc not supported on x86 any longer ? Should I switch over to musl ?

Because this issue with grub2 on x86/uClibc has been lingering for almost a month ...

comment:6 Changed 2 years ago by hauke

For me building grub2 works with this config:

CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_generic=y
CONFIG_TARGET_x86_generic_Generic=y
CONFIG_DEVEL=y
CONFIG_TOOLCHAINOPTS=y
CONFIG_BUILD_LOG=y
CONFIG_DEBUG=y
# CONFIG_GCC_USE_VERSION_4_8_LINARO is not set
CONFIG_GCC_USE_VERSION_5=y
CONFIG_GCC_VERSION="5.2.0"
CONFIG_GCC_VERSION_5=y
CONFIG_LIBC="uClibc"
# CONFIG_LIBC_USE_MUSL is not set
CONFIG_LIBC_USE_UCLIBC=y
CONFIG_LIBC_VERSION="0.9.33.2"
CONFIG_NO_STRIP=y
CONFIG_PACKAGE_libssp=y
CONFIG_SSP_SUPPORT=y
CONFIG_TARGET_IMAGES_PAD=y
CONFIG_TARGET_SUFFIX="uclibc"
CONFIG_UCLIBC_ENABLE_DEBUG=y
CONFIG_UCLIBC_USE_VERSION_0_9_33=y
CONFIG_UCLIBC_VERSION="0.9.33.2"
CONFIG_UCLIBC_VERSION_0_9_33=y
# CONFIG_USE_STRIP is not set
CONFIG_USE_UCLIBC=y
CONFIG_VDI_IMAGES=y
# CONFIG_USE_SSTRIP is not set

comment:7 Changed 2 years ago by anonymous

I've given up (after almost 2 months and no feedback) and switched from uClibc to musl (for trunk builds, CC still compiles OK with uClibc).

Maybe someone else can comment on building trunk w/ uClibc for the x86 arch ...

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.