Skip to content

Conversation

@ericonr
Copy link
Contributor

@ericonr ericonr commented Aug 3, 2020

Gold linker brings little benefit, isn't available or fully compliant
for some architectures, and can have issues with libraries located
outside /usr/lib.

Rust tried enabling it, but had to revert: rust-lang/rust#30913

When packaging Horizon for Void Linux, I had to remove -fuse-ld=gold from the Makefile, since it isn't available for our cross compilation setup.

It was enabled some years ago for no reason that I could find.

This way, if someone wants it, it can still be passed on the environment.

@carrotIndustries
Copy link
Member

It was enabled some years ago for no reason that I could find.

The gold linker is about twice as fast as the regular one. Linking horizon-imp takes 10s with the gold linker, 20s with the regular one.

This way, if someone wants it, it can still be passed on the environment.

Why not make it the other way round and keep gold the default and add an option to use the non-gold ld?

@ericonr
Copy link
Contributor Author

ericonr commented Aug 4, 2020

Why not make it the other way round and keep gold the default and add an option to use the non-gold ld?

Sure! Could it be something like

GOLD = -fuse-ld=gold
[...]
LDFLAGS += $(GOLD)

and a user can use make GOLD= ?

@carrotIndustries
Copy link
Member

Sure! Could it be something like

Yes, go ahead.

Fix indentation.

Gold linker isn't available or fully compliant for some architectures,
so it makes sense to allow a user to disable it using `make GOLD=`.
@ericonr
Copy link
Contributor Author

ericonr commented Aug 4, 2020

Done!

@carrotIndustries carrotIndustries merged commit e889563 into horizon-eda:master Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants