Subject: Re: interix bootstrap problems with workarounds
To: None <tech-pkg@NetBSD.org>
From: Amitai Schlair <schmonz@schmonz.com>
List: tech-pkg
Date: 06/07/2006 14:16:43
Ben Collver wrote:

> (1) cc did not work, resolved with brute admin force:
> 
> cd /dev/fs/C/SFU/bin
> mv cc cc.orig
> mv c89 c89.orig
> cd /opt/gcc.3.3/bin
> ln -s gcc cc
> cd /usr/share/mk
> cp sys.mk sys.mk.orig
> sed <sys.mk.orig >sys.mk -e 's,^CC=c89,CC=gcc,' -e 's,^CFLAGS=.*,CFLAGS=-D_ALL_SOURCE,'

I left this as is.

> (2) On Interix, bmake does not set MAKEFILE, which tickles the bmake regression tests.
> 
> bmake/main.c:1139
> #ifdef __INTERIX
>                 /*
>                  * XXX Hack from tv:
>                  * This system has broken filesystem support - can't
>                  * always distinguish b/w [Mm]akefile.
>                  */
>                 setMAKEFILE = FALSE;
> 
> Resolved this with more brute force:
> cd /usr/pkgsrc/devel
> cp -Rp bmake bmake-interix
> cd bmake-interix/files
> cp Makefile.in Makefile.in.orig
> # in the next line, that is a tab, not spaces.. you may need to press Ctrl-V before pressing Tab
> sed <Makefile.in.orig >Makefile.in -e "s,^	cd,#	cd,"
> cd /usr/pkgsrc/bootstrap
> cp bootstrap bootstrap.orig
> sed <bootstrap.orig >bootstrap -e 's,devel/bmake,devel/bmake-interix,'

I needed to do this.

> (3) Pax build broken when tape support is disabled.
> 
> in pax.h, ISTAPE is only defined if SUPPORT_TAPE is defined:
> #ifdef SUPPORT_TAPE
> #define ISTAPE          3       /* tape drive */
> #endif
> 
> in ar_io.c, ISTAPE is used even when SUPPORT_TAPE is undefined, which guarantees an error:
>         case ISTAPE:
> #ifdef SUPPORT_TAPE
> ...
>         case ISTAPE:
> #ifdef SUPPORT_RMT
>         case ISRMT:
> #endif /* SUPPORT_RMT */
> #ifdef SUPPORT_TAPE
> ...
> 
> Resolved this with more brute force:
> cd /usr/pkgsrc/archivers
> cp -Rp pax pax-interix
> cd pax-interix/files
> cp ar_io.c ar_io.c.orig
> ed ar_io.c
> 1027m1028
> 1242m1246
> wq
> cd /usr/pkgsrc/bootstrap
> sed <bootstrap.orig >bootstrap -e 's,devel/bmake,devel/bmake-interix,' -e 's,archivers/pax,archivers/pax-interix,'

This looked necessary, so I didn't try bootstrapping without it.

On Windows XP with Service Pack 2, I also had to provide the argument 
"/noexecute=AlwaysOff" in boot.ini and reboot, which disables Data 
Execution Prevention. Before I did this, gcc would always segv.