18 Commits

Author SHA1 Message Date
Juergen Ributzka
ea60fd7de4 Disable MachO TBD write tests for Windows.
The tests are failing on the windows bots. I am disabling them for now.
This is a followup to r356820.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356826 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-23 00:03:23 +00:00
Juergen Ributzka
6dbc6445b5 [TextAPI] TBD Reader/Writer
Add basic infrastructure for reading and writting TBD files (version 1 - 3).

The TextAPI library is not used by anything yet (besides the unit tests). Tool
support will be added in a separate commit.

The TBD format is currently documented in the implementation file (TextStub.cpp).

https://reviews.llvm.org/D53945

Update: This contains changes to fix issues discovered by the bots:
 - add parentheses to silence warnings.
 - rename variables
 - use PlatformType from BinaryFormat
 - Trying if switching from a vector to an array will appeas the bots.
 - Replace the tuple with a struct to work around an explicit constructor bug.
 - This fixes an issue where we were leaking the YAML document if there was a
   parsing error.

Updated the license information in all files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356820 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-22 22:46:52 +00:00
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Nico Weber
9e31dd76e3 Rename TapiTests to TextAPITests
This makes the target name consistent with how all the other unit tests are
named.

Differential Revision: https://reviews.llvm.org/D56216


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350339 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 18:24:58 +00:00
Armando Montanez
3995aa63f6 [TextAPI][elfabi] Fix failing tests from D56020
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349963 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21 21:44:09 +00:00
Armando Montanez
ec2e0f9305 [TextAPI][elfabi] Fix YAML support for weak symbols
Weak symbols are supposed to be supported in the ELF TextAPI
implementation, but the YAML handler didn't read or write the `Weak`
member of ELFSymbol. This change adds the YAML mapping and updates tests
to ensure correct behavior.

Differential Revision: https://reviews.llvm.org/D56020

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349950 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-21 20:45:58 +00:00
Armando Montanez
0665736292 [TextAPI][elfabi] Make SoName optional
This change makes DT_SONAME treated as an optional trait for ELF TextAPI
stubs. This change accounts for the fact that shared objects aren't
guaranteed to have a DT_SONAME entry. Tests have been updated to check
for correct behavior of an optional soname.

Differential Revision: https://reviews.llvm.org/D55533

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348817 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-11 01:00:16 +00:00
Sam Clegg
9bd74f1b74 Fix LLVM_LINK_LLVM_DYLIB build of TapiTests
A dependency on TestingSupport was introduced in rL348735 but
library was not incldued in the LLVM_LINK_LLVM_DYLIB build.

Differential Revision: https://reviews.llvm.org/D55526

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348803 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-10 22:01:33 +00:00
Armando Montanez
01342484a4 [TextAPI][elfabi] Make TBE handlers functions that return Errors
Since TBEHandler doesn't maintain state or otherwise have any need to be
a class right now, the read and write functions have been moved out and
turned into standalone functions. Additionally, the TBE read function
has been updated to return an Expected value for better error handling.
Tests have been updated to reflect these changes.

Differential Revision: https://reviews.llvm.org/D55450

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348735 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-10 02:36:33 +00:00
Sam Clegg
a97d9f8bb5 [llvm-tapi] Don't try to override SequenceTraits for std::string
For some reason this doesn't seem to work with LLVM_LINK_LLVM_DYLIB
build.

See https://logs.chromium.org/logs/chromium/bb/client.wasm.llvm/linux/37764/+/recipes/steps/LLVM_regression_tests/0/stdout

What is more it seems that overriding these traits for core types
(including std::string) is not supported/recommend by YAMLTraits.h.
See line 1918 which has the assertion:
 "only use LLVM_YAML_IS_SEQUENCE_VECTOR for types you control"

Differential Revision: https://reviews.llvm.org/D55381

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348630 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-07 19:29:00 +00:00
Armando Montanez
bab257c102 [llvm-tapi] initial commit, supports ELF text stubs
http://lists.llvm.org/pipermail/llvm-dev/2018-September/126472.html

TextAPI is a library and accompanying tool that allows conversion between binary shared object stubs and textual counterparts. The motivations and uses cases for this are explained thoroughly in the llvm-dev proposal [1]. This initial commit proposes a potential structure for the TAPI library, also including support for reading/writing text-based ELF stubs (.tbe) in addition to preliminary support for reading binary ELF files. The goal for this patch is to ensure the project architecture appropriately welcomes integration of Mach-O stubbing from Apple's TAPI [2].

Added:

 - TextAPI library
 - .tbe read support
 - .tbe write (to raw_ostream) support

[1] http://lists.llvm.org/pipermail/llvm-dev/2018-September/126472.html
[2] https://github.com/ributzka/tapi

Differential Revision: https://reviews.llvm.org/D53051


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348170 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-03 19:30:52 +00:00
Hans Wennborg
b075bab277 Revert r347823 "[TextAPI] Switch back to a custom Platform enum."
It broke the Windows buildbots, e.g.
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/21829/steps/test/logs/stdio

This also reverts the follow-ups: r347824, r347827, and r347836.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347874 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 15:47:24 +00:00
Juergen Ributzka
8d8a63ebb5 [TextAPI] Switch back to a custom Platform enum.
Moving to PlatformType from BinaryFormat had some UB fallout when handing
unknown platforms or malformed input files.

This should fix the sanitizer bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347836 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 05:56:03 +00:00
Juergen Ributzka
6f247b9c72 [TextAPI] TBD Reader/Writer (bot fixes: take 2)
Replace the tuple with a struct to work around an explicit constructor bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347827 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 02:28:58 +00:00
Juergen Ributzka
e3fbeeb6a5 [TextAPI] TBD Reader/Writer (bot fixes)
Trying if switching from a vector to an array will appeas the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347824 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 01:55:57 +00:00
Juergen Ributzka
5fe2f7f3d3 [TextAPI] TBD Reader/Writer
Add basic infrastructure for reading and writting TBD files (version 1 - 3).

The TextAPI library is not used by anything yet (besides the unit tests). Tool
support will be added in a separate commit.

The TBD format is currently documented in the implementation file (TextStub.cpp).

https://reviews.llvm.org/D53945

Update: This contains changes to fix issues discovered by the bots:
 - add parentheses to silence warnings.
 - rename variables
 - use PlatformType from BinaryFormat

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347823 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-29 01:20:46 +00:00
Juergen Ributzka
54b34d20c2 Revert "[TextAPI] TBD Reader/Writer"
Reverting to unbreak bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347809 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 21:38:28 +00:00
Juergen Ributzka
1d24883118 [TextAPI] TBD Reader/Writer
Add basic infrastructure for reading and writting TBD files (version 1 - 3).

The TextAPI library is not used by anything yet (besides the unit tests). Tool
support will be added in a separate commit.

The TBD format is currently documented in the implementation file (TextStub.cpp).

https://reviews.llvm.org/D53945

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347808 91177308-0d34-0410-b5e6-96231b3b80d8
2018-11-28 21:27:00 +00:00