From owner-freebsd-ports Sat Sep 28 09:35:57 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id JAA06460 for ports-outgoing; Sat, 28 Sep 1996 09:35:57 -0700 (PDT) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id JAA06415 for ; Sat, 28 Sep 1996 09:35:52 -0700 (PDT) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.7.6/8.7.3) with ESMTP id JAA05996; Sat, 28 Sep 1996 09:35:39 -0700 (PDT) Message-Id: <199609281635.JAA05996@austin.polstra.com> To: " ge R bekk" cc: freebsd-ports@freebsd.org Subject: Re: building modula3 port In-reply-to: Your message of "Sat, 28 Sep 1996 14:23:27 +0200." <199609281223.OAA21276@birk04.studby.uio.no> Date: Sat, 28 Sep 1996 09:35:39 -0700 From: John Polstra Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > everything seems to go just fine, until > > ---------------------- building m3 ---------------------- > > --- building in FreeBSD2 --- > m3 -w1 -why -times -o m3 -F/var/tmp/qk019489 > -> linking m3 > malloc.o: Undefined symbol `_utrace' referenced from text segment You must have just exactly the wrong version of -current! :-( In the port, I included Poul-Henning Kamp's latest version of phkmalloc, slightly modified to make it thread-safe for Modula-3. It's quite important that malloc be thread-safe. The included version of malloc references the function utrace(), which is a new system call that PHK recently added to the kernel and, of course, to libc. I attempted to change malloc so that it would compile both on -current and on older versions of FreeBSD, by putting in the following grotesque hack: #ifdef __FreeBSD__ /* Kludge to find out whether we have utrace() */ #include #ifdef SYS_utrace #define HAVE_UTRACE #endif /* SYS_utrace */ #endif /* __FreeBSD__ */ And then utrace() gets referenced only if HAVE_UTRACE is defined. Apparently, in your version of -current, SYS_utrace was already added to , but the utrace() function had not yet been added to libc. There are a couple of different ways you could work around this problem: 1. Update your "/usr/src/lib/libc/sys/Makefile.inc" file to the latest version, and rebuild and reinstall libc. (All you really need to do is add "utrace.o" to the definition of ASM.) It doesn't matter whether the system call really exists in your kernel. It will never get invoked in normal use. 2. In the Modula-3 port, do a "make patch", and then edit the lines above out of "work/m3/m3core/src/runtime/FreeBSD2/malloc.c". Then continue with a "make". Sorry for the hassle! John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth