summaryrefslogtreecommitdiffstats
path: root/Source/cmELF.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Source: fix more -Wmissing-prototypes warningsSean McBride2021-10-251-3/+0
|
* Source: fix many -Wmissing-prototypes warnings by marking functions staticSean McBride2021-10-251-3/+3
|
* Merge branch 'master' into file-grd-archKyle Edwards2021-07-121-57/+17
|\
| * cmELF: Allow building without system ELF headersAlex Richardson2021-06-241-60/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ```
| * cmELF: Fix check for TagMipsRldMapRelAlex Richardson2021-06-241-0/+15
| | | | | | | | | | | | | | 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.
| * cmELF: Open file explicitly in binary modeBrad King2021-06-241-1/+1
| | | | | | | | ELF is a binary format.
* | file(GET_RUNTIME_DEPENDENCIES): Check architecture of dependenciesKyle Edwards2021-07-121-0/+16
|/ | | | Fixes: #22106
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-4/+4
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-071-3/+3
| | | | Fixes: #20666
* Refactoring: use append functions from cmext/algorithmMarc Chevrier2019-12-171-3/+2
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-4/+8
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+1
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* clang-tidy: modernize-use-autoRegina Pfeifer2019-09-101-4/+2
| | | | | | Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-041-8/+7
| | | | | | | | Automate the conversion with perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g' then manually fix a few places.
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-16/+16
|
* cmELF: Modernize to use std::unique_ptr instead of new/deleteSebastian Holtermann2019-07-171-27/+27
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-1/+2
|
* clang-tidy: fix warnings from version 7Regina Pfeifer2018-11-201-1/+1
| | | | | Fix some warnings that are new since clang-tidy version 4, and update `.clang-tidy` to suppress the rest.
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-20/+21
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-2/+1
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-7/+6
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Use C++11 override instead of CM_OVERRIDEBrad King2017-09-151-7/+7
| | | | | | | | We now require C++11 support including `override`. Drop use of the old compatibility macro. Convert references as follows: git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' | xargs sed -i 's/CM_OVERRIDE/override/g'
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-8/+4
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-10/+10
|
* Pass large types by const&, small types by valueDaniel Pfeifer2017-06-031-4/+4
|
* cmELF: Remove now-redundant check for DT_RUNPATH's existenceMaya Rashish2017-04-261-4/+0
| | | | We define it if it's not already defined.
* cmELF: Define DT_RUNPATH if it isn't already definedMaya Rashish2017-04-261-0/+3
| | | | | | | The value of 29 is used by binutils and is used in the System V ABI draft from 2001. It isn't defined on NetBSD 6.0.
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-3/+3
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* elf: Remove GetDynamicEntryCount and ReadBytes methodsJames Cowgill2016-10-071-40/+1
| | | | These are no longer used after the DynamicEntryList changes.
* cmSystemTools, elf: handle DT_MIPS_RLD_REL_MAP in RemoveRPathJames Cowgill2016-10-071-0/+6
|
* elf: add DynamicEntryList methods and rpath tag constantsJames Cowgill2016-10-061-0/+77
|
* elf: remove tag switch from ELF_Dyn ByteSwap functionJames Cowgill2016-10-061-115/+5
| | | | | sizeof(dyn.d_un.d_val) always equals sizeof(dyn.d_un.d_ptr) so every byte swap call in this function is identical.
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-2/+6
|
* CMake: don't use else after returnDaniel Pfeifer2016-08-181-18/+9
|
* Make sure unnused parameters are /*named*/Daniel Pfeifer2016-08-161-4/+4
|
* cmELF: Port to SCO OpenServer 5.0.7/3.2Patrick Welche2016-08-021-2/+11
| | | | | | | | Take changes used by pkgsrc [1]: * SCO OpenServer 5.0.7/3.2 does not support 64-bit ELF. [1] http://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc/devel/cmake/patches/
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-6/+7
| | | | | | | | | | | | Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to our own implementation adopted from the KWSys auto_ptr implementation. Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers that do not warn about it. Automate the client site conversions: git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \ 's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
* use CM_NULLPTRDaniel Pfeifer2016-06-281-10/+10
|
* Add CM_OVERRIDE to some functionsDaniel Pfeifer2016-06-271-5/+5
| | | | | | | Run clang-tidy's modernize-use-override checker. This checker must have issues in version 3.8. It has way too little matches. And it adds override to destructors. Revert the changes on the destructors and change override to CM_OVERRIDE.
* Simplify boolean expressionsDaniel Pfeifer2016-06-021-3/+3
| | | | | | Use clang-tidy's readability-simplify-boolean-expr checker. After applying the fix-its, revise all changes *very* carefully. Be aware of false positives and invalid changes.
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-357/+342
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* Port CMake from cmIML to KWIMLBrad King2015-12-181-7/+4
| | | | KWIML no longer uses a configured prefix.
* cmELF: Use KWIML ABI.h header to get endian-nessBrad King2015-12-091-4/+3
| | | | Port away from KWSys CPU header.
* cmELF: Avoid divide by zero if there are no dynamic section entriesTy Smith2015-11-191-1/+7
|