[PATCH] D18007: [test-suite] Use target_link_libraries for libs

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 12:01:21 PST 2016


mcrosier created this revision.
mcrosier added reviewers: MatzeB, jmolloy, kristof.beyls.
mcrosier added a subscriber: llvm-commits.
Herald added a subscriber: aemerson.

r261397 changed how LDFLAGS were added to the target under cmake from
using target_link_libraries to using a function to call
append_target_flags, because target_link_libraries removes flags that do
not begin with -; however, this places the contents of LDFLAGS before
the object files on the link line, which prevents static compilation in
the case that LDFLAGS contains libraries.

This patch splits the contents of LDFLAGS into flags that are passed to
append_target_flags (remaining in LDFLAGS) and flags that must be passed
through target_link_libraries (under a new variable, LIBS, rename
appropriately) so that they may be placed after the object files on the
link line.

I've passed through all instances of -lm that I could find as a proof of
concept, and verified that all the tests that target aarch64 pass, but
there may be some libraries that I missed.


http://reviews.llvm.org/D18007

Files:
  External/Povray/CMakeLists.txt
  External/SPEC/CFP2000/CMakeLists.txt
  External/SPEC/CFP2006/447.dealII/CMakeLists.txt
  External/SPEC/CFP2006/450.soplex/CMakeLists.txt
  External/SPEC/CFP2006/453.povray/CMakeLists.txt
  External/SPEC/CFP2006/470.lbm/CMakeLists.txt
  External/SPEC/CFP2006/482.sphinx3/CMakeLists.txt
  External/SPEC/CINT2000/175.vpr/CMakeLists.txt
  External/SPEC/CINT2000/252.eon/CMakeLists.txt
  External/SPEC/CINT2000/253.perlbmk/CMakeLists.txt
  External/SPEC/CINT2000/255.vortex/CMakeLists.txt
  External/SPEC/CINT2000/300.twolf/CMakeLists.txt
  External/SPEC/CINT2006/400.perlbench/CMakeLists.txt
  External/SPEC/CINT2006/445.gobmk/CMakeLists.txt
  External/SPEC/CINT2006/456.hmmer/CMakeLists.txt
  External/SPEC/CINT2006/462.libquantum/CMakeLists.txt
  External/SPEC/CINT2006/464.h264ref/CMakeLists.txt
  MultiSource/Applications/ClamAV/CMakeLists.txt
  MultiSource/Applications/JM/ldecod/CMakeLists.txt
  MultiSource/Applications/JM/lencod/CMakeLists.txt
  MultiSource/Applications/SPASS/CMakeLists.txt
  MultiSource/Applications/lua/CMakeLists.txt
  MultiSource/Applications/minisat/CMakeLists.txt
  MultiSource/Applications/oggenc/CMakeLists.txt
  MultiSource/Applications/sgefa/CMakeLists.txt
  MultiSource/Applications/siod/CMakeLists.txt
  MultiSource/Benchmarks/ASCI_Purple/SMG2000/CMakeLists.txt
  MultiSource/Benchmarks/ASC_Sequoia/AMGmk/CMakeLists.txt
  MultiSource/Benchmarks/ASC_Sequoia/CrystalMk/CMakeLists.txt
  MultiSource/Benchmarks/ASC_Sequoia/IRSmk/CMakeLists.txt
  MultiSource/Benchmarks/ASC_Sequoia/sphot/CMakeLists.txt
  MultiSource/Benchmarks/Bullet/CMakeLists.txt
  MultiSource/Benchmarks/FreeBench/distray/CMakeLists.txt
  MultiSource/Benchmarks/FreeBench/neural/CMakeLists.txt
  MultiSource/Benchmarks/FreeBench/pifft/CMakeLists.txt
  MultiSource/Benchmarks/MallocBench/cfrac/CMakeLists.txt
  MultiSource/Benchmarks/MallocBench/gawk/CMakeLists.txt
  MultiSource/Benchmarks/MallocBench/gs/CMakeLists.txt
  MultiSource/Benchmarks/MallocBench/perl/CMakeLists.txt
  MultiSource/Benchmarks/McCat/01-qbsort/CMakeLists.txt
  MultiSource/Benchmarks/McCat/03-testtrie/CMakeLists.txt
  MultiSource/Benchmarks/McCat/04-bisect/CMakeLists.txt
  MultiSource/Benchmarks/McCat/05-eks/CMakeLists.txt
  MultiSource/Benchmarks/McCat/08-main/CMakeLists.txt
  MultiSource/Benchmarks/McCat/09-vor/CMakeLists.txt
  MultiSource/Benchmarks/McCat/15-trie/CMakeLists.txt
  MultiSource/Benchmarks/McCat/17-bintr/CMakeLists.txt
  MultiSource/Benchmarks/McCat/18-imp/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/automotive-basicmath/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/automotive-bitcount/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/automotive-susan/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/consumer-jpeg/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/consumer-lame/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/network-dijkstra/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/network-patricia/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/office-ispell/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/office-stringsearch/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/security-blowfish/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/security-rijndael/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/security-sha/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/telecomm-CRC32/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/telecomm-FFT/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/telecomm-adpcm/CMakeLists.txt
  MultiSource/Benchmarks/MiBench/telecomm-gsm/CMakeLists.txt
  MultiSource/Benchmarks/Olden/bh/CMakeLists.txt
  MultiSource/Benchmarks/Olden/bisort/CMakeLists.txt
  MultiSource/Benchmarks/Olden/health/CMakeLists.txt
  MultiSource/Benchmarks/Olden/power/CMakeLists.txt
  MultiSource/Benchmarks/Olden/tsp/CMakeLists.txt
  MultiSource/Benchmarks/Olden/voronoi/CMakeLists.txt
  MultiSource/Benchmarks/OptimizerEval/CMakeLists.txt
  MultiSource/Benchmarks/PAQ8p/CMakeLists.txt
  MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/CMakeLists.txt
  MultiSource/Benchmarks/Prolangs-C/allroots/CMakeLists.txt
  MultiSource/Benchmarks/Prolangs-C/assembler/CMakeLists.txt
  MultiSource/Benchmarks/Prolangs-C/loader/CMakeLists.txt
  MultiSource/Benchmarks/Prolangs-C/simulator/CMakeLists.txt
  MultiSource/Benchmarks/SciMark2-C/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/ControlFlow-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/ControlFlow-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/ControlLoops-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/ControlLoops-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/CrossingThresholds-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/CrossingThresholds-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Equivalencing-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Equivalencing-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Expansion-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Expansion-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/GlobalDataFlow-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/GlobalDataFlow-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/IndirectAddressing-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/IndirectAddressing-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/InductionVariable-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/InductionVariable-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/LinearDependence-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/LinearDependence-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/LoopRerolling-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/LoopRerolling-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/LoopRestructuring-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/LoopRestructuring-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/NodeSplitting-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/NodeSplitting-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Packing-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Packing-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Recurrences-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Recurrences-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Reductions-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Reductions-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Searching-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Searching-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/StatementReordering-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/StatementReordering-flt/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Symbolics-dbl/CMakeLists.txt
  MultiSource/Benchmarks/TSVC/Symbolics-flt/CMakeLists.txt
  MultiSource/Benchmarks/VersaBench/beamformer/CMakeLists.txt
  MultiSource/Benchmarks/VersaBench/dbms/CMakeLists.txt
  MultiSource/Benchmarks/mafft/CMakeLists.txt
  MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec/CMakeLists.txt
  MultiSource/Benchmarks/nbench/CMakeLists.txt
  SingleSource/Benchmarks/Adobe-C++/CMakeLists.txt
  SingleSource/Benchmarks/BenchmarkGame/CMakeLists.txt
  SingleSource/Benchmarks/BenchmarkGame/Large/CMakeLists.txt
  SingleSource/Benchmarks/CMakeLists.txt
  SingleSource/Benchmarks/CoyoteBench/CMakeLists.txt
  SingleSource/Benchmarks/Dhrystone/CMakeLists.txt
  SingleSource/Benchmarks/Linpack/CMakeLists.txt
  SingleSource/Benchmarks/McGill/CMakeLists.txt
  SingleSource/Benchmarks/Misc-C++-EH/CMakeLists.txt
  SingleSource/Benchmarks/Misc-C++/CMakeLists.txt
  SingleSource/Benchmarks/Misc-C++/Large/CMakeLists.txt
  SingleSource/Benchmarks/Misc/CMakeLists.txt
  SingleSource/Benchmarks/Shootout/CMakeLists.txt
  SingleSource/Benchmarks/SmallPT/CMakeLists.txt
  SingleSource/Benchmarks/Stanford/CMakeLists.txt
  SingleSource/Regression/C/CMakeLists.txt
  SingleSource/UnitTests/Threads/CMakeLists.txt
  SingleSource/UnitTests/Vector/Altivec/CMakeLists.txt
  SingleSource/UnitTests/Vector/SSE/CMakeLists.txt
  cmake/modules/SingleMultiSource.cmake

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18007.50174.patch
Type: text/x-patch
Size: 62657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160309/8020b2a3/attachment.bin>


More information about the llvm-commits mailing list