* [Buildroot] elf2flt blues
@ 2012-03-15 13:44 Erland Lewin
2012-03-18 15:35 ` [Buildroot] [PATCH] elf2flt: fix after conversion of binutils to package infrastructure Arnout Vandecappelle
0 siblings, 1 reply; 6+ messages in thread
From: Erland Lewin @ 2012-03-15 13:44 UTC (permalink / raw)
To: buildroot
Hello,
I'm trying to build buildroot for the Olimex LPC2478-STK development
card<http://www.olimex.com/dev/lpc-2478stk.html>(with an arm7TDMI
core), for a patched Linux-2.6.24 kernel that came with
the card.
I'm having lots of problems, and would really appreciate it if someone
could point me in the right direction.
I managed to build buildroot, but then it failed to execute on the board,
and I think it because the kernel only supports BFLT, not ELF.
So I selected 'elf2flt support?' in the Buildroot 2012.02 configurator.
Should I have to do something else to have elf2flt automatically run during
linking?
I have a problem linking elf2flt:
gcc -g -O2 -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\"
> -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\"
> -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
> -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1
> -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_UNISTD_H=1
> -DHAVE_BFD_H=1 -DTARGET_arm -I/bfd/
> -I/home/erl/src/LPC2478/buildroot-2012.02/output/build/binutils-2.21.1/include/
> -lz -o flthdr
> /home/erl/src/LPC2478/buildroot-2012.02/output/toolchain/elf2flt/flthdr.c
> /bfd/libbfd.a /libiberty/libiberty.a
> gcc: /bfd/libbfd.a: No such file or directory
> gcc: /libiberty/libiberty.a: No such file or directory
> gcc: /bfd/libbfd.a: No such file or directory
> gcc: /libiberty/libiberty.a: No such file or directory
elf2flt was configured with:
rm -rf config.cache; \
> LDFLAGS=-lz \
> /home/erl/src/LPC2478/buildroot-2012.02/output/toolchain/elf2flt/configure
> \
> --with-bfd-include-dir=/bfd/ \
> --with-binutils-include-dir=/home/erl/src/LPC2478/buildroot-2012.02/output/build/binutils-2.21.1/include/
> \
> --target=arm-unknown-linux-uclibcgnueabi \
> --with-libbfd=/bfd/libbfd.a \
> --with-libiberty=/libiberty/libiberty.a \
>
> --prefix=/home/erl/src/LPC2478/buildroot-2012.02/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr
I see that I have four different versions of libbfd.a:
./output/target/usr/lib/libbfd.a
./output/build/binutils-2.21.1/bfd/libbfd.a
./output/build/host-binutils-2.21.1/bfd/libbfd.a
./output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/lib/libbfd.a
I try to rerun configure manually with:
./configure '--with-libbfd=../../build/host-binutils-2.21.1/bfd/libbfd.a'
> '--with-bfd-include-dir=../../build/host-binutils-2.21.1/bfd'
> '--with-libiberty=../../host/usr/lib/libiberty.a'
> '--prefix=/home/erl/src/LPC2478/buildroot-2012.02/output/host/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr'
> 'LDFLAGS=-lz' 'target_alias=arm-unknown-linux-uclibcgnueabi'
Note that I also seem to have had to add a target_alias flag.
I succeed in building elf2flt. When I try to run it manually on my busybox
executable, I get:
$ ./elf2flt -v ../../target/bin/busybox -o ./busybox
> ../../target/bin/busybox: Input file contains no relocation info
After googling, I think I have to build all apps with the '-r' flag to gcc
to add relocation info (see
http://www.mail-archive.com/uclinux-dev at uclinux.org/msg00659.html).
I'm not sure where to add the '-r' in the buildroot configurator, so I
added it after '-pipe' in BR2_TARGET_OPTIMIZATION.
I then get an error building busybox:
/home/erl/src/LPC2478/buildroot-2012.02/output/host/usr/lib/gcc/arm-unknown-linux-uclibcgnueabi/4.5.3/../../../../arm-unknown-linux-uclibcgnueabi/bin/ld:
> gc-sections requires either an entry or an undefined symbol
I commented out -gc-sections from scripts/trylink and rebuilt.
I now get errors building binutils:
> /home/erl/src/LPC2478/buildroot-2012.02/output/host/usr/bin/arm-unknown-linux-uclibcgnueabi-gcc
> -c -DHAVE_CONFIG_H -pipe -r -Os -I. -I./../include -W -Wall
> -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic -fPIC
> ./pex-common.c -o pic/pex-common.o; \
> else true; fi
> ./physmem.c: In function 'physmem_total':
> ./physmem.c:96:23: error: storage size of 'pss' isn't known
> ./physmem.c:97:5: warning: implicit declaration of function
> 'pstat_getstatic'
> ./physmem.c:96:23: warning: unused variable 'pss'
> ./physmem.c: In function 'physmem_available':
> ./physmem.c:200:23: error: storage size of 'pss' isn't known
> ./physmem.c:201:24: error: storage size of 'psd' isn't known
> ./physmem.c:203:2: warning: implicit declaration of function
> 'pstat_getdynamic'
> ./physmem.c:201:24: warning: unused variable 'psd'
> ./physmem.c:200:23: warning: unused variable 'pss'
> make[3]: *** [physmem.o] Error 1
I think I'll start over and rebuild it from scratch (the third time). I'd
appreciate any hints.
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120315/35e6fbe6/attachment-0001.html>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] elf2flt: fix after conversion of binutils to package infrastructure
2012-03-15 13:44 [Buildroot] elf2flt blues Erland Lewin
@ 2012-03-18 15:35 ` Arnout Vandecappelle
2012-03-18 15:58 ` Thomas Petazzoni
2012-03-18 19:47 ` Peter Korsgaard
0 siblings, 2 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2012-03-18 15:35 UTC (permalink / raw)
To: buildroot
When binutils was converted to the package infrastructure (commit
009407e6b), the variable that elf2flt uses to find the binutils
libraries disappeared. So use HOST_BINUTILS_DIR instead of
BINUTILS_DIR1.
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
Note that elf2flt has been broken for one and a half years now before
anybody has complained about it...
Probably it should be converted to autotargets as well. However, I
don't know how to test if the resulting tool still works.
toolchain/elf2flt/elf2flt.mk | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/toolchain/elf2flt/elf2flt.mk b/toolchain/elf2flt/elf2flt.mk
index e74a655..84a2c01 100644
--- a/toolchain/elf2flt/elf2flt.mk
+++ b/toolchain/elf2flt/elf2flt.mk
@@ -21,12 +21,12 @@ $(ELF2FLT_DIR)/.configured: $(ELF2FLT_DIR)/.patched
(cd $(ELF2FLT_DIR); rm -rf config.cache; \
LDFLAGS=-lz \
$(ELF2FLT_DIR)/configure $(QUIET) \
- --with-bfd-include-dir=$(BINUTILS_DIR1)/bfd/ \
- --with-binutils-include-dir=$(BINUTILS_DIR)/include/ \
+ --with-bfd-include-dir=$(HOST_BINUTILS_DIR)/bfd/ \
+ --with-binutils-include-dir=$(HOST_BINUTILS_DIR)/include/ \
--target=$(REAL_GNU_TARGET_NAME) \
- --with-libbfd=$(BINUTILS_DIR1)/bfd/libbfd.a \
- --with-libiberty=$(BINUTILS_DIR1)/libiberty/libiberty.a \
- --prefix=$(STAGING_DIR)/usr)
+ --with-libbfd=$(HOST_BINUTILS_DIR)/bfd/libbfd.a \
+ --with-libiberty=$(HOST_BINUTILS_DIR)/libiberty/libiberty.a \
+ --prefix=$(HOST_DIR)/usr)
touch $@
$(ELF2FLT_DIR)/$(ELF2FLT_BINARY): $(ELF2FLT_DIR)/.configured
--
tg: (ccb44fd..) t/elf2flt (depends on: master)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] elf2flt: fix after conversion of binutils to package infrastructure
2012-03-18 15:35 ` [Buildroot] [PATCH] elf2flt: fix after conversion of binutils to package infrastructure Arnout Vandecappelle
@ 2012-03-18 15:58 ` Thomas Petazzoni
2012-03-18 19:47 ` Peter Korsgaard
2012-03-18 19:47 ` Peter Korsgaard
1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2012-03-18 15:58 UTC (permalink / raw)
To: buildroot
Le Sun, 18 Mar 2012 16:35:58 +0100,
"Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be> a ?crit :
> Probably it should be converted to autotargets as well. However, I
> don't know how to test if the resulting tool still works.
I have started setting up an environment for a noMMU ARM kernel and
userspace that runs under the SkyEye emulator. I intend to clean this
up and make it available as a defconfig so that we have at least one
noMMU environment we can use for testing.
So far I have something that boots into a Busybox userspace, but it is
built with the Soucery CodeBench uClinux toolchain. I think I will
clean it up as is, we can see later if the internal toolchain backend
works to build a correct toolchain for this usecase.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] elf2flt: fix after conversion of binutils to package infrastructure
2012-03-18 15:58 ` Thomas Petazzoni
@ 2012-03-18 19:47 ` Peter Korsgaard
2012-03-18 22:30 ` Thomas Petazzoni
0 siblings, 1 reply; 6+ messages in thread
From: Peter Korsgaard @ 2012-03-18 19:47 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
Hi,
>> Probably it should be converted to autotargets as well. However, I
>> don't know how to test if the resulting tool still works.
Thomas> I have started setting up an environment for a noMMU ARM kernel and
Thomas> userspace that runs under the SkyEye emulator. I intend to clean this
Thomas> up and make it available as a defconfig so that we have at least one
Thomas> noMMU environment we can use for testing.
Thomas> So far I have something that boots into a Busybox userspace, but it is
Thomas> built with the Soucery CodeBench uClinux toolchain. I think I will
Thomas> clean it up as is, we can see later if the internal toolchain backend
Thomas> works to build a correct toolchain for this usecase.
Great, sounds good. I don't have any experience with skyeye, any
specific reasons to use that instead of qemu?
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] elf2flt: fix after conversion of binutils to package infrastructure
2012-03-18 15:35 ` [Buildroot] [PATCH] elf2flt: fix after conversion of binutils to package infrastructure Arnout Vandecappelle
2012-03-18 15:58 ` Thomas Petazzoni
@ 2012-03-18 19:47 ` Peter Korsgaard
1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2012-03-18 19:47 UTC (permalink / raw)
To: buildroot
>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:
Arnout> When binutils was converted to the package infrastructure (commit
Arnout> 009407e6b), the variable that elf2flt uses to find the binutils
Arnout> libraries disappeared. So use HOST_BINUTILS_DIR instead of
Arnout> BINUTILS_DIR1.
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] elf2flt: fix after conversion of binutils to package infrastructure
2012-03-18 19:47 ` Peter Korsgaard
@ 2012-03-18 22:30 ` Thomas Petazzoni
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2012-03-18 22:30 UTC (permalink / raw)
To: buildroot
Hello,
Le Sun, 18 Mar 2012 20:47:14 +0100,
Peter Korsgaard <jacmet@uclibc.org> a ?crit :
> Great, sounds good. I don't have any experience with skyeye, any
> specific reasons to use that instead of qemu?
I might have missed something, but I haven't found any of the ARM
platforms emulated by Qemu to be noMMU platforms. I have tried to build
a kernel for the Versatile platform with MMU disabled, but the build
fails. It seems that the kernel does not support to be built for any
platform with MMU disabled, though I might be wrong. If anyone knows
about one of the ARM platforms supported by Qemu to be supported in a
noMMU variant by the kernel, that would be nice.
I have also started to build a m68k kernel. This one starts booting in
Qemu, but the boot hangs with an "attempted to kill idle" panic.
Best regards,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-03-18 22:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-15 13:44 [Buildroot] elf2flt blues Erland Lewin
2012-03-18 15:35 ` [Buildroot] [PATCH] elf2flt: fix after conversion of binutils to package infrastructure Arnout Vandecappelle
2012-03-18 15:58 ` Thomas Petazzoni
2012-03-18 19:47 ` Peter Korsgaard
2012-03-18 22:30 ` Thomas Petazzoni
2012-03-18 19:47 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox