===> stand/efi/loader_lua (all) ===> stand/efi/loader_simp (all) ===> stand/i386 (all) ===> stand/i386/mbr (all) /usr/local/libexec/ccache/world/cc -O2 -pipe -I/usr/src/stand/i386/btx/lib -nostdinc -I/usr/obj/usr/src/i386.i386/stand/libsa -I/usr/src/stand/libsa -D_STANDALONE -I/usr/src/sys -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface -DLOADER_GELI_SUPPORT -I/usr/src/stand/libsa/geli -DLOADER_DISK_SUPPORT -ffreestanding -mno-mmx -mno-sse -mno-avx -mno-avx2 -msoft-float -march=i386 -I. -DNDEBUG -std=gnu99 -Wsystem-headers -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -Oz -Qunused-arguments -e start -Ttext 0x600 -Wl,-N,-S,--oformat,binary -nostdlib -Wl,--no-rosegment -o mbr mbr.o /usr/bin/ld: unrecognized option '--no-rosegment' /usr/bin/ld: use the --help option for usage information cc: error: linker command failed with exit code 1 (use -v to see invocation) *** Error code 1
Created attachment 203873 [details] src.conf
Created attachment 203874 [details] make.conf
Created attachment 203919 [details] Makefile.inc.diff simple patch for /usr/src/stand/i386/Makefile.inc
(In reply to oz42 from comment #3) The patch in comment #3 is invalid, and lld supports the --no-rosegment argument; your output > /usr/bin/ld: unrecognized option '--no-rosegment' > /usr/bin/ld: use the --help option for usage information is from GNU ld, so I'm not sure what is happening here. I suggest reporting on the freebsd-stable list and asking for suggestions.
Sorry, what do you mean with list? I only can tell that my patch worked for me. I have no idea why it is choosing GNU ld.
(In reply to oz42 from comment #5) I mean posting to the freebsd-stable mailing list is more likely to provide useful insight on build issues than a PR. https://lists.freebsd.org/mailman/listinfo/freebsd-stable You can send the output of (from the top level source directory) there: % ld --version % make -V LINKER_TYPE --no-rosegment is needed for (and supported by) lld, so removing it from the lld LDFLAGS is not correct.
# ld --version LLD 6.0.1 (FreeBSD 335540-1200005) (compatible with GNU linkers) # make -V LINKER_TYPE lld What I have found in the src.conf manpage: WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. This is a default setting on amd64/amd64, arm/armv7 and arm64/aarch64. So this is not default on i386?
This is from a machine that had built world successfully once (with my patch). On a stock system, /usr/bin/ld ist GNU ld: # ld --version GNU ld 2.17.50 [FreeBSD] 2007-07-03 # make -V LINKER_TYPE bfd
The following does not change anything, I assume some Makefiles will have to be corrected. setting LD to /usr/bin/ld.lld adding LD=/usr/bin/ld.lld to make.conf adding WITH_LLD_IS_LD=YES to src.conf Workaround: root@fb-12-0:/usr/src/stand/i386/mbr # cd /usr/bin/ root@fb-12-0:/usr/bin # rm ld root@fb-12-0:/usr/bin # ln -s ld.lld ld