[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Building only util
From: |
Darren Hart |
Subject: |
Re: Building only util |
Date: |
Mon, 28 Nov 2011 23:42:50 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 |
On 11/28/2011 06:42 PM, Jordan Uggla wrote:
>> If I use my host compiler for both the HOST and the TARGET (host is
>> x86_64 and target is i386), then grub-mkimage works. However, if I use
>> the cross compiler to build the grub modules, and I use my distribution
>> installed grub-mkimage (instead of the one I build) things also work.
>> I'm currently a bit baffled at where the problem might be.
>
> I'm not sure what the problem is either, but it might help if you said
> exactly what options you're currently passing to ./configure.
>
Of course. I'm building with bitbake, which sets up the environment for
performing cross compilation. I've confirmed that things work if I use the same
cross compiler for the target cc outside of the bitbake environment, so I
believe
there is something about the environment that is mucking up the make.
The configure script is run like this (and it works when I use it outside of
bitbake):
./configure --build=x86_64-linux --host=x86_64-linux --target=i586-poky-linux
--prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--libexecdir=/usr/libexec --datadir=/usr/share --sysconfdir=/etc
--sharedstatedir=/com --localstatedir=/var --libdir=/usr/lib
--includedir=/usr/include --oldincludedir=/usr/include
--infodir=/usr/share/info --mandir=/usr/share/man --disable-silent-rules
--with-libtool-sysroot=/build/poky/n450/tmp/sysroots/n450 CC=gcc
TARGET_CC=i586-poky-linux-gcc --with-platform=efi --enable-efiemu=no
--disable-grub-mkfont --program-prefix='' --enable-nls
If I diff the make logs, I noticed several differences in compiler arguments as
well as ranlib and cpp calls. I've fixed these and am now building with nearly
identical output from make both from within bitbake and outside bitbake. I do
see additional warnings in the bitbake environment build, such as:
gcc -DHAVE_CONFIG_H -I. -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\"
-DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=I386_EFI
-DGRUB_FILE=\"grub-core/kern/misc.c\" -I. -I. -I. -I. -I./include -I./include
-I./grub-core/gnulib -I./grub-core/gnulib -Wno-undef
-Wno-sign-compare -Wno-unused -Wno-unused-parameter -MT
grub-core/kern/libgrubkern_a-misc.o -MD -MP -MF
grub-core/kern/.deps-util/libgrubkern_a-misc.Tpo -c -o
grub-core/kern/libgrubkern_a-misc.o `test -f 'grub-core/kern/misc.c' || echo
'./'`grub-core/kern/misc.c
grub-core/kern/misc.c:68:7: warning: conflicting types for built-in function
'memmove' [enabled by default]
grub-core/kern/misc.c:71:7: warning: conflicting types for built-in function
'memcpy' [enabled by default]
grub-core/kern/misc.c:244:5: warning: conflicting types for built-in function
'memcmp' [enabled by default]
grub-core/kern/misc.c: In function 'grub_memset':
grub-core/kern/misc.c:537:27: warning: cast from pointer to integer of
different size [-Wpointer-to-int-cast]
grub-core/kern/misc.c: At top level:
grub-core/kern/misc.c:561:7: warning: conflicting types for built-in function
'memset' [enabled by default]
Then later, and specifically for the grub-mkimage binary that I'm seeing the
segfault in:
gcc -DHAVE_CONFIG_H -I. -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_LIBDIR=\"/usr/lib/grub\" -DLOCALEDIR=\"/usr/share/locale\"
-DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=I386_EFI
-DGRUB_FILE=\"util/grub-mkimage.c\" -I. -I. -I. -I. -I./include -I./include
-I./grub-core/gnulib -I./grub-core/gnulib
-DGRUB_PKGLIBROOTDIR=\"/usr/lib/''grub\" -Wno-undef -Wno-sign-compare
-Wno-unused -Wno-unused-parameter -MT util/grub_mkimage-grub-mkimage.o -MD
-MP -MF util/.deps-util/grub_mkimage-grub-mkimage.Tpo -c -o
util/grub_mkimage-grub-mkimage.o `test -f 'util/grub-mkimage.c' || echo
'./'`util/grub-mkimage.c
util/grub-mkimage.c: In function 'generate_image':
util/grub-mkimage.c:665:11: warning: passing argument 2 of 'load_image32' from
incompatible pointer type [enabled by default]
util/grub-mkimagexx.c:601:1: note: expected 'grub_size_t *' but argument is of
type 'size_t *'
util/grub-mkimage.c:665:11: warning: passing argument 3 of 'load_image32' from
incompatible pointer type [enabled by default]
util/grub-mkimagexx.c:601:1: note: expected 'grub_size_t *' but argument is of
type 'size_t *'
util/grub-mkimage.c:669:11: warning: passing argument 2 of 'load_image64' from
incompatible pointer type [enabled by default]
util/grub-mkimagexx.c:601:1: note: expected 'grub_size_t *' but argument is of
type 'size_t *'
util/grub-mkimage.c:669:11: warning: passing argument 3 of 'load_image64' from
incompatible pointer type [enabled by default]
util/grub-mkimagexx.c:601:1: note: expected 'grub_size_t *' but argument is of
type 'size_t *'
It's sure to be something in my environment, but I just haven't found it.
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel