MTD build failing: undefined ref's to bcopy, bcmp
The u-boot-env-tools-on-target build was failing because mtd.h wasn't found, so in an attempt to fix that I tried selecting BR2_PACKAGE_MTD and BR2_PACKAGE_MTD_UTILS. Now that's failing to build because of undefined references to bcopy, bcmp, bzero (make output below).
Is there a trick to get mtd stuff to build?
Is BR2_PACKAGE_MTD/BR2_PACKAGE_MTD_UTILS actually what I need to provide mtd.h for building the u-boot env set/get target tools, or does mtd.h come from somewhere else?
[...]
/usr/bin/make -j2 CFLAGS="-I. -I./include -I/home/nextgen/buildroot/buildroot/output/toolchain/linux/include -I/home/nextgen/buildroot/buildroot/output/staging/usr/include -Os -pipe -O2 --sysroot /home/nextgen/buildroot/buildroot/output/staging/" \
LDFLAGS="--sysroot /home/nextgen/buildroot/buildroot/output/staging/" \
BUILDDIR=/home/nextgen/buildroot/buildroot/output/build/mtd_orig \
CROSS=/home/nextgen/buildroot/toolchain/usr/bin/arm-linux- CC=/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc LINUXDIR=/home/nextgen/buildroot/buildroot/output/build/linux-2.6.28.2 WITHOUT_XATTR=1 -C /home/nextgen/buildroot/buildroot/output/build/mtd_orig
make[1]: Entering directory `/home/nextgen/buildroot/buildroot/output/build/mtd_orig'
mkdir -p /home/nextgen/buildroot/buildroot/output/build/mtd_orig
[...]
mkdir -p /home/nextgen/buildroot/buildroot/output/build/mtd_orig
/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc -I./include -DWITHOUT_XATTR -I. -I./include -I/home/nextgen/buildroot/buildroot/output/toolchain/linux/include -I/home/nextgen/buildroot/buildroot/output/staging/usr/include -Os -pipe -O2 --sysroot /home/nextgen/buildroot/buildroot/output/staging/ -c -o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/serve_image.o serve_image.c -g -Wp,-MD,/home/nextgen/buildroot/buildroot/output/build/mtd_orig/.serve_image.c.dep
mkdir -p /home/nextgen/buildroot/buildroot/output/build/mtd_orig
/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc -I./include -DWITHOUT_XATTR -I. -I./include -I/home/nextgen/buildroot/buildroot/output/toolchain/linux/include -I/home/nextgen/buildroot/buildroot/output/staging/usr/include -Os -pipe -O2 --sysroot /home/nextgen/buildroot/buildroot/output/staging/ -c -o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.o fec.c -g -Wp,-MD,/home/nextgen/buildroot/buildroot/output/build/mtd_orig/.fec.c.dep
fec.c: In function 'invert_mat':
fec.c:436: warning: incompatible implicit declaration of built-in function 'bzero'
fec.c: In function 'fec_new':
fec.c:707: warning: incompatible implicit declaration of built-in function 'bzero'
fec.c: In function 'fec_encode':
fec.c:734: warning: incompatible implicit declaration of built-in function 'bcopy'
fec.c:737: warning: incompatible implicit declaration of built-in function 'bzero'
fec.c: In function 'fec_encode_linear':
fec.c:754: warning: incompatible implicit declaration of built-in function 'bcopy'
fec.c:757: warning: incompatible implicit declaration of built-in function 'bzero'
fec.c: In function 'build_decode_matrix':
fec.c:817: warning: incompatible implicit declaration of built-in function 'bzero'
fec.c:822: warning: incompatible implicit declaration of built-in function 'bcopy'
fec.c: In function 'fec_decode':
fec.c:873: warning: incompatible implicit declaration of built-in function 'bzero'
fec.c:883: warning: incompatible implicit declaration of built-in function 'bcopy'
mkdir -p /home/nextgen/buildroot/buildroot/output/build/mtd_orig
/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc -I./include -DWITHOUT_XATTR -I. -I./include -I/home/nextgen/buildroot/buildroot/output/toolchain/linux/include -I/home/nextgen/buildroot/buildroot/output/staging/usr/include -Os -pipe -O2 --sysroot /home/nextgen/buildroot/buildroot/output/staging/ -c -o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/recv_image.o recv_image.c -g -Wp,-MD,/home/nextgen/buildroot/buildroot/output/build/mtd_orig/.recv_image.c.dep
mkdir -p /home/nextgen/buildroot/buildroot/output/build/mtd_orig
/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc -I./include -DWITHOUT_XATTR -I. -I./include -I/home/nextgen/buildroot/buildroot/output/toolchain/linux/include -I/home/nextgen/buildroot/buildroot/output/staging/usr/include -Os -pipe -O2 --sysroot /home/nextgen/buildroot/buildroot/output/staging/ -c -o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/sumtool.o sumtool.c -g -Wp,-MD,/home/nextgen/buildroot/buildroot/output/build/mtd_orig/.sumtool.c.dep
/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc -I. -I./include -I/home/nextgen/buildroot/buildroot/output/toolchain/linux/include -I/home/nextgen/buildroot/buildroot/output/staging/usr/include -Os -pipe -O2 --sysroot /home/nextgen/buildroot/buildroot/output/staging/ --sysroot /home/nextgen/buildroot/buildroot/output/staging/ -g -o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/ftl_format /home/nextgen/buildroot/buildroot/output/build/mtd_orig/ftl_format.o
[...]
/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc -I. -I./include -I/home/nextgen/buildroot/buildroot/output/toolchain/linux/include -I/home/nextgen/buildroot/buildroot/output/staging/usr/include -Os -pipe -O2 --sysroot /home/nextgen/buildroot/buildroot/output/staging/ --sysroot /home/nextgen/buildroot/buildroot/output/staging/ -g -o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/rfdformat /home/nextgen/buildroot/buildroot/output/build/mtd_orig/rfdformat.o
/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc --sysroot /home/nextgen/buildroot/buildroot/output/staging/ -o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/serve_image /home/nextgen/buildroot/buildroot/output/build/mtd_orig/serve_image.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/crc32.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.o
/home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.o: In function `fec_encode_linear':
/home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.c:754: undefined reference to `bcopy'
/home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.o: In function `fec_encode':
/home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.c:734: undefined reference to `bcopy'
/home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.o: In function `build_decode_matrix':
/home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.c:822: undefined reference to `bcopy'
/home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.o: In function `invert_mat':
/home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.c:516: undefined reference to `bcmp'
/home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.o: In function `fec_decode':
/home/nextgen/buildroot/buildroot/output/build/mtd_orig/fec.c:883: undefined reference to `bcopy'
collect2: ld returned 1 exit status
make[1]: *** [/home/nextgen/buildroot/buildroot/output/build/mtd_orig/serve_image] Error 1
make[1]: *** Waiting for unfinished jobs....
rm /home/nextgen/buildroot/buildroot/output/build/mtd_orig/nandwrite.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/mtd_debug.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/ftl_format.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/flash_otp_dump.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/rfdformat.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/nftldump.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/flash_unlock.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/flash_lock.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/flashcp.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/nftl_format.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/doc_loadbios.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/flash_erase.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/flash_otp_info.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/rfddump.o /home/nextgen/b
uildroot/buildroot/output/build/mtd_orig/nandtest.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/nanddump.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/docfdisk.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/flash_info.o /home/nextgen/buildroot/buildroot/output/build/mtd_orig/ftl_check.o
make[1]: Leaving directory `/home/nextgen/buildroot/buildroot/output/build/mtd_orig'
make: *** [/home/nextgen/buildroot/buildroot/output/build/mtd_orig/flash_erase] Error 2
Signature · 3 lines
Grant Edwards grante Yow! Loni Anderson's hair
at should be LEGALIZED!!
visi.com Quoted 7 lines · Grant Edwards
The u-boot-env-tools-on-target build was failing because
mtd.hwasn't found, so in an attempt to fix that I tried selectingBR2_PACKAGE_MTDandBR2_PACKAGE_MTD_UTILS. Now that's failing to build because of undefined references to bcopy, bcmp, bzero (make output below).Is there a trick to get mtd stuff to build?
Found it:
https://bugs.uclibc.org/show_bug.cgi?id=841
I'm getting the feeling tht I should have stuck with the last release instead of using HEAD. So far the number of packages that won't build cleanly is at 4 and counting.
Quoted 3 lines
Is BR2_PACKAGE_MTD/BR2_PACKAGE_MTD_UTILS actually what I need to provide
mtd.hfor building the u-boot env set/get target tools, or doesmtd.hcome from somewhere else?
Still working on that one.
Signature · 1 line
Grant
Quoted 4 lines · Grant Edwards
Quoted 4 lines
Is BR2_PACKAGE_MTD/BR2_PACKAGE_MTD_UTILS actually what I need to provide
mtd.hfor building the u-boot env set/get target tools, or doesmtd.hcome from somewhere else?
It's actually mtd/mtd-user.h that's missing. It looks like it should come from the kernel headers. It's there in the kernel source tree (and in /usr/include on my development hosts), but it's missing from the toolchain's usr/include directory.
How do you get mtd/*.h header files included in /usr/include when the toolchain is built?
Signature · 1 line
Grant
Quoted 7 lines · Grant Edwards
The u-boot-env-tools-on-target build was failing because
mtd.hwasn't found, so in an attempt to fix that I tried selectingBR2_PACKAGE_MTDandBR2_PACKAGE_MTD_UTILS. Now that's failing to build because of undefined references to bcopy, bcmp, bzero (make output below).Is there a trick to get mtd stuff to build?
I patched the bug in the mtd package so it's now building, but it won't run:
# flash_info flash_info: can't load library 'libgcc_s.so.1'
libgcc_s.so.1 appears in the staging directory,
$ find . -name libgcc_s* ./output/staging/usr/arm-linux-uclibc/lib/libgcc_s.so ./output/staging/usr/arm-linux-uclibc/lib/libgcc_s.so.1
but it's not present in the target filesystem.
Am I having all of these problem becuase I shouldn't be using HEAD, or am I doing something else wrong?
Signature · 3 lines
Grant Edwards grante Yow! There's enough money
at here to buy 5000 cans of
visi.com Noodle-Roni!Le Thu, 7 Jan 2010 17:02:31 +0000 (UTC), Grant Edwards <[email protected]> a ?crit :
Quoted 6 lines
I patched the bug in the mtd package so it's now building, but it won't run:
# flash_info flash_info: can't load library 'libgcc_s.so.1'
Quoted 7 lines
libgcc_s.so.1 appears in the staging directory,
$ find . -name libgcc_s* ./output/staging/usr/arm-linux-uclibc/lib/libgcc_s.so ./output/staging/usr/arm-linux-uclibc/lib/libgcc_s.so.1but it's not present in the target filesystem.
Are you using a buildroot-generated toolchain or an external toolchain ?
Quoted 2 lines
Am I having all of these problem becuase I shouldn't be using HEAD, or am I doing something else wrong?
The MTD utils package has very recently been updated into HEAD, which might explain why you're encountering so many failures.
http://git.buildroot.net/buildroot/commit/?id=9400c73582326c543fae82120af3904836145655
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Quoted 11 lines · Thomas Petazzoni
Le Thu, 7 Jan 2010 17:02:31 +0000 (UTC), Grant Edwards <[email protected]> a ??crit :
Quoted 8 lines
I patched the bug in the mtd package so it's now building, but it won't run:
# flash_info flash_info: can't load library 'libgcc_s.so.1'libgcc_s.so.1 appears in the staging directory,
Quoted 7 lines
Quoted 5 lines
$ find . -name libgcc_s* ./output/staging/usr/arm-linux-uclibc/lib/libgcc_s.so ./output/staging/usr/arm-linux-uclibc/lib/libgcc_s.so.1but it's not present in the target filesystem.
Are you using a buildroot-generated toolchain or an external toolchain ?
Yes. :)
It's an external toolchain that was generated by buildtoot.
I can try using an "internal" toolchain, but that approach really slows down work since each "guess" takes 40-50 minutes instead of 10-12.
Quoted 9 lines
Quoted 2 lines
Am I having all of these problem becuase I shouldn't be using HEAD, or am I doing something else wrong?
The MTD utils package has very recently been updated into HEAD, which might explain why you're encountering so many failures.
http://git.buildroot.net/buildroot/commit/?id=9400c73582326c543fae82120af3904836145655
Thomas
Signature · 4 lines
Grant Edwards grante Yow! Gee, I feel kind of
at LIGHT in the head now,
visi.com knowing I can't make my
satellite dish PAYMENTS!Quoted 16 lines · Grant Edwards
Quoted 15 lines · Thomas Petazzoni
Le Thu, 7 Jan 2010 17:02:31 +0000 (UTC), Grant Edwards <[email protected]> a ??crit :
Quoted 12 lines
I patched the bug in the mtd package so it's now building, but it won't run:
# flash_info flash_info: can't load library 'libgcc_s.so.1'libgcc_s.so.1 appears in the staging directory,
$ find . -name libgcc_s* ./output/staging/usr/arm-linux-uclibc/lib/libgcc_s.so ./output/staging/usr/arm-linux-uclibc/lib/libgcc_s.so.1
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
but it's not present in the target filesystem.
Are you using a buildroot-generated toolchain or an external toolchain ?
Yes. :)
It's an external toolchain that was generated by buildtoot.
The problem is that buildroot expects to find libgcc, libstdc++, et al in $(SYSROOT)/lib
That's not where buildroot puts them.
Buildroot puts them in $(SYSROOT)/usr/arm-linux-uclibc/lib
Apparently, toolchains built by Buildroot aren't suitable for use as external toolchains without some post-build massaging.
Signature · 3 lines
Grant Edwards grante Yow! I brought my BOWLING
at BALL -- and some DRUGS!!
visi.com Le Thu, 7 Jan 2010 22:30:30 +0000 (UTC), Grant Edwards <[email protected]> a ?crit :
Quoted 2 lines
The problem is that buildroot expects to find libgcc, libstdc++, et al in $(SYSROOT)/lib
Yes. I have a fix in one of my branches that fixes this. But it's part of a set of fixes designed to get Codesourcery toolchains to work in Buildroot, which doesn't work yet (see my mail on this topic a few days ago).
(but it's not ready for inclusion yet)
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Grant" == Grant Edwards <[email protected]> writes:
Grant> The u-boot-env-tools-on-target build was failing because mtd.h Grant> wasn't found, so in an attempt to fix that I tried selecting Grant> BR2_PACKAGE_MTD and BR2_PACKAGE_MTD_UTILS. Now that's failing Grant> to build because of undefined references to bcopy, bcmp, bzero Grant> (make output below).
Grant> Is there a trick to get mtd stuff to build?
Yes, we need a workaround similar to what we are doing for mtd-utils.git. I've checked in a fix for this earlier tonight.
This broke when we updated to mtd-tuils 1.2.0. I'll update to 1.3.1 tomorrow after a bit of testing.
Grant> Is BR2_PACKAGE_MTD/BR2_PACKAGE_MTD_UTILS actually what I need Grant> to provide mtd.h for building the u-boot env set/get target Grant> tools, or does mtd.h come from somewhere else?
No, mtd.h normally comes from your kernel headers.
Signature · 1 line
Bye, Peter Korsgaard