Discussion:
Error when trying to cross compile distribution
Joël BERTRAND
2014-03-07 10:24:15 UTC
Permalink
Hello,

I'm trying to cross compile -current with:
./build.sh -U -m sparc distribution

Host is linux/amd64, target is netbsd/sparc.

All tools and obj were created but ./build.sh distribution hangs with:

ln -sf libsqlite3.so.1.2 libsqlite3.so.1.tmp
mv -f libsqlite3.so.1.tmp libsqlite3.so.1
ln -sf libsqlite3.so.1.2 libsqlite3.so.tmp
mv -f libsqlite3.so.tmp libsqlite3.so
In file included from <stdin>:1:0:
/opt/home/bertrand/netbsd/src/external/public-domain/sqlite/lib/../dist/sqlite3.h:35:67:
fatal error: stdarg.h: No such file or directory
#include <stdarg.h> /* Needed for the definition of va_list */
^
compilation terminated.
sed: 1: "s/@VERSION@/#": unterminated substitute in regular expression

*** Failed target: sqlite3.pc
*** Failed command: (V=$( (echo '#include <sqlite3.h>'; echo
SQLITE_VERSION) |
/opt/home/bertrand/netbsd/src/obj/tooldir.Linux-3.12-1-amd64-x86_64/bin/sparc--netbsdelf-gcc
-E
-I/opt/home/bertrand/netbsd/src/external/public-domain/sqlite/lib/../dist -
| tail -1 | tr -d '"') &&
/opt/home/bertrand/netbsd/src/obj/tooldir.Linux-3.12-1-amd64-x86_64/bin/nbsed
-e s/@VERSION@/$V/ <
/opt/home/bertrand/netbsd/src/external/public-domain/sqlite/lib/sqlite3.pc.in
sqlite3.pc)
*** Error code 1

I have checked on releng.netbsd.org that my tree can be built without
known error.

What is my mistake ?

Best regards,

JKB
David Laight
2014-03-07 18:54:04 UTC
Permalink
Post by Joël BERTRAND
Hello,
./build.sh -U -m sparc distribution
Host is linux/amd64, target is netbsd/sparc.
ln -sf libsqlite3.so.1.2 libsqlite3.so.1.tmp
mv -f libsqlite3.so.1.tmp libsqlite3.so.1
ln -sf libsqlite3.so.1.2 libsqlite3.so.tmp
mv -f libsqlite3.so.tmp libsqlite3.so
fatal error: stdarg.h: No such file or directory
#include <stdarg.h> /* Needed for the definition of va_list */
^
compilation terminated.
Hmmm... I wonder where it is looking for that file.
There ought to be one for anu userspace builds.
Missing trailing '/', and sed must be picky these days.
Post by Joël BERTRAND
*** Failed target: sqlite3.pc
*** Failed command: (V=$( (echo '#include <sqlite3.h>'; echo
SQLITE_VERSION) |
/opt/home/bertrand/netbsd/src/obj/tooldir.Linux-3.12-1-amd64-x86_64/bin/sparc--netbsdelf-gcc
-E
-I/opt/home/bertrand/netbsd/src/external/public-domain/sqlite/lib/../dist -
| tail -1 | tr -d '"') &&
/opt/home/bertrand/netbsd/src/obj/tooldir.Linux-3.12-1-amd64-x86_64/bin/nbsed
/opt/home/bertrand/netbsd/src/external/public-domain/sqlite/lib/sqlite3.pc.in
sqlite3.pc)
*** Error code 1
The makefile actually contains:

sqlite3.pc: ${SRCDIR}/sqlite3.h sqlite3.pc.in
@(V=$$( (echo '#include <sqlite3.h>'; echo SQLITE_VERSION) | \
${CC} -E -I${SRCDIR} - | tail -1 | tr -d '"') && \
Post by Joël BERTRAND
${.TARGET})
So we are feeding the two lines:
#include <sqlite3.h>
SQLITE_VERSION
into cc -E and then assuming that the last line is the expanded version.
This is is cross build compiler, I wonder it this is being run before
the includes are 'installed'.

Since it doesn't find stdarg.h the compile fails and the last line must
be a line staring with a '#' (eg "# fubar").
The sed command isn't quoted (to the shell) so the output of $V is subject
to field splitting and generates multiple arments to sed, the first of
which is an incomplete sunstitution.

So we have four problems:

1) The compiler fails to find stdarg.h
2) The command line blindly assumes that 'tail -1' will give the right
line.
3) The sed command doesn't quote its arguments.
4) The makefile doesn't detect errors in the sub commands.

Dunno why your system is that different!

David

David
--
David Laight: ***@l8s.co.uk
Joël BERTRAND
2014-03-11 12:11:36 UTC
Permalink
Hello,

After a CVS update, cross compilation fails with another error in gcc :

...
config.status: creating as
config.status: creating collect-ld
config.status: creating nm
config.status: creating Makefile
config.status: creating auto-host.h
config.status: executing default commands
# compile backend/gengenrtl.lo
c++ -O -I.
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/usr.bin/backend/../gcc/arch/sparc
-DIN_GCC -DHAVE_CONFIG_H
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/.
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/../include
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/../libcpp/include
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/../libdecnumber
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/../libdecnumber/dpd
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/../libbacktrace
-DGENERATOR_FILE
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/usr.bin/backend/.. -c
-o gengenrtl.lo.o
/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/gengenrtl.c
In file included from
/opt/home/bertrand/netbsd/src/external/gpl3/gcc/usr.bin/backend/../gcc/arch/sparc/bconfig.h:7:0,
from
/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/gengenrtl.c:21:
./auto-build.h:2000:16: error: declaration does not declare anything
[-fpermissive]
#define rlim_t long
^
In file included from
/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/gengenrtl.c:22:0:
/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/system.h:446:23: error:
declaration of C function 'void* sbrk(int)' conflicts with
extern void *sbrk (int);
^
In file included from
/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/system.h:256:0,
from
/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/gengenrtl.c:22:
/usr/include/unistd.h:1065:14: error: previous declaration 'void*
sbrk(intptr_t)' here
extern void *sbrk (intptr_t __delta) __THROW;
...
*** Failed target: gengenrtl.lo
*** Failed command: c++ -O -I.
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/usr.bin/backend/../gcc/arch/sparc
-DIN_GCC -DHAVE_CONFIG_H
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/.
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/../include
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/../libcpp/include
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/../libdecnumber
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/../libdecnumber/dpd
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/../libbacktrace
-DGENERATOR_FILE
-I/opt/home/bertrand/netbsd/src/external/gpl3/gcc/usr.bin/backend/.. -c
-o gengenrtl.lo.o
/opt/home/bertrand/netbsd/src/external/gpl3/gcc/dist/gcc/gengenrtl.c
*** Error code 1

Stop.
nbmake[8]: stopped in
/opt/home/bertrand/netbsd/src/external/gpl3/gcc/usr.bin/backend


I'm trying to crosscompile netbsd as I see a lot of data corruption on
my SS20 running 6.99.36 :

- ESP resets ;
- ffs corruptions ;
- panics that seems to be ffs related :

sd0(esp0:0:1:0): esp0: timed out [ecb 0xf1101e70 (flags 0x1, dleft 4000,
stat 0>
sd0(esp0:0:1:0): esp0: timed out [ecb 0xf1101e70 (flags 0x41, dleft
4000, stat N
sd0: async, 8-bit transfers
sd1: async, 8-bit transfers
cd0: async, 8-bit transfers
dev = 0x706, block = 6300793, fs = /usr
panic: blkfree: freeing free frag
cpu1: Begin traceback...
0x0(0xf03aca48, 0xf9fe5a10, 0xf0466c00, 0xf0467b18, 0xf0467c00, 0x104)
at netbs0
panic(0xf03aca48, 0x0, 0x706, 0x0, 0x602479, 0xf0441800) at
netbsd:ffs_blkfree_4
ffs_blkfree_common.isra.5(0xf111a654, 0xf11e2800, 0x1561, 0x1561, 0x0,
0x6024798
ffs_blkfree_cg(0xf11e2800, 0xf123cb10, 0x0, 0x602479, 0x800, 0x0) at
netbsd:ffs4
ffs_truncate(0x800, 0xf195ec70, 0x0, 0x0, 0xffffffff, 0xffffffff) at
netbsd:ufs4
ufs_inactive(0x0, 0xf120f000, 0xf11cbaa0, 0x0, 0x1e4000e7, 0xf044adc0)
at netbs0
VOP_INACTIVE(0xf195ec70, 0xf9fe5d4f, 0xf11cbaa0, 0xf0002000, 0x1e4000e0,
0xf0eec
vrelel(0xf195ec70, 0x0, 0xf11cbaa0, 0xf0002000, 0xf195ec84, 0x1) at
netbsd:ufs_c
ufs_remove(0x0, 0xf1978000, 0xf195fc18, 0xf9fe5e10, 0xf195ec70,
0xf19794d8) at 4
VOP_REMOVE(0xf19794d8, 0xf195ec70, 0xf9fe5eb0, 0x0, 0x0, 0xffffff9c) at
netbsd:c
do_sys_unlinkat.isra.3(0xffffff9c, 0xedb115dc, 0x0, 0xf195ec70, 0x14,
0xf192240c
syscall(0xc0a, 0xf9fe5fb0, 0xedda1f58, 0xa, 0x4e, 0xf11cbaa0) at
netbsd:memfaul8
cpu1: End traceback...

Regards,

JKB

Loading...