tech-toolchain archive

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

Re: Cross Compile NetBSD on OpenBSD



On Fri, Mar 06, 2009 at 09:21:00PM +0200, Alan Barrett wrote:
> On Sat, 31 Jan 2009, Alexander Bluhm wrote:
> > With these tiny changes I am able to build the NetBSD toolchain on
> > OpenBSD.  Both are i386, I have not tested other architectures.
> > Kernel compiles and runs, I have not tried userland yet.
> 
> I didn't ever get answers to my questions, but I have committed some
> changes to NetBSD-current that should resolve all these issues.  Please
> let us know if there's still a problem.

Your commits work fine for me.  I can cross-compile a NetBSD kernel
with OpenBSD.

But there is a new issue that has been commited into make recently.
The SIGINFO handler calls the function getprogname() which exists
only in NetBSD.  Luckily in other places of make, the variable
progname is used for that purpose.  So it is even more consistent
to use that global variable everywhere.  Just make sure, that the
signal handler is installed after the variable has been initialized.

bluhm


Index: usr.bin/make/main.c
===================================================================
RCS file: /data/mirror/netbsd/cvs/src/usr.bin/make/main.c,v
retrieving revision 1.167
diff -u -p -r1.167 main.c
--- usr.bin/make/main.c 1 Mar 2009 01:49:17 -0000       1.167
+++ usr.bin/make/main.c 18 Mar 2009 16:32:50 -0000
@@ -676,8 +676,7 @@ siginfo(int signo)
        int len;
        if (getcwd(dir, sizeof(dir)) == NULL)
                return;
-       len = snprintf(str, sizeof(str), "%s: Working in: %s\n", getprogname(),
-           dir);
+       len = snprintf(str, sizeof(str), "%s: Working in: %s\n", progname, dir);
        if (len > 0)
                (void)write(STDERR_FILENO, str, (size_t)len);
 }
@@ -724,9 +723,6 @@ main(int argc, char **argv)
        /* default to writing debug to stderr */
        debug_file = stderr;
 
-#ifdef SIGINFO
-       (void)signal(SIGINFO, siginfo);
-#endif
        /*
         * Set the seed to produce a different random sequence
         * on each program execution.
@@ -738,6 +734,10 @@ main(int argc, char **argv)
                progname++;
        else
                progname = argv[0];
+#ifdef SIGINFO
+       (void)signal(SIGINFO, siginfo);
+#endif
+
 #ifdef RLIMIT_NOFILE
        /*
         * get rid of resource limit on file descriptors


Home | Main Index | Thread Index | Old Index