Page MenuHomeFreeBSD

Use BINARY_ALIAS to make LLD_UNSAFE more widely applicable
ClosedPublic

Authored by emaste on Mar 28 2018, 1:30 AM.
Tags
None
Referenced Files
F104064503: D14876.diff
Tue, Dec 3, 1:41 AM
Unknown Object (File)
Sat, Nov 30, 10:08 PM
Unknown Object (File)
Wed, Nov 27, 3:46 AM
Unknown Object (File)
Mon, Nov 25, 12:15 AM
Unknown Object (File)
Sun, Nov 24, 4:28 PM
Unknown Object (File)
Sat, Nov 23, 12:09 AM
Unknown Object (File)
Fri, Nov 22, 2:10 PM
Unknown Object (File)
Fri, Nov 22, 12:34 AM
Subscribers

Details

Summary

Some ports do not honour $LD or -fuse-ld=bfd in $CFLAGS, but do invoke ld via $PATH. Automatically set BINARY_ALIAS+=ld=ld.bfd when LLD_UNSAFE is active to use ld.bfd for these ports.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

These ports currently have BINARY_ALIAS=ld=ld.bfd and should be able to use just LLD_UNSAFE with this change:

devel/pdcurses
devel/libds
lang/myrddin
irc/evangeline
sysutils/installwatch

I tested the first two and they built successfully.

Mmmm, should not this be in the .if exists(/usr/bin/ld.bfd) block? Or does USE_BINUTILS also installs a ld.bfd and a ld.ldd?

I think this was already added to some ports, I am not sure how the BINARY_ALIAS code will work if there is the same alias twice, so make sure you remove the existing aliases at the same time.

I am not sure if using BINARY_ALIAS+= ld=ld.bfd is correct.
If both /usr/bin/ld.bfd and binutils from ports are installed, it will alias to which ld.bfd which is /usr/bin/ld.bfd and not to /usr/local/bin/ld.bfd
Maybe it should be BINARY_ALIAS+= ld=${LD} instead?

In D14876#312853, @mat wrote:

Mmmm, should not this be in the .if exists(/usr/bin/ld.bfd) block? Or does USE_BINUTILS also installs a ld.bfd and a ld.ldd?

Yes, USE_BINUTILS also installs ld.bfd.

I think this was already added to some ports, I am not sure how the BINARY_ALIAS code will work if there is the same alias twice, so make sure you remove the existing aliases at the same time.

Good point, will do.

  • use ld=${LD} (@antoine)
  • remove existing BINARY_ALIAS (@mat)
Mk/bsd.port.mk
1847

+= ?

  • += from @antoine
  • address newly added BINARY_ALIASes

Make sure that all the exisiting BINARY_ALIAS=ld=ld.bfd are removed.

This revision is now accepted and ready to land.Mar 29 2018, 1:52 PM
This revision was automatically updated to reflect the committed changes.