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)
Thu, Apr 24, 10:02 AM
Unknown Object (File)
Sat, Apr 19, 11:01 AM
Unknown Object (File)
Tue, Apr 15, 6:09 PM
Unknown Object (File)
Mon, Apr 14, 11:39 AM
Unknown Object (File)
Mon, Apr 14, 3:47 AM
Unknown Object (File)
Mon, Apr 14, 12:49 AM
Unknown Object (File)
Sun, Apr 13, 11:30 PM
Unknown Object (File)
Sun, Mar 30, 7:32 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.