Re: /stable/12 future

Ed Maste <[email protected]>
Newsgroups gmane.os.freebsd.devel.toolchain,gmane.os.freebsd.devel.arm
Message-ID <CAPyFy2Aw8nF1g4gQjriCzBCqWDuSHCV_6+eN0-_0uYCgMyMGrw@mail.gmail.com>
On Mon, 20 Dec 2021 at 15:54, Dimitry Andric <[email protected]> wrote:
>
> The obvious solution would seem to be to switch to lld as the default
> linker, however that also runs into a snag. Since lld uses the blx
> instruction for interworking, it prints a warning "lld uses blx
> instruction, no object with architecture supporting feature detected".
>
> And because we link with the --fatal-warnings option, this stops> buildworld dead in its tracks. Obviously, this warning could be ignored
> (by removing --fatal-warnings, or patching it out), but I think this
> might result in issues when the actual binaries are run.

I believe this warning is emitted in any environment that a blx
instruction might be necessary, not that the instruction is actually
used.

From ELF/InputFiles.cpp:
// The ARM support in lld makes some use of instructions that are not available
// on all ARM architectures. Namely:
// - Use of BLX instruction for interworking between ARM and Thumb state.
// - Use of the extended Thumb branch encoding in relocation.
// - Use of the MOVT/MOVW instructions in Thumb Thunks.

I wonder if we could remove the warning from ELF/Driver.cpp in the
case that config->armHasBlx == false, and replace it with an error in
ELF/Arch/ARM.cpp if we actually need to emit a blx instruction?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.