Skip to content

Conversation

@themancalledjakob
Copy link
Contributor

The gold linker is slowly fading out of existence on some Linux distros (e.g. Void linux).
Compilation therefore fails (unnecessarily).

This is very likely gonna happen for any modern Linux distro.

But even apart from this, I think a better approach would be to only add -fuse-ld=gold if gold exists.

And while we're at it.. use mold, if mold exists.

only add '-fuse-ld=gold' if gold exists
While we're at it.. use mold, if mold exists
@ofTheo ofTheo merged commit ea38d7b into openframeworks:master Sep 12, 2025
17 checks passed
@ofTheo
Copy link
Member

ofTheo commented Sep 12, 2025

Thanks!! @themancalledjakob

@themancalledjakob themancalledjakob deleted the bugfix-linux64-linker branch September 12, 2025 16:32
@dimitre
Copy link
Member

dimitre commented Oct 6, 2025

Thank you @themancalledjakob
I've followed your logic and added other linkers in a different order, in a fork I'm working.
mold, lld, bfd (we can check in shell by invoking ld, but -fuse-ld parameter is bfd) and last of all, gold.

include $(OF_SHARED_MAKEFILES_PATH)/config.linux.common.mk

ifneq (, $(shell command -v mold))
	PLATFORM_LDFLAGS += -fuse-ld=mold
else ifneq (, $(shell command -v lld))
	PLATFORM_LDFLAGS += -fuse-ld=lld
else ifneq (, $(shell command -v ld))
	PLATFORM_LDFLAGS += -fuse-ld=bfd
else ifneq (, $(shell command -v gold))
	PLATFORM_LDFLAGS += -fuse-ld=gold
endif

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.

3 participants