Page MenuHomeFreeBSD

bsd.linker.mk: add band-aid for linker invocation failure
ClosedPublic

Authored by emaste on Jun 30 2017, 1:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jul 25, 3:48 PM
Unknown Object (File)
Thu, Jul 23, 12:43 AM
Unknown Object (File)
Wed, Jul 22, 8:41 PM
Unknown Object (File)
Sun, Jul 19, 9:54 PM
Unknown Object (File)
Sun, Jul 19, 2:36 PM
Unknown Object (File)
Sun, Jul 19, 12:57 AM
Unknown Object (File)
Jun 25 2026, 11:05 PM
Unknown Object (File)
May 25 2026, 6:27 PM

Details

Summary

In some cases bsd.linker.mk reports an error like:

make[4]: ".../share/mk/bsd.linker.mk" line 56: Unknown linker from LD=ld -m elf32ppc_fbsd:"

For now change this to a .warning, and assume GNU ld 2.17.50. At present the linker type detection is used only for enabling build-id, and we can carry on without it when type detection fails.

Test Plan
nuc% LD=false make -V LINKER_TYPE -V LINKER_VERSION
make: "/usr/home/emaste/src/freebsd-wip/share/mk/bsd.linker.mk" line 47: warning: Unable to determine linker type from LD=false
make: "/usr/home/emaste/src/freebsd-wip/share/mk/bsd.linker.mk" line 56: warning: Unknown linker from LD=false: none, defaulting to bfd
bfd
21750

aside, the line numbers reported by bmake are incorrect

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

share/mk/bsd.linker.mk
50 ↗(On Diff #30253)

I will also remove the 2>/dev/null, from my local commit:

Show errors from ${LD} --version to aid in failure diagnosis. Successful invocations of ${LD} --version produce no output on stderr so this will not create any spam in non-failing builds.

nuc% LD="ld -mbogus" make -V LINKER_TYPE -V LINKER_VERSION
ld: unrecognised emulation mode: bogus
Supported emulations: elf_x86_64_fbsd elf_i386_fbsd
make: "/usr/home/emaste/src/freebsd-wip/share/mk/bsd.linker.mk" line 47: warning: Unable to determine linker type from LD=ld -mbogus
make: "/usr/home/emaste/src/freebsd-wip/share/mk/bsd.linker.mk" line 56: warning: Unknown linker from LD=ld -mbogus: none, defaulting to bfd
bfd
21750

Confirming this fixes the misp64 build for me.

This revision was automatically updated to reflect the committed changes.

Oops, should have had Submitted by: bdrewery. He's afk for a bit, but before that we discussed committing something like this in case of continuing problems.