Page MenuHomeFreeBSD

sys/tools/amd64_ia32_vdso.sh: Pass explicit -m to ld for ld.bfd.
AbandonedPublic

Authored by jhb on Feb 2 2022, 8:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 19, 8:30 AM
Unknown Object (File)
Wed, Mar 18, 8:39 PM
Unknown Object (File)
Mon, Mar 9, 7:55 AM
Unknown Object (File)
Mar 1 2026, 12:07 AM
Unknown Object (File)
Feb 28 2026, 2:05 PM
Unknown Object (File)
Feb 14 2026, 2:31 AM
Unknown Object (File)
Feb 9 2026, 10:03 AM
Unknown Object (File)
Jan 28 2026, 1:52 AM
Subscribers

Details

Reviewers
kib
emaste
Summary

Unlike lld, ld.bfd does not intuit the default emulation from the
input files.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44250
Build 41138: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Feb 2 2022, 8:20 PM

IMO it is worth explicitly specify the emulation for amd64 64bit too.

BTW it is strange, I put OUTPUT_ARCH() into the ldscript. Might be, what is needed is OUTPUT_FORMAT() there as well, and then it is better than '-m', IMO.

I put my attempt at D34157. Still I believe I tested with ld.bfd.

Actually, if we don't want to use -m with LD, then I'd rather use CC as the linker instead. gcc -m32 will DTRT and pass the right -m to ld. clang will pass it if needed as well.

In D34143#772700, @jhb wrote:

Actually, if we don't want to use -m with LD, then I'd rather use CC as the linker instead. gcc -m32 will DTRT and pass the right -m to ld. clang will pass it if needed as well.

It required passing nostdlib, some magic to avoid linking crt*, and so on. This is why I went with direct ld invocation.

It is really not about passing or not -m, but putting as much setup as possible into linker script.