diff options
author | Brad King <brad.king@kitware.com> | 2015-09-11 17:50:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-11 17:50:34 (GMT) |
commit | 97ffbcd8a4be25bbc661c68cb7d866bf9d5008d4 (patch) | |
tree | 89b04985f0afb812ab9039a3f44d4428a0ad4899 /Tests/CMakeTests | |
parent | 8e8824149fb6525f1a6da5f9c825a67765ce240b (diff) | |
download | CMake-97ffbcd8a4be25bbc661c68cb7d866bf9d5008d4.zip CMake-97ffbcd8a4be25bbc661c68cb7d866bf9d5008d4.tar.gz CMake-97ffbcd8a4be25bbc661c68cb7d866bf9d5008d4.tar.bz2 |
CMakeParseImplicitLinkInfo: Do not match "VAR=..." as link line (#15737)
When compiling with
LDFLAGS='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
the compiler output includes a line like
COLLECT_GCC_OPTIONS='-specs=/usr/lib/rpm/redhat/redhat-hardened-ld' ...
that our link line regex matches due to an argument ending in "-ld".
Since it is not really the link line no implicit link information is
dectected. Exclude "VAR=..." lines from consideration as link lines to
fix this.
Diffstat (limited to 'Tests/CMakeTests')
-rw-r--r-- | Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in | 7 |
1 files changed, 7 insertions, 0 deletions
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 |