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

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

emaste created this revision.Mar 28 2018, 1:30 AM

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.

mat added a subscriber: mat.Mar 28 2018, 8:58 AM

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.

emaste updated this revision to Diff 40835.Mar 28 2018, 1:06 PM
  • use ld=${LD} (@antoine)
  • remove existing BINARY_ALIAS (@mat)
antoine added inline comments.Mar 28 2018, 1:14 PM
Mk/bsd.port.mk
1848

+= ?

emaste updated this revision to Diff 40848.Mar 28 2018, 5:41 PM
  • += from @antoine
  • address newly added BINARY_ALIASes
antoine accepted this revision.Mar 29 2018, 1:52 PM

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.