From owner-freebsd-i386@freebsd.org Mon Dec 19 20:15:04 2016 Return-Path: Delivered-To: freebsd-i386@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A788AC881D5 for ; Mon, 19 Dec 2016 20:15:04 +0000 (UTC) (envelope-from tyler@monkeypox.org) Received: from sanddollar.geekisp.com (sanddollar.geekisp.com [216.168.135.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.geekisp.com", Issuer "mail.geekisp.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCC01F9C for ; Mon, 19 Dec 2016 20:15:03 +0000 (UTC) (envelope-from tyler@monkeypox.org) Received: (qmail 29479 invoked by uid 1003); 19 Dec 2016 20:08:20 -0000 Received: from unknown (HELO blackberry.coupleofllamas.com) (tyler@monkeypox.org@50.0.244.47) by mail.geekisp.com with (AES128-SHA encrypted) SMTP; 19 Dec 2016 20:08:20 -0000 Date: Mon, 19 Dec 2016 12:08:17 -0800 From: "R. Tyler Croy" To: freebsd-i386@freebsd.org Subject: Undefined reference to read_random when building kernel(s) Message-ID: <20161219200817.GB3722@blackberry.coupleofllamas.com> Reply-To: tyler@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bn2rw/3z4jIqBvZU" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 20:15:04 -0000 --Bn2rw/3z4jIqBvZU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I have tried this with the latest commits in both 11-STABLE and 12-CURRENT and they have resulted in the same issue when linking my kernel. I'm unclear what could be the cause, but since I am only seeing it on my i386 machines I figured I would ask here. Here's the relevant log snippet MAKE=make sh /usr/src/sys/conf/newvers.sh GENERIC cc -target i386-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin -c -O -pipe -g -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -mno-mmx -mno-sse -msoft-float -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -mno-aes -mno-avx -std=iso9899:1999 -Werror vers.c ctfconvert -L VERSION -g vers.o linking kernel.full random_infra.o:(.data+0x6c): undefined reference to `random_alg_context' kern_mib.o: In function `sysctl_kern_arnd': /usr/src/sys/kern/kern_mib.c:167: undefined reference to `read_random' arc4random.o: In function `arc4_randomstir': /usr/src/sys/libkern/arc4random.c:73: undefined reference to `read_random' sctp_auth.o: In function `sctp_generate_random_key': /usr/src/sys/netinet/sctp_auth.c:326: undefined reference to `read_random' sctp_auth.o: In function `sctp_initialize_auth_params': /usr/src/sys/netinet/sctp_auth.c:1997: undefined reference to `read_random' sctp_output.o: In function `sctp_send_initiate_ack': /usr/src/sys/netinet/sctp_output.c:5976: undefined reference to `read_random' sctp_pcb.o:/usr/src/sys/netinet/sctp_pcb.c:2592: more undefined references to `read_random' follow ivy.o: In function `rdrand_modevent': /usr/src/sys/dev/random/ivy.c:115: undefined reference to `random_source_deregister' /usr/src/sys/dev/random/ivy.c:108: undefined reference to `random_source_register' nehemiah.o: In function `nehemiah_modevent': /usr/src/sys/dev/random/nehemiah.c:136: undefined reference to `random_source_deregister' /usr/src/sys/dev/random/nehemiah.c:127: undefined reference to `random_source_register' *** Error code 1 Stop. make[2]: stopped in /usr/obj/usr/src/sys/GENERIC *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src And some relevant system information: root@lemon:/usr/src # cc --version FreeBSD clang version 3.4 (tags/RELEASE_34/final 197956) 20140216 Target: i386-unknown-freebsd11.0 Thread model: posix root@lemon:/usr/src # uname -a FreeBSD lemon 11.0-CURRENT FreeBSD 11.0-CURRENT #0 59b8a68(master): Mon Apr 28 04:46:00 UTC 2014 tyler@lemon:/usr/home/tyler/obj/usr/home/tyler/source/github/freebsd/sys/VT i386 Any suggestions on how to debug/identify the issue here? I'm at a bit of a loss for debugging kernel link errors :( - R. Tyler Croy ------------------------------------------------------ Code: Chatter: % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F ------------------------------------------------------ --Bn2rw/3z4jIqBvZU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlhYPjEACgkQFCbH3D9R4W8FMwCfd8Wy4XdciB+FswxSooNg8FnS vIYAoJ5RBHi6mMFAJBPzF31lMKJCuvka =W5it -----END PGP SIGNATURE----- --Bn2rw/3z4jIqBvZU--