[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Patch GNU libc sources with the following patch libc.diff.gz. Do
not forget to regenerate configure
.
Configure GNU libc as follows:
configure --prefix=/ --host=i386-netbsd-gnu --enable-hacker-mode \ --disable-profile |
and build and install:
gmake && gmake install install_root=/usr/velco/netbsd-gnu |
Note that the toolchain and the library are installed in different places - the toolchain host it NetBSD, while the library host is GNU/NetBSD. You'll need to make some links, in order for the compiler to be able to fund the headers and the library.
cd /usr/velco/toolchain/i386-netbsd-gnu ln -s /usr/velco/netbsd-gnu/include include mv lib/ldscripts . rm -rf lib ln -s /usr/velco/netbsd-gnu/lib lib mv ldscripts lib |
You'll want to run the GNU/NetBSD binaries under NetBSD. Set
LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/velco/netbsd-gnu/lib |
The dynamic linker is set to /lib/ld.so.1
so you need to make
this link:
ln -s /usr/velco/netbsd-gnu/lib/ld.so.1 /lib/ld.so.1 |
Fix /usr/velco/netbsd-gnu/lib/libc.so
by leaving only the
basename of the libraries.
Link /usr/include
to /include
.
ln -s /include /usr/include |
And now for the ultimate test:
$ cat > hello.c #include <stdio.h> int main () { printf ("Hello, World!\n"); return 0; } $ i386-netbsd-gnu-gcc hello.c % ./a.out Hello, World! $ |
Good, cross-compiling works !
For the GNU/NetBSD we have chosen OS id 4 for the .note-ABI
section. The ABI version is set to 1.6.0, though probably it will
work on NetBSD 1.4 kernels too. It will definitely not work on older
kernels as the Libc port uses NetBSD 1.4 syscalls.
Set the base sysdep directory and disable a sizeof check, it cannot be performed when cross compiling.
Make sure the native compiler is invoked with optimizations, or else
it chokes at certain headers with #ifndef __OPTIMIZE__
.
Work around the definition (or lack thereof) of
dl_error_catch_tsd
. It is available only when
_LIBC_REEENTRANT
is defined.
Fixed certin places, which assummed sigset_t
is a scalar type.
In several places the code refered to names in <limits.h>
,
<sys/types.h>
and <errno.h>
without including it.
[UPDATE: Well, it appears that Ulrich Drepper wants
<sys/param.h>
to include <limits.h>
, so I did it and
backed off the <limits.h>
changed above.]
errno
.
Explicit assignments to errno
replaced with __set_errno
.
The manual should always include linuxthreads.texi.
Everything under sysdeps/unix/bsd/bsd4.4/netbsd
.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |