randomdev.o: In function `read_random': /usr/src/sys/dev/random/randomdev.c:189: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:191: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:200: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:207: undefined reference to `random_alg_context' randomdev.o: In function `randomdev_unblock': /usr/src/sys/dev/random/randomdev.c:256: undefined reference to `random_alg_context' randomdev.o:/usr/src/sys/dev/random/randomdev.c:343: more undefined references to `random_alg_context' follow randomdev.o: In function `random_sources_feed': /usr/src/sys/dev/random/randomdev.c:346: undefined reference to `random_harvest_direct' /usr/src/sys/dev/random/randomdev.c:343: undefined reference to `random_alg_context' randomdev.o: In function `randomdev_read': /usr/src/sys/dev/random/randomdev.c:142: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:145: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:150: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:152: undefined reference to `random_alg_context' randomdev.o:/usr/src/sys/dev/random/randomdev.c:145: more undefined references to `random_alg_context' follow scmouse.o: In function `sc_mouse_ioctl': /usr/src/sys/dev/syscons/scmouse.c:669: undefined reference to `random_harvest_queue' syscons.o: In function `scgetc': /usr/src/sys/dev/syscons/syscons.c:3414: undefined reference to `random_harvest_queue' vt_core.o: In function `vt_processkey': /usr/src/sys/dev/vt/vt_core.c:736: undefined reference to `random_harvest_queue' vt_sysmouse.o: In function `sysmouse_process_event': /usr/src/sys/dev/vt/vt_sysmouse.c:142: undefined reference to `random_harvest_queue' kern_intr.o: In function `swi_sched': /usr/src/sys/kern/kern_intr.c:1129: undefined reference to `random_harvest_queue' kern_intr.o:/usr/src/sys/kern/kern_intr.c:891: more undefined references to `random_harvest_queue' follow subr_bus.o: In function `device_attach': /usr/src/sys/kern/subr_bus.c:2887: undefined reference to `random_harvest_direct' if_ethersubr.o: In function `ether_input_internal': /usr/src/sys/net/if_ethersubr.c:429: undefined reference to `random_harvest_queue' if_tun.o: In function `tunwrite': /usr/src/sys/net/if_tun.c:909: undefined reference to `random_harvest_queue' ffs_inode.o: In function `ffs_update': /usr/src/sys/ufs/ffs/ffs_inode.c:156: undefined reference to `random_harvest_queue' uma_core.o: In function `uma_zalloc_arg': /usr/src/sys/vm/uma_core.c:2139: undefined reference to `random_harvest_fast' uma_core.o: In function `uma_zfree_arg': /usr/src/sys/vm/uma_core.c:2681: undefined reference to `random_harvest_fast' *** Error code 1
(note, I am building 11-CURRENT from 10.1-RELEASE) # Revision: 285868 $ clang -v FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512 Target: x86_64-unknown-freebsd10.1 Thread model: posix Selected GCC installation: $ freebsd-version -ku; uname -apKU 10.1-RELEASE-p14 10.1-RELEASE-p14 FreeBSD z600 10.1-RELEASE-p14 FreeBSD 10.1-RELEASE-p14 #14: Tue Jul 14 14:26:13 CDT 2015 root@z600:/usr/obj/usr/src/sys/MYKERNEL amd64 amd64 1001000 1001000 # make buildkernel <snip> -------------------------------------------------------------- >>> stage 3.2: building everything -------------------------------------------------------------- cd /usr/obj/usr/src/sys/GENERIC; MAKEOBJDIRPREFIX=/usr/obj MACHINE_ARCH=amd64 MACHINE=amd64 CPUTYPE= GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac _LDSCRIPTROOT= VERSION="FreeBSD 11.0-CURRENT amd64 1100077" INSTALL="sh /usr/src/tools/install.sh" PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin CC="cc " CXX="c++ " DEPFLAGS="" CPP="cpp " AS="as" AR="ar" LD="ld" NM=nm OBJDUMP=objdump OBJCOPY="objcopy" RANLIB=ranlib STRINGS= SIZE="size" make -D NO_CLEAN -m /usr/src/share/mk KERNEL=kernel all -DNO_MODULES_OBJ linking kernel.debug randomdev.o: In function `read_random_uio': /usr/src/sys/dev/random/randomdev.c:170: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:174: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:180: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:185: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:206: undefined reference to `random_alg_context' randomdev.o:/usr/src/sys/dev/random/randomdev.c:233: more undefined references to `random_alg_context' follow randomdev.o: In function `random_sources_feed': /usr/src/sys/dev/random/randomdev.c:390: undefined reference to `random_harvest_direct' /usr/src/sys/dev/random/randomdev.c:387: undefined reference to `random_alg_context' randomdev.o: In function `randomdev_write': /usr/src/sys/dev/random/randomdev.c:270: undefined reference to `random_alg_context' /usr/src/sys/dev/random/randomdev.c:270: undefined reference to `random_alg_context' randomdev.o: In function `randomdev_poll': /usr/src/sys/dev/random/randomdev.c:286: undefined reference to `random_alg_context' randomdev.o: In function `random_alg_context_ra_deinit_alg': /usr/src/sys/dev/random/randomdev.c:138: undefined reference to `random_alg_context' randomdev.o:/usr/src/sys/dev/random/randomdev.c:131: more undefined references to `random_alg_context' follow scmouse.o: In function `sc_mouse_ioctl': /usr/src/sys/dev/syscons/scmouse.c:669: undefined reference to `random_harvest_queue' syscons.o: In function `scgetc': /usr/src/sys/dev/syscons/syscons.c:3414: undefined reference to `random_harvest_queue' vt_core.o: In function `vt_processkey': /usr/src/sys/dev/vt/vt_core.c:778: undefined reference to `random_harvest_queue' vt_sysmouse.o: In function `sysmouse_process_event': /usr/src/sys/dev/vt/vt_sysmouse.c:142: undefined reference to `random_harvest_queue' kern_intr.o: In function `swi_sched': /usr/src/sys/kern/kern_intr.c:1149: undefined reference to `random_harvest_queue' kern_intr.o:/usr/src/sys/kern/kern_intr.c:897: more undefined references to `random_harvest_queue' follow subr_bus.o: In function `device_attach': /usr/src/sys/kern/subr_bus.c:2887: undefined reference to `random_harvest_direct' if_ethersubr.o: In function `ether_input_internal': /usr/src/sys/net/if_ethersubr.c:429: undefined reference to `random_harvest_queue' if_tun.o: In function `tunwrite': /usr/src/sys/net/if_tun.c:909: undefined reference to `random_harvest_queue' ffs_inode.o: In function `ffs_update': /usr/src/sys/ufs/ffs/ffs_inode.c:156: undefined reference to `random_harvest_queue' uma_core.o: In function `uma_zalloc_arg': /usr/src/sys/vm/uma_core.c:2139: undefined reference to `random_harvest_fast' uma_core.o: In function `uma_zfree_arg': /usr/src/sys/vm/uma_core.c:2681: undefined reference to `random_harvest_fast' *** 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
Ctrl-F for 20150630 in UPDATING. I added > options RANDOM_YARROW # Legacy /dev/random algorithm. to my custom buld config (pretty much follow this: https://www.freebsd.org/doc/handbook/kernelconfig-config.html) and I get past the build error. It's possble I'm getting this error because I'm on 10.1-RELEASE. However, my efforts to do buildworld first, and compile the /sys/modules/random failed. I gave up and proceeded to add the option above.
(In reply to Tony Narlock from comment #2) Hi Please post the whole kernel config file - the one that is failing. Thanks! M
(In reply to Mark Murray from comment #3) I do not have this anymore and haven't unfortunately I haven't been able to reproduce it. As I best remember, I was using the GENERIC config and it was identical (at least line count) with the GENERIC on github.com/freebsd/freebsd at the time. If I reproduce this I will report back with a copy. https://github.com/freebsd/freebsd/commit/e853fb249f0a2e510bb3c9a54cda60ba290e5777#diff-9616781c03f0869f8d84637943d6b516 To get the kernel to compile - I added: > options RANDOM_YARROW under: > device random
(In reply to Tony Narlock from comment #4) Without being able to reproduce this, there is not much to fix :-) Your problem has hints of a "not-quite-CURRENT" source tree, as (e.g.) the sys/modules/random directory should not have been there. I'll leave this open for a few days to see if the problem comes back and then close it. Is that OK? M
(In reply to Mark Murray from comment #5) Agreed. Let's see if I / someone else can reproduce this and provide the info again, if not we can move on. Thanks
(In reply to Tony Narlock from comment #6) Hi. I seem to be hitting a problem that may be related to the one being discussed here while trying to upgrade 11.0-CURRENT on my Thinkpad T430: #################################################### [root@carbon /home/robin/work/repos/freebsd-head.git]# make buildkernel KERNCONF=GENERIC . . MAKE=make sh /usr/home/robin/work/repos/freebsd-head.git/sys/conf/newvers.sh GENERIC cc -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/usr/home/robin/work/repos/freebsd-head.git/sys -I/usr/home/robin/work/repos/freebsd-head.git/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -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.debug random_infra.o:(.data+0xb0): undefined reference to `random_alg_context' kern_mib.o: In function `sysctl_kern_arnd': /usr/home/robin/work/repos/freebsd-head.git/sys/kern/kern_mib.c:164: undefined reference to `read_random' arc4random.o: In function `arc4_randomstir': /usr/home/robin/work/repos/freebsd-head.git/sys/libkern/arc4random.c:61: undefined reference to `read_random' sctp_auth.o: In function `sctp_generate_random_key': /usr/home/robin/work/repos/freebsd-head.git/sys/netinet/sctp_auth.c:326: undefined reference to `read_random' sctp_auth.o: In function `sctp_initialize_auth_params': /usr/home/robin/work/repos/freebsd-head.git/sys/netinet/sctp_auth.c:1995: undefined reference to `read_random' sctp_output.o: In function `sctp_send_initiate_ack': /usr/home/robin/work/repos/freebsd-head.git/sys/netinet/sctp_output.c:5951: undefined reference to `read_random' sctp_pcb.o:/usr/home/robin/work/repos/freebsd-head.git/sys/netinet/sctp_pcb.c:2628: more undefined references to `read_random' follow ivy.o: In function `rdrand_modevent': /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/ivy.c:115: undefined reference to `random_source_deregister' /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/ivy.c:108: undefined reference to `random_source_register' nehemiah.o: In function `nehemiah_modevent': /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/nehemiah.c:136: undefined reference to `random_source_deregister' /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/nehemiah.c:127: undefined reference to `random_source_register' *** Error code 1 Stop. make[2]: stopped in /usr/obj/usr/home/robin/work/repos/freebsd-head.git/sys/GENERIC *** Error code 1 Stop. #################################################### Here are relevant snippets of information about my build environment. Note that I am using the github mirror at: https://github.com/freebsd/freebsd.git [root@carbon /home/robin/work/repos/freebsd-head.git]# uname -a FreeBSD carbon 11.0-CURRENT FreeBSD 11.0-CURRENT #2 3fef960(master): Sun Jan 25 18:49:25 GMT 2015 robin@carbon:/usr/obj/usr/home/robin/work/repos/freebsd-head.git/sys/GENERIC amd64 [root@carbon /home/robin/work/repos/freebsd-head.git]# git log --pretty=oneline | head -n 1 31eef3e08357d5af4fef967ad8b295e666c51a4f The vendor's DTS for Allwinner A20 uses a different way to map the gpio pins, they specify the bank and the pin in two separated cells. [root@carbon /home/robin/work/repos/freebsd-head.git]# clang -v clang version 3.5.0 (trunk 210095) Target: x86_64-unknown-freebsd11.0 Thread model: posix I haven't touched the config file (amd64 GENERIC). Will try and attach it after posting this current note. Any help appreciated.
Created attachment 160545 [details] amd64 GENERIC kernel config used This is the kernel config I used for buildkernel. I'm not including the config snippets included in turn by this one. As mentioned in the bug commentary, I haven't touched the configs - so using the pristine ones in the repository.
One more data point: if I try the remedy suggested by Tony and add 'options RANDOM_YARROW' then some of the link time missing symbols get resolved but there are others to do with rijndael that aren't: ############################################ [root@carbon /home/robin/work/repos/freebsd-head.git]# make buildkernel KERNCONF=GENERIC . . MAKE=make sh /usr/home/robin/work/repos/freebsd-head.git/sys/conf/newvers.sh GENERIC cc -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/usr/home/robin/work/repos/freebsd-head.git/sys -I/usr/home/robin/work/repos/freebsd-head.git/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -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.debug hash.o: In function `randomdev_encrypt_init': /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/hash.c:87: undefined reference to `rijndael_cipherInit' /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/hash.c:88: undefined reference to `rijndael_makeKey' hash.o: In function `randomdev_encrypt': /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/hash.c:99: undefined reference to `rijndael_blockEncrypt' *** Error code 1 Stop. make[2]: stopped in /usr/obj/usr/home/robin/work/repos/freebsd-head.git/sys/GENERIC *** Error code 1 Stop. make[1]: stopped in /usr/home/robin/work/repos/freebsd-head.git *** Error code 1 Stop. make: stopped in /usr/home/robin/work/repos/freebsd-head.git *** Error code 1 ############################################
Hi Please ensure that your source tree is completely up to date, clean ("make cleandir") and that ${.OBJDIR} (defaults to /usr/obj) is empty. Then please try again. M
(In reply to Mark Murray from comment #10) Hi Mark. Thanks for the response. I was pretty certain I started off with a clean slate. To confirm I repeated with a top level cleandir and the complete removal of the contents of /usr/obj. Also removed the 'options RANDOM_YARROW' addition to GENERIC. The problem persists: ######################################################## [root@carbon /home/robin/work/repos/freebsd-head.git]# make buildkernel KERNCONF=GENERIC . . MAKE=make sh /usr/home/robin/work/repos/freebsd-head.git/sys/conf/newvers.sh GENERIC cc -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/usr/home/robin/work/repos/freebsd-head.git/sys -I/usr/home/robin/work/repos/freebsd-head.git/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -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.debug random_infra.o:(.data+0xb0): undefined reference to `random_alg_context' kern_mib.o: In function `sysctl_kern_arnd': /usr/home/robin/work/repos/freebsd-head.git/sys/kern/kern_mib.c:164: undefined reference to `read_random' arc4random.o: In function `arc4_randomstir': /usr/home/robin/work/repos/freebsd-head.git/sys/libkern/arc4random.c:61: undefined reference to `read_random' sctp_auth.o: In function `sctp_generate_random_key': /usr/home/robin/work/repos/freebsd-head.git/sys/netinet/sctp_auth.c:326: undefined reference to `read_random' sctp_auth.o: In function `sctp_initialize_auth_params': /usr/home/robin/work/repos/freebsd-head.git/sys/netinet/sctp_auth.c:1995: undefined reference to `read_random' sctp_output.o: In function `sctp_send_initiate_ack': /usr/home/robin/work/repos/freebsd-head.git/sys/netinet/sctp_output.c:5951: undefined reference to `read_random' sctp_pcb.o:/usr/home/robin/work/repos/freebsd-head.git/sys/netinet/sctp_pcb.c:2628: more undefined references to `read_random' follow ivy.o: In function `rdrand_modevent': /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/ivy.c:115: undefined reference to `random_source_deregister' /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/ivy.c:108: undefined reference to `random_source_register' nehemiah.o: In function `nehemiah_modevent': /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/nehemiah.c:136: undefined reference to `random_source_deregister' /usr/home/robin/work/repos/freebsd-head.git/sys/dev/random/nehemiah.c:127: undefined reference to `random_source_register' *** Error code 1 Stop. make[2]: stopped in /usr/obj/usr/home/robin/work/repos/freebsd-head.git/sys/GENERIC *** Error code 1 Stop. make[1]: stopped in /usr/home/robin/work/repos/freebsd-head.git *** Error code 1 Stop. make: stopped in /usr/home/robin/work/repos/freebsd-head.git ######################################################## Happy to try anything else or provide any other information - do let me know.
What does "git status" say?
(In reply to Mark Murray from comment #12) Nothing incriminating IMHO: [root@carbon /home/robin/work/repos/freebsd-head.git]# git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean [root@carbon /home/robin/work/repos/freebsd-head.git]# git branch * master [root@carbon /home/robin/work/repos/freebsd-head.git]# git remote -v origin https://github.com/freebsd/freebsd.git (fetch) origin https://github.com/freebsd/freebsd.git (push)
I can't reproduce this - I have a checkout of the same source as you do (done in the last hour), and it works.
Could you try doing your build as $ make KERNCONF=GENERIC buildworld buildkernel please?
(In reply to Mark Murray from comment #15) This took longer than I expected. The problem doesn't manifest itself when I use your recommended sequence. I can therefore only assume that there was some dependency on a world element that caused this problem. Thanks!
Thanks for the feedback! The way that I showed you is the right way to build freebsd, particularly from older versions. Is it OK if I close this bug?
(In reply to Mark Murray from comment #17) Fine by me. Thanks once again!
Thanks for using FreeBSD!
Advised on how to build from previous version.