diff options
author | Brad King <brad.king@kitware.com> | 2015-09-14 13:19:57 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-09-14 13:19:57 (GMT) |
commit | 75ad8d342119be9e71006c2f352755ad9565963b (patch) | |
tree | 725f5d5b1e663872a4a74dd476d428b656a26b4b | |
parent | e32604d67be88dda63601eec5bfe734657b0d2ac (diff) | |
parent | 97ffbcd8a4be25bbc661c68cb7d866bf9d5008d4 (diff) | |
download | CMake-75ad8d342119be9e71006c2f352755ad9565963b.zip CMake-75ad8d342119be9e71006c2f352755ad9565963b.tar.gz CMake-75ad8d342119be9e71006c2f352755ad9565963b.tar.bz2 |
Merge topic 'fix-implicit-lib-redhat-hardened-ld'
97ffbcd8 CMakeParseImplicitLinkInfo: Do not match "VAR=..." as link line (#15737)
-rw-r--r-- | Modules/CMakeParseImplicitLinkInfo.cmake | 2 | ||||
-rw-r--r-- | Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index 8abc465..59092bd 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -31,7 +31,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj # Construct a regex to match linker lines. It must match both the # whole line and just the command (argv[0]). set(linker_regex "^( *|.*[/\\])(${linker}|([^/\\]+-)?ld|collect2)[^/\\]*( |$)") - set(linker_exclude_regex "collect2 version ") + set(linker_exclude_regex "collect2 version |^[A-Za-z0-9_]+=") set(log "${log} link line regex: [${linker_regex}]\n") string(REGEX REPLACE "\r?\n" ";" output_lines "${text}") foreach(line IN LISTS output_lines) diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in index 055b183..da614e9 100644 --- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in +++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in @@ -105,6 +105,13 @@ set(linux64_test2_libs "c;/opt/sun/sunstudio12/prod/lib/amd64/libc_supp.a") set(linux64_test2_dirs "/opt/sun/sunstudio12/prod/lib/amd64;/lib64;/usr/lib64") list(APPEND platforms linux64_test2) +# -specs=redhat-hardened-ld +set(linux64_test3_text "COLLECT_GCC_OPTIONS='-specs=/usr/lib/rpm/redhat/redhat-hardened-ld' '-v' '-O2' '-g' '-pipe' '-Wall' '-Werror=format-security' '-fexceptions' '-fstack-protector-strong' '--param' 'ssp-buffer-size=4' '-grecord-gcc-switches' '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1' '-m64' '-mtune=generic' '-I' '/usr/lib64/gfortran/modules' '-o' 'a.out' '-rdynamic' '-shared-libgcc' '-march=x86-64' '-pie' + /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/5.1.1/lto-wrapper -plugin-opt=-fresolution=/tmp/ccNzxFD8.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z now -pie -o a.out /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/Scrt1.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/crtbeginS.o -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1 -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../.. -z relro dummy.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/5.1.1/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/5.1.1/../../../../lib64/crtn.o") +set(linux64_test3_libs "gfortran;m;quadmath;m;c") +set(linux64_test3_dirs "/usr/lib/gcc/x86_64-redhat-linux/5.1.1;/usr/lib64;/lib64;/usr/lib") +list(APPEND platforms linux64_test3) + #----------------------------------------------------------------------------- # Mac |