M
M
Mercury132017-02-19 14:50:54
Qt
Mercury13, 2017-02-19 14:50:54

How well does the GOLD linker work in MinGW and why is Invalid character?

Found out that in modern versions of MinGW there is a linker ld.gold.exe. "I decided to try it, took the bottle, opened it - suddenly something obscene came out." Namely ... I
add the lines to the Qt project

QMAKE_CXXFLAGS += -fuse-ld=gold
QMAKE_LFLAGS += -fuse-ld=gold

And on each object file such errors turn out.
C:\Qt\Tools\mingw530_32\i686-w64-mingw32\bin\ld.gold.exe:-1: error: error: C:/Qt/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/crt2.o:1:2: invalid character
C:\Qt\Tools\mingw530_32\i686-w64-mingw32\bin\ld.gold.exe:-1: error: error: C:/Qt/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/crt2.o:1:2: syntax error, unexpected $end
C:\Qt\Tools\mingw530_32\i686-w64-mingw32\bin\ld.gold.exe:-1: error: error: C:/Qt/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/lib/../lib/crt2.o: not an object or archive

And so on all files. Gold can only collect under Linux? Or my skis don't work?
And if under Linux, why is it needed in Windows?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2017-02-19
@Mercury13

gold only works with ELF files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question