Subject: kern/33210: undefined reference to `ktruser'
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <kiyohara@kk.iij4u.or.jp>
List: netbsd-bugs
Date: 04/07/2006 02:00:01
>Number:         33210
>Category:       kern
>Synopsis:       undefined reference to `ktruser'
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 07 02:00:01 +0000 2006
>Originator:     KIYOHARA Takashi
>Release:        NetBSD/i386 3.99.17
>Organization:
>Environment:
NetBSD highpriestess.fool 3.99.17 NetBSD 3.99.17 (HIGHPRIESTESS) #0: Tue Mar 28 11:39:04 JST 2006  lance@highpriestess.fool:/sys/arch/i386/compile/HIGHPRIESTESS i386

>Description:
netbsd kernel fail to link, Becouse undefined reference to `ktruser'.


  # /usr/src/cross/powerpc/bin/nbmake-evbppc

    -- snip --

  #      link  HIEROPHANT/netbsd
  /usr/src/cross/powerpc/bin/powerpc--netbsd-ld -N -Ttext 0x100000 -e__start -S -o netbsd ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
  darwin_ktrace.o: In function `darwin_sys_utrace':
  darwin_ktrace.c:(.text+0x24): undefined reference to `ktruser'

  *** Failed target:  netbsd
  *** Failed command: echo '# ' " link HIEROPHANT/netbsd"; echo     /usr/src/cross/powerpc/bin/powerpc--netbsd-ld -N -Ttext 0x100000 -e __start -S -o netbsd '${SYSTEM_OBJ}' '${EXTRA_OBJ}' vers.o; /usr/src/cross/powerpc/bin/powerpc--netbsd-ld -N -Ttext 0x100000 -e __start -S -o netbsd locore.o devsw.o ioconf.o param.o arc4.o 
rijndael-alg-fst.o rijndael-api-fst.o rijndael.o sysmon_envsys.o sysmon.o ieee80211.o ieee80211_acl.o ieee80211_crypto.o ieee80211_crypto_ccmp.o ieee80211_crypto_none.o ieee80211_crypto_tkip.o ieee80211_crypto_wep.o ieee80211_input.o ieee80211_ioctl.o ieee80211_netbsd.o ieee80211_node.o ieee80211_output.o ieee80211_pro
to.o ieee80211_rssadapt.o ieee80211_xauth.o igmp.o in.o in_pcb.o in_proto.o ip_icmp.o ip_id.o ip_input.o ip_output.o raw_ip.o tcp_input.o tcp_output.o tcp_sack.o tcp_subr.o tcp_timer.o tcp_usrreq.o udp_usrreq.o dest6.o frag6.o icmp6.o in6.o in6_cksum.o in6_ifattach.o in6_pcb.o in6_proto.o in6_src.o ip6_forward.o ip6_id.o ip6_input.o ip6_mroute.o ip6_output.o mld6.o nd6.o nd6_nbr.o nd6_rtr.o raw_ip6.o route6.o scope6.o udp6_output.o udp6_usrreq.o db_access.o db_aout.o db_break
.o db_command.o db_examine.o db_expr.o db_input.o db_lex.o db_output.o db_print.o db_run.o db_sym.o db_trap.o db_variables.o db_watch.o db_write_cmd.o db_xxx.o 

  -- snip --
>How-To-Repeat:
You try make your netbsd kernel for macppc.  before configure uncomment out options COMPAT_DARWIN and comment out options KTRACE.
>Fix:
Index: sys/compat/darwin/darwin_ktrace.c
===================================================================
RCS file: /cvsroot/src/sys/compat/darwin/darwin_ktrace.c,v
retrieving revision 1.4
diff -u -r1.4 darwin_ktrace.c
--- sys/compat/darwin/darwin_ktrace.c   11 Dec 2005 12:19:56 -0000      1.4
+++ sys/compat/darwin/darwin_ktrace.c   27 Mar 2006 18:21:00 -0000
@@ -62,12 +62,14 @@
        void *v;
        register_t *retval;
 {
+#ifdef KTRACE
        struct darwin_sys_utrace_args /* {
                syscallarg(void *) addr;
                syscallarg(size_t) len;
        } */ *uap = v;

        ktruser(l, "darwin", SCARG(uap, addr), SCARG(uap, len), 0);
+#endif

        return 0;
 }