Dennis Clarke wrote:
> On 2018-07-28 08:33, Andy Goth wrote:
>> SQLite 3.24.0 fails to build on Solaris 9 (a.k.a. Solaris 2.9)

> It may be [worth] while to spin up a Solaris 9 zone on a Solaris 10 or
> Solaris 11 server for this purpose.

I don't have access to any Solaris servers of any kind. And yet, I had the
requirement to produce a working binary for a computer I wasn't even
allowed to go visit. It was rough, but the task is done and sold off.

By the way, I've come to find out that the system in question is actually
Solaris 8, but I have to call it 9 because GCC doesn't support 8. What a
mess. I'm glad it's behind me.

> Not sure how you are getting a cross compile to work at all with just
> /usr/include on hand. Are you using the Sun Studio compilers for this ?

I'm using GCC.

When I said I had only /usr/include, I oversimplified. I have the following:

/lib (symlink to usr/lib)
/usr/include
/usr/lib
/usr/ccs/lib
/usr/local/include
/usr/local/lib
/usr/openwin/include
/usr/openwin/lib
/usr/dt/include
/usr/dt/lib

My notes say I have the next two directories as well, but my notes are
wrong:

/usr/X11/include
/usr/X11/lib

The above is all stored in a file called pkg/solaris-sysroot.tar.

Here's how I built my cross compiler:

TARGET=sparc-sun-solaris2.9 &&
tar xf pkg/binutils-2.31.tar.xz &&
tar xf pkg/gcc-4.9.4.tar.bz2 &&
sudo mkdir -p /opt/cross/sysroot/$TARGET &&
sudo tar -xf pkg/solaris-sysroot.tar -C /opt/cross/sysroot/$TARGET &&
mkdir build-binutils build-gcc &&
cd build-binutils &&
../binutils-2.31/configure -v --target=$TARGET --prefix=/opt/cross \
    --with-sysroot=/opt/cross/sysroot/$TARGET &&
make -j2 &&
sudo make install &&
cd ../build-gcc &&
../gcc-4.9.4/configure -v --target=$TARGET --prefix=/opt/cross \
    --with-sysroot=/opt/cross/sysroot/$TARGET \
    --with-gnu-as --with-gnu-ld \
    --disable-libgcj \
    --enable-languages=c,c++ --enable-obsolete &&
make -j2 &&
sudo make install &&
cd .. &&
rm -rf build-binutils build-gcc

I then built SQLite in the context of building a Tclkit basekit, and I did
that using the KitCreator script. Here are the commands relevant to SQLite:

[...]
rm -rf tcl/buildsrc/tcl8.6.9/pkgs/sqlite3.25.3 &&
tar xf ../pkg/sqlite-autoconf-3260000.tar.gz \
    sqlite-autoconf-3260000/{tea,sqlite3.{c,h}} &&
patch -d sqlite-autoconf-3260000 -p1 < ../pkg/sqlite-sunos.diff &&
mv sqlite-autoconf-3260000/tea tcl/buildsrc/tcl8.6.9/pkgs/sqlite3.26.0 &&
mv sqlite-autoconf-3260000/sqlite3.[ch] \
    tcl/buildsrc/tcl8.6.9/pkgs/sqlite3.26.0/generic &&
rm -rf sqlite-autoconf-3260000 &&
[...]

export CFLAGS=-Os CXXFLAGS=-Os

CFLAGS=-O0 CXXFLAGS=-O0 KITCREATOR_PKGS=mk4tcl ./kitcreator &&
mv tclkit-8.6.9 tclkit-local &&
export TCLKIT=$PWD/tclkit-local

TARGET=sparc-sun-solaris2.9 &&
CC=/opt/cross/bin/$TARGET-gcc \
    CXX=/opt/cross/bin/$TARGET-g++ \
    AR=/opt/cross/bin/$TARGET-ar \
    RANLIB=/opt/cross/bin/$TARGET-ranlib \
    STRIP=/opt/cross/bin/$TARGET-strip \
    KITCREATOR_PKGS="itcl mk4tcl tdom tnc" \
    ./kitcreator --host=$TARGET &&
mv tclkit-8.6.9 ../tclkit-sunos

The file "sqlite-sunos.diff" is the patch I outlined in my first email:

https://www.mail-archive.com/sqlite-users@mailinglists.sqlite.org/msg111233.html
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to