[libcxx-commits] [libcxx] 9949cfb - [libc++] Make sure the source file appears before link libraries when compiling tests

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 7 05:59:05 PDT 2020


Author: Louis Dionne
Date: 2020-04-07T08:58:40-04:00
New Revision: 9949cfbd05a076ee4b70e393c5da49dce640a3c7

URL: https://github.com/llvm/llvm-project/commit/9949cfbd05a076ee4b70e393c5da49dce640a3c7
DIFF: https://github.com/llvm/llvm-project/commit/9949cfbd05a076ee4b70e393c5da49dce640a3c7.diff

LOG: [libc++] Make sure the source file appears before link libraries when compiling tests

Otherwise, files don't link when using a GNU linker, which is more
sensitive on the order of the source file relative to the various
linked libraries. See http://c-faq.com/lib/libsearch.html for an
explanation of the problem.

Added: 
    

Modified: 
    libcxx/test/libcxx/selftest/newformat/sh.cpp/remote-substitutions.sh.cpp
    libcxx/test/libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/selftest/newformat/sh.cpp/remote-substitutions.sh.cpp b/libcxx/test/libcxx/selftest/newformat/sh.cpp/remote-substitutions.sh.cpp
index ffa8323d3d39..97c30a688567 100644
--- a/libcxx/test/libcxx/selftest/newformat/sh.cpp/remote-substitutions.sh.cpp
+++ b/libcxx/test/libcxx/selftest/newformat/sh.cpp/remote-substitutions.sh.cpp
@@ -16,7 +16,7 @@
 // appear first in the command-line or not.
 
 // FILE_DEPENDENCIES: %t.exe
-// RUN: %{cxx} %{flags} %{compile_flags} %{link_flags} -o %t.exe %s
+// RUN: %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe
 // RUN: %{exec} %t.exe 0
 // RUN: %{exec} ! %t.exe 1
 

diff  --git a/libcxx/test/libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp b/libcxx/test/libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp
index c1856fa0cada..e83d9ba10254 100644
--- a/libcxx/test/libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp
+++ b/libcxx/test/libcxx/selftest/newformat/sh.cpp/substitutions.sh.cpp
@@ -14,7 +14,7 @@
 // - %{exec}
 
 // FILE_DEPENDENCIES: %t.exe
-// RUN: %{cxx} %{flags} %{compile_flags} %{link_flags} -o %t.exe %s
+// RUN: %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe
 // RUN: %{exec} %t.exe "HELLO"
 
 #include <cassert>


        


More information about the libcxx-commits mailing list