This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Move LDFLAGS to after objects
ClosedPublic

Authored by mcrosier on Jan 15 2016, 1:24 PM.

Details

Summary

LDFLAGS were previously added after other compilation flags when
linking, but not after object files. This causes an issue when
attempting to statically compile, as objects cannot pull from libraries
put before them on the link line. This change assures that LDFLAGS is
always appended after the object files.

Diff Detail

Event Timeline

mcrosier updated this revision to Diff 45029.Jan 15 2016, 1:24 PM
mcrosier retitled this revision from to [test-suite] Move LDFLAGS to after objects .
mcrosier updated this object.
mcrosier added a subscriber: llvm-commits.
MatzeB accepted this revision.Jan 15 2016, 1:36 PM
MatzeB edited edge metadata.

It surprised me that target_link_libraries can be used for arbitrary flags, but the cmake docu says so so this is fine.
I wonder if you can just replace the two append_ldflags(${source_exename} LDFLAGS) calls with target_link_libraries(${source_exename} ${LDFLAGS}) and remove the whole append_ldflags macro?

This revision is now accepted and ready to land.Jan 15 2016, 1:36 PM
mcrosier closed this revision.Jan 18 2016, 9:28 AM

Committed r258056.