[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GRUB2 on OpenBSD 5.3-amd64: linking problem
From: |
Ilya Bakulin |
Subject: |
Re: GRUB2 on OpenBSD 5.3-amd64: linking problem |
Date: |
Wed, 14 Aug 2013 15:09:16 +0200 |
User-agent: |
KMail/1.9.10 (enterprise35 20120322.0d8ab49a133482885a7a6ae00ec4472b1859206f) |
On Wednesday 14 August 2013 10:59:24 Vladimir 'φ-coder/phcoder' Serbinenko
wrote:
> On 13.08.2013 23:03, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > On 09.08.2013 15:37, Ilya Bakulin wrote:
> >> Could you please help me to solve the linking problem?
> >> What else do you need from me?
> >
> > Sounds like your gcc doesn't pass -m32 to linker. Try at configue stage
> > set TARGET_LDFLAGS=-melf_i386
>
> Sorry, I meant:
> TARGET_LDFLAGS=-Wl,-melf_i386
Yeah, that did the trick!
> On 09.08.2013 15:37, Ilya Bakulin wrote:
> > ./configure CFLAGS=-ftrampolines -fno-stack-protector
> > LEX=/usr/local/bin/gflex TARGET_CFLAGS=-ftrampolines -fno-stack-protector
>
> You don't need -ftrampolines. Also you forgot quotes.
I cannot compile code without
TARGET_CFLAGS='-ftrampolines -fno-stack-protector' -- more precisely, without
trampolines. Configure fails with this message:
...
checking whether `gcc' generates calls to `__enable_execute_stack()'...
configure: error: gcc failed to produce assembly code
The message from config.log says:
conftest.c: In function 'g':
conftest.c:282: error: trampoline code generation is not allowed
without -ftrampolines
configure:20492: $? = 1
configure:20496: error: gcc failed to produce assembly code
If I configure without -ftrampolines in CFLAGS, configure finishes just OK,
but compilation later fails:
gcc -DHAVE_CONFIG_H -I. -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_LIBDIR=\"/usr/local/lib/grub\" -DLOCALEDIR=\"/usr/local/share/locale\"
-DGRUB_FILE=\"grub-core/kern/device.c\" -I. -I. -I. -I. -I./include -I./include
-I./grub-core/gnulib -I./grub-core/gnulib -fno-builtin-gettext
-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra
-Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment
-Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels
-Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit
-Wimplicit-function-declaration -Wimplicit-int -Winit-self
-Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces
-Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn
-Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith
-Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare
-Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused
-Wunused-function -Wunused-label -Wunused-parameter -Wunused-value
-Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings
-Wnested-externs -Wstrict-prototypes -Wpointer-sign -Werror -Wno-undef
-Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls
-Wno-unreachable-code -Wno-conversion -Wno-old-style-definition
-Wno-unsafe-loop-optimizations -MT
grub-core/kern/libgrubkern_a-device.o -MD -MP -MF
grub-core/kern/.deps-util/libgrubkern_a-device.Tpo -c -o
grub-core/kern/libgrubkern_a-device.o `test -f 'grub-core/kern/device.c' ||
echo './'`grub-core/kern/device.c
grub-core/kern/device.c: In function 'grub_device_iterate':
grub-core/kern/device.c:178: error: trampoline code generation is not allowed
without -ftrampolines
grub-core/kern/device.c:178: error: trampoline code generation is not allowed
without -ftrampolines
gmake[2]: *** [grub-core/kern/libgrubkern_a-device.o] Error 1
So for proper compilation I _have_ to pass -ftrampolines in both CFLAGS and
TARGET_CFLAGS.
By the way, is there any way to define which GRUB modules to build?
Right now I get a compile error on squash4_module, which I'm not going to use
anyway...
The compile error is as follows:
gmake[3]: Entering directory `/data/home/ibaku/grub2/grub-2.00/grub-core'
gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -I../include -I../include
-DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -DGRUB_TARGET_CPU_I386=1 -m32
-DGRUB_FILE=\"fs/squash4.c\" -I. -I. -I.. -I.. -I../include -I../include
-I./lib/posix_wrap -I./lib/xzembed -I./lib/minilzo -DMINILZO_HAVE_CONFIG_H
-ftrampolines -fno-stack-protector -Wall -W -Wshadow -Wold-style-definition
-Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align
-Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization
-Wdiv-by-zero -Wendif-labels -Wfloat-equal -Wformat-extra-args
-Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration
-Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain
-Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute
-Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses
-Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow
-Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas
-Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value
-Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings
-Wnested-externs -Wstrict-prototypes -Wpointer-sign -g -Wredundant-decls
-Wmissing-prototypes -Wmissing-declarations -falign-jumps=1 -falign-loops=1
-falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -m32 -fno-PIE
-fno-PIC -fno-stack-protector -mno-stack-arg-probe -Wno-trampolines -mrtd
-mregparm=3 -ffreestanding -fno-builtin -Wno-undef -ftrampolines
-fno-stack-protector -MT
fs/squash4_module-squash4.o -MD -MP -MF
fs/.deps-core/squash4_module-squash4.Tpo -c -o fs/squash4_module-squash4.o
`test -f 'fs/squash4.c' || echo './'`fs/squash4.c
In file included from ./lib/posix_wrap/stdint.h:1,
from ./lib/xzembed/xz.h:27,
from fs/squash4.c:31:
./lib/posix_wrap/sys/types.h:25: error: conflicting types for 'size_t'
/usr/include/stddef.h:48: error: previous declaration of 'size_t' was here
gmake[3]: *** [fs/squash4_module-squash4.o] Error 1
gmake[3]: Leaving directory `/data/home/ibaku/grub2/grub-2.00/grub-core'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/data/home/ibaku/grub2/grub-2.00/grub-core'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/data/home/ibaku/grub2/grub-2.00'
gmake: *** [all] Error 2
Thank you!
--
Ilya
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem,
Ilya Bakulin <=
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Grégoire Sutre, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Ilya Bakulin, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/14
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Ilya Bakulin, 2013/08/16
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Grégoire Sutre, 2013/08/16
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/16
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Vladimir 'φ-coder/phcoder' Serbinenko, 2013/08/15
- Re: GRUB2 on OpenBSD 5.3-amd64: linking problem, Grégoire Sutre, 2013/08/15