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)
Sep 18 2024, 7:10 AM
Unknown Object (File)
Sep 8 2024, 4:17 PM
Unknown Object (File)
Sep 8 2024, 2:00 AM
Unknown Object (File)
Sep 7 2024, 11:32 AM
Unknown Object (File)
Sep 3 2024, 10:40 AM
Unknown Object (File)
Aug 28 2024, 1:12 PM
Unknown Object (File)
Aug 17 2024, 6:16 PM
Unknown Object (File)
Aug 6 2024, 8:39 AM

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.