Skip to content

Compilation fails if gold does not exist #8469

@themancalledjakob

Description

@themancalledjakob

The gold linker is being deprecated, and its non-existence has already arrived on some distros.
We're adding -fuse-ld=gold though to our common linux64 makefile. This quite unnecessarily breaks compilation.

The fix may be confusing for the uninformed (who isn't), as the error message mentions neither gold nor the responsible Makefile (libs/openFrameworksCompiled/project/linux64/config.linux64.default.mk).

The error message:

[...]
g++ -o bin/glInfoExample  obj/linux64/Release/src/glewOutput.o obj/linux64/Release/src/main.o obj/linux64/Release/src/ofApp.o   ../../../libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a  -Wl,-rpath=./libs:./bin/libs:./ -Wl,--as-needed -Wl,--gc-sections -fuse-ld=gold -L../../../libs/fmod/lib/linux64/ -lfmod ../../../libs/kiss/lib/linux64/libkiss.a ../../../libs/tess2/lib/linux64/libtess2.a -lz -lgstapp-1.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -ludev -lfontconfig -lfreetype -lsndfile -lopenal -lssl -lcrypto -lcurl -lglfw -lrtaudio -lpulse-simple -pthread -lpulse -pthread -lasound -lGL -lGLEW -lGL -lX11 -lGLU -lOpenGL -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lmpg123 -lglut -lX11 -lXrandr -lXxf86vm -lXi -lXcursor -ldl -lpthread -lfreeimage -lpugixml -luriparser -lXinerama
collect2: fatal error: cannot find 'ld'
compilation terminated.
make[1]: *** [../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:411: bin/glInfoExample] Error 1
make[1]: Leaving directory '/home/jrkb/openFrameworks2025/examples/gl/glInfoExample'
make: *** [../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:131: Release] Error 2

I therefore propose to fix it before gold is nowhere to be found.

We can even conditionally use either mold, gold, or ld.

See PR #8468

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions