Commit Graph

53584 Commits

Author SHA1 Message Date
Alex Richardson 115ff6a347 cmELF: Include the ELF parsing code unconditionally
Now that the ELF definitions are provided on all platforms there is no
need to keep the CMake_USE_ELF_PARSER option.
2021-06-24 10:57:51 -04:00
Alex Richardson 5dfa3ddbe5 cmELF: Allow building without system ELF headers
Use ELF headers vendored in `Utilities/cmelf` to get the ELF constants
and types. Using the same ELF definition header for all compilation
targets allows removing some #ifdefs depending on the host OS since we
know all required ELF constants will always be present. To reduce the
size of this commit, the CMake_USE_ELF_PARSER definite will be removed
in a separate commit.

This allows me to use CMAKE_BUILD_WITH_INSTALL_RPATH=False and the Ninja
generator on macOS, whereas before it would always give me the following
error message (despite cross-compiling for an ELF-based platform):

```
The install of the <name> target requires changing an RPATH from
  the build tree, but this is not supported with the Ninja generator unless
  on an ELF-based platform.  The CMAKE_BUILD_WITH_INSTALL_RPATH variable may
  be set to avoid this relinking step.
```
2021-06-24 10:57:51 -04:00
Alex Richardson 0da1540aaa cmELF: Fix check for TagMipsRldMapRel
DT_MIPS_RLD_MAP_REL is a machine-speicific dynamic tag, so other
architectures could re-use the value of 0x70000035 to mean something
else.  Before using DT_MIPS_RLD_MAP_REL, we have to check that the ELF
file is actually has a e_machine of EM_MIPS.
2021-06-24 10:57:51 -04:00
Brad King e21188df8b cmELF: Open file explicitly in binary mode
ELF is a binary format.
2021-06-24 10:57:51 -04:00
Brad King 70cdb36d25 Merge branch 'upstream-elf' into import-elf
# By FreeBSD Upstream
* upstream-elf:
  elf 2021-06-23 (f13da247)
2021-06-23 13:57:38 -04:00
FreeBSD Upstream 7a0a37ca41 elf 2021-06-23 (f13da247)
Code extracted from:

    https://github.com/freebsd/freebsd-src.git

at commit f13da24715a75ce0fdac31062866877d980aa908 (main).
2021-06-23 13:57:37 -04:00
Brad King 18038042ed cmelf: Add script to import the FreeBSD ELF headers
These headers will be used to provide the ELF parsing code on all host
operating systems (including those that don't have an ELF header, e.g.
macOS).  This will also allow removing various OS-dependent #ifdefs from
the cmELF code.  Add a script that was used to automate this import.

Co-authored-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
2021-06-23 13:55:54 -04:00
Brad King 6c5f21d10e Merge topic 'clang-compiler-warnings'
88e56c2e5a Enable compiler warnings when compiling CMake with Clang
cadf2b632e Fix -Wpessimizing-move warnings in QCMake::loadPresets()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6252
2021-06-23 08:56:28 -04:00
Brad King 694dfcae13 Merge branch 'release-3.21' 2021-06-23 08:55:27 -04:00
Brad King 7470ee3e05 Merge topic 'cuda-rules-override'
1d9009c27a CUDA: Implement CMAKE_USER_MAKE_RULES_OVERRIDE[_CUDA]

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6253
2021-06-23 08:55:27 -04:00
Brad King 60c5188fe5 Merge topic 'cuda-rules-override' into release-3.21
1d9009c27a CUDA: Implement CMAKE_USER_MAKE_RULES_OVERRIDE[_CUDA]

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6253
2021-06-23 08:55:26 -04:00
Kitware Robot fd2aa87278 CMake Nightly Date Stamp 2021-06-23 00:01:09 -04:00
Alex Richardson 88e56c2e5a Enable compiler warnings when compiling CMake with Clang
I noticed that I wasn't getting any compiler warnings when testing my
merge requests locally. Turns out this happens because I am compiling
using Clang rather than GCC, so no warning flags are added to the build.
d06a9bdf3a enabled warnings by default
for GCC > 4.2, but Clang supports them too. This has been the case
since at least Clang 3.0 (I couldn't test any older versions on
godbolt.org). For AppleClang, we can also assume that the warning flags
are supported. According to Wikipedia Clang became the default
compiler starting with Xcode 4.2, and the table on
https://trac.macports.org/wiki/XcodeVersionInfo, states that XCode
4.2 Clang was based on upstream Clang 3.0, which supports all the
warning flags.

The warning flags are currently not added when compiling with clang-cl
since this exposes some pre-existing warnings that need to be fixed first.
2021-06-22 16:17:58 +01:00
Alex Richardson cadf2b632e Fix -Wpessimizing-move warnings in QCMake::loadPresets() 2021-06-22 16:13:21 +01:00
Seth R Johnson 1d9009c27a CUDA: Implement CMAKE_USER_MAKE_RULES_OVERRIDE[_CUDA]
This is implemented by other languages, and is documented for
all languages.  This was accidentally left out of CUDA.
2021-06-22 09:59:01 -04:00
Brad King 66488d4eb3 Merge topic 'cmsystemtools-multiple-formats'
2e1149874d cmSystemTools: Support multiple binary formats

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6239
2021-06-22 09:44:06 -04:00
Kitware Robot ea02397dab CMake Nightly Date Stamp 2021-06-22 00:01:10 -04:00
Brad King 09cf726f48 Merge branch 'release-3.21' 2021-06-21 11:49:34 -04:00
Brad King 6d9fec6c0b Merge branch 'release-3.20' into release-3.21 2021-06-21 11:49:10 -04:00
Brad King 3bf56de28f Merge branch 'release-3.20' 2021-06-21 11:48:17 -04:00
Brad King efa5e1f367 CMake 3.20.5 v3.20.5 2021-06-21 11:23:19 -04:00
Brad King 25e82666e4 Help: Add 3.20 release note section for 3.20.{3,4,5}
Make it clear that the notes for these patch releases were not
forgotten, and that there were simply no changes to documented features
or interfaces.
2021-06-21 11:20:33 -04:00
Brad King ece19404d3 Merge branch 'release-3.21' 2021-06-21 10:07:02 -04:00
Brad King 8be2c8d57d Merge branch 'release-3.20' 2021-06-21 10:06:59 -04:00
Brad King dec927716e Merge branch 'release-3.20' into release-3.21 2021-06-21 10:06:46 -04:00
Brad King bded993978 Merge branch 'release-3.21' 2021-06-21 10:03:37 -04:00
Brad King 7d0018bd8e Merge topic 'ep-git-update-commit-ref'
360ff17dc6 ExternalProject: Use ${ref}^0 to avoid MSYS/Cygwin shell substitutions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6249
2021-06-21 10:03:37 -04:00
Brad King b948b46668 Merge topic 'ep-git-update-commit-ref' into release-3.21
360ff17dc6 ExternalProject: Use ${ref}^0 to avoid MSYS/Cygwin shell substitutions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6249
2021-06-21 10:03:36 -04:00
Brad King 32eca9bca2 Merge branch 'release-3.21' 2021-06-21 10:01:25 -04:00
Brad King 782b6bfc26 Merge topic 'test-xcode-13' into release-3.21
1dd0eae4fc Tests: Fix xcode version detection for Xcode 13 on ARM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6248
2021-06-21 10:01:25 -04:00
Brad King 623d00ca05 Merge topic 'test-xcode-13'
1dd0eae4fc Tests: Fix xcode version detection for Xcode 13 on ARM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6248
2021-06-21 10:01:25 -04:00
Brad King 2992d13b8d Merge branch 'release-3.21' 2021-06-21 09:59:57 -04:00
Brad King 7b0cf0da9d Merge topic 'tutorial-sphinx-targets'
73898c4922 Tutorial: Make code snippets linkable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6247
2021-06-21 09:59:57 -04:00
Brad King 6438a03c73 Merge topic 'tutorial-sphinx-targets' into release-3.21
73898c4922 Tutorial: Make code snippets linkable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6247
2021-06-21 09:59:56 -04:00
Brad King 6c95f1cd44 Merge branch 'release-3.21' 2021-06-21 09:58:04 -04:00
Brad King 375e14b5fe Merge topic 'doc-source_group-scope' into release-3.21
2abce79409 Help: Clarify the usage scope of source_group

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6246
2021-06-21 09:58:04 -04:00
Brad King 9612034cac Merge topic 'doc-source_group-scope'
2abce79409 Help: Clarify the usage scope of source_group

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6246
2021-06-21 09:58:04 -04:00
Brad King 0db9483923 Merge branch 'release-3.21' 2021-06-21 09:56:49 -04:00
Brad King 69b64ed85a Merge topic 'GNUInstallDirs-alpine'
37b24e0bed GNUInstallDirs: don't use lib64 on Alpine Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6244
2021-06-21 09:56:49 -04:00
Brad King ed5bd39baa Merge topic 'GNUInstallDirs-alpine' into release-3.21
37b24e0bed GNUInstallDirs: don't use lib64 on Alpine Linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6244
2021-06-21 09:56:48 -04:00
Brad King 621f7bf2e5 Merge branch 'test-xcode-13' into release-3.20
Merge-request: !6248
2021-06-21 09:56:09 -04:00
Brad King a01a88dc95 Merge topic 'FindPkgConfig-PKG_CONFIG-args'
35d3e00e4e FindPkgConfig: split args if loaded from environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6222
2021-06-21 09:53:51 -04:00
Brad King d60d6c269a Merge topic 'ctest_runtime_labels'
bd38749fd4 ctest: allow test output to add labels

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6234
2021-06-21 09:52:36 -04:00
Brad King cbdd6747ad Merge topic 'msvc-isystem'
f29e1874ad Compiler/MSVC: use the `-external:I` flag for system includes
5a5c85dffd Tests/IncludeDirectories: support MSVC in system include tests
399a3204bb Tests/IncludeDirectories: align sibling predicates
20ab49193b Tests/IncludeDirectories: factor out applying flags to targets
809f7b0c3a Tests/IncludeDirectories: fix copy pasta for otherlib
b094324948 Tests/IncludeDirectories: Include system headers via angle brackets
8f63f3b04e cmVisualStudio10TargetGenerator: remove unused variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Julien Waechter <greenjava@gmail.com>
Acked-by: DE-VS wenglor <devs.wenglor@gmail.com>
Merge-request: !4766
2021-06-21 09:50:52 -04:00
Brad King d6c0cc1681 Merge branch 'ep-git-update-commit-ref' into release-3.20
Merge-request: !6249
2021-06-21 09:47:43 -04:00
Brad King 3a66a58fc1 Merge topic 'compiler-id-lang-vars' into release-3.21
c8eb357738 CompilerId: Tolerate variables named for languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6243
2021-06-21 09:46:30 -04:00
Brad King 28f4686fc6 Merge branch 'release-3.21' 2021-06-21 09:46:30 -04:00
Brad King d4f2b1f3c1 Merge topic 'compiler-id-lang-vars'
c8eb357738 CompilerId: Tolerate variables named for languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6243
2021-06-21 09:46:30 -04:00
Alex Richardson 2e1149874d cmSystemTools: Support multiple binary formats
This prepares the code to handle both the ELF and XCOFF being enabled by
trying to parse an ELF file first and if that fails falling back to XCOFF.
2021-06-21 09:36:39 -04:00
Kitware Robot 858164d155 CMake Nightly Date Stamp 2021-06-21 00:01:20 -04:00