Port-sparc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Error when trying to cross compile distribution



On Fri, Mar 07, 2014 at 11:24:15AM +0100, Jo?l BERTRAND wrote:
>       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.

Hmmm... I wonder where it is looking for that file.
There ought to be one for anu userspace builds.

> sed: 1: "s/@VERSION@/#": unterminated substitute in regular expression

Missing trailing '/', and sed must be picky these days.

> *** 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

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 '"') && \
            ${TOOL_SED} -e s/@VERSION@/$$V/ < ${.CURDIR}/sqlite3.pc.in \
            > ${.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: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index