Page MenuHomeFreeBSD

Use BINARY_ALIAS to make LLD_UNSAFE more widely applicable
ClosedPublic

Authored by emaste on Mar 28 2018, 1:30 AM.

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

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

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 ↗(On Diff #40835)

+= ?

  • += 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.