Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Sep 1996 09:35:39 -0700
From:      John Polstra <jdp@polstra.com>
To:        " ge R bekk" <aagero@aage.priv.no>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: building modula3 port 
Message-ID:  <199609281635.JAA05996@austin.polstra.com>
In-Reply-To: Your message of "Sat, 28 Sep 1996 14:23:27 %2B0200." <199609281223.OAA21276@birk04.studby.uio.no> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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 <sys/syscall.h>
    #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 <sys/syscall.h>, 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609281635.JAA05996>