Commit Graph

30 Commits

Author SHA1 Message Date
Jacek Blaszczynski
1f3933d382 Address code review feedback 2017-12-18 18:26:55 +01:00
Jacek Blaszczynski
14ebad533d Use IMAGE_FILE_HEADER and add missing Arm 32bit images support 2017-12-18 16:15:58 +01:00
Jacek Blaszczynski
8950183b38 Add Arm64 support to COFF symbol export feature 2017-12-17 01:41:21 +01:00
Pavel Solodovnikov
5db3aac111 Meta: replace empty-string assignments with clear(). 2017-09-16 02:26:49 +03:00
Pavel Solodovnikov
7d5095796a Meta: modernize old-fashioned loops to range-based for.
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
2017-09-12 16:22:47 +03:00
Brad King
3250b9a122 bindexplib: Revert support for constants symbols
Revert the main logic change of commit v3.9.0-rc1~192^2 (bindexplib: fix
constants symbols export, 2017-04-26) and its test case.  Unfortunately
some constants may be provided by multiple object files with different
`@...` suffixes, leading to ambiguous references.  Revert support
pending further investigation.

Fixes: #17045
2017-07-10 14:54:07 -04:00
Albert Ziegenhagel
8d754ad5e7 bindexplib: Skip symbols containing a dot (.)
Symbols including a dot are not valid and result in a `LNK1242` error
when trying to create a library from the def file.  Such symbols happen
to be in object files when using PGI Fortran on Windows and compiling
with debug symbols enabled.  Those symbols do not need to be exported.
2017-05-16 11:22:48 -04:00
Mikhail Paulyshka
afb21342ea bindexplib: fix constants symbols export 2017-04-26 22:23:33 +03:00
Daniel Pfeifer
1d829c862c Use quotes for non-system includes
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'
2017-04-11 22:35:21 +02:00
Mikhail Paulyshka
48fa291469 bindexplib: add ARM support
Fixes: #16728
2017-04-04 08:52:46 -04:00
Mikhail Paulyshka
97c605fd5b bindexplib: remove unused code
Remove code not used since commit v3.7.0-rc1~395^2 (bindexplib: Export
symbols from objects even with explicit markup, 2016-06-30).
2017-03-22 16:20:03 -04:00
Mikhail Paulyshka
7a8860afbc bindexplib: clang-format 2017-03-22 18:05:15 +03:00
Bertrand Bellenot
845c482448 bindexplib: Add method for parsing and integrating .def files 2017-03-21 10:02:33 -04:00
Brad King
4f90e79314 bindexplib: Revise coding style of CMake-specific methods
We exclude this source from `clang-format` due to use of third-party
code.  However, we can manually format the CMake-specific part of the
code using our current style.
2017-03-09 16:28:04 -05:00
Zsolt Parragi
85e08370d0 bindexplib: Always export executable symbols, even they are also readable
Previously bindexplib discarded read-only non-function symbols even in
executable/code sections, but in some specific cases they could still mark
functions.

An example is provided by nop.asm in the AuoExportDll test, which exports
a function only marked by a label. This symbol can be used from C/C++
code, but without this change it would result in an unresolved external
symbol when built as a DLL on Windows.
2017-02-28 09:49:12 -05:00
Daniel Pfeifer
66a7099993 iwyu: Fix VisualStudio specific issues 2016-11-28 14:06:40 -05:00
Brad King
86578eccf2 Simplify CMake per-source license notices
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.
2016-09-27 15:14:44 -04:00
Yury Zhuravlev
f8d4e3d7f8 bindexplib: Export symbols from objects even with explicit markup
Drop our `HaveExportedObjects` check before dumping exports for an
object file.  It is possible for only a subset of needed symbols to have
explicit markup, and re-exporting the marked symbols does not hurt.

This leaves no callers of `HaveExportedObjects`, but leave the
method in place anyway because it may be useful in the future.

Fixes #16161.
2016-07-05 15:19:56 -04:00
Brad King
e1c7747253 Format include directive blocks and ordering with clang-format
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>
2016-04-29 13:58:54 -04:00
Bill Hoffman
75004280af Fix auto export symbols for Dlls containing /bigobj for 64bit builds.
This fixes a bug where 64 bit builds with /bigobj incorrectly determined
that the object files were not 64 bit. This manifested itself with
printf type functions showing up as undefined because the leading
underscore was being removed and should not be removed.
2015-11-19 17:21:03 -05:00
Bill Hoffman
1c1ace2db0 De-duplicate symbols listed in generated module definition files
MS tools have a limit on the number of symbols that can be listed
in a `.def` file.  If multiple `.obj` files provide a symbol then
avoid listing it more than once in the generated `.def` file to
avoid counting toward the limit.
2015-11-18 10:02:48 -05:00
Bill Hoffman
db7f069a4b Windows: Fix 64-bit DLL module definition file generation on VS 2015
With 64-bit Windows builds, there is no need to remove the leading
underscore from all the symbols.  This is because it does not have one
in the .obj file unless it is really in the name.  This did not cause
any trouble until VS 2015 which has some system functions that have a
leading underscore that end up in the .def file.
2015-09-14 09:16:49 -04:00
Bill Hoffman
069aa93b55 bindexplib: Add support for "/bigobj" format objects 2015-07-06 11:11:01 -04:00
Bill Hoffman
61bbbdcf9c bindexplib: Fix treatment of some symbols 2015-07-06 11:11:01 -04:00
Bill Hoffman
de70c922d9 bindexplib: Teach DumpFile to return errors
This will allow callers to know if it worked.
2015-07-06 11:11:01 -04:00
Bill Hoffman
8ea69dfef1 bindexplib: Build source as part of CMakeLib 2015-07-06 11:11:01 -04:00
Bill Hoffman
2963cb2a55 bindexplib: Wrap long lines 2015-07-06 11:11:01 -04:00
Bill Hoffman
4ff0989323 bindexplib: Drop code that CMake does not need 2015-07-06 11:11:00 -04:00
Bill Hoffman
7de8276ca9 bindexplib: Add copyright/license notice block 2015-07-06 11:11:00 -04:00
Bill Hoffman
65086ad778 bindexplib: Import original implementation from CERN
Download the original implementation provided by root.cern.ch with the
following session:

$ wget https://raw.githubusercontent.com/gordonwatts/root-vc-port/f0ee59af/build/win/bindexplib/bindexplib.cxx
$ sha1sum bindexplib.cxx
fa6efafb2c58a0644bd0f6a56fe02ee0d55c7fcd  bindexplib.cxx
$ sed -i 's/ *$//;s/'$'\t''/        /' bindexplib.cxx
2015-07-06 11:10:58 -04:00