Commit Graph

1567 Commits

Author SHA1 Message Date
Hsin-Yi Chen
5e00b7aba7 Exclude version blocks by patterns
The version blocks ending with _PLATFORM and _PRIVATE are unstable ABIs.
To exclude them, header-abi-linker --exclude-symbol-version should
accept patterns like *_PLATFORM and *_PRIVATE.

Test: ANDROID_BUILD_TOP=`realpath .` \
      PATH=$PATH:`realpath out/soong/dist/bin` \
      development/vndk/tools/header-checker/tests/test.py
Test: LD_LIBRARY_PATH=out/soong/dist/lib64 \
      out/soong/host/linux-x86/nativetest64/header-checker-unittests/header-checker-unittests
Bug: 298626434
Change-Id: Id82bc013b8de62b5ba8e5bd29f399b1b72ab5d39
2023-09-15 05:13:51 +00:00
Hsin-Yi Chen
c0d2b6e79b Merge "Let build-prebuilts.sh compile unit tests" into main 2023-09-12 07:00:36 +00:00
Hsin-Yi Chen
9beee3bf06 Let build-prebuilts.sh compile unit tests
build-prebuilts.sh compiles header-checker-unittests by default. The
continuous builds ensure that the tests are compilable. The developers
can use the script to build the tests locally.

Test: OUT_DIR=out BUILD_BROKEN_DISABLE_BAZEL=1 \
      development/vndk/tools/header-checker/android/build-prebuilts.sh \
      header-checker-unittests
Test: OUT_DIR=out BUILD_BROKEN_DISABLE_BAZEL=1 DIST_DIR=/tmp/distdir \
      development/vndk/tools/header-checker/android/build-prebuilts.sh
Bug: 280008249
Change-Id: I32d6ade3c527785d68802c1737c94f963ead5b3c
2023-09-11 18:36:54 +08:00
Yi Kong
f8d367d015 Update to clang-r498229b
Bug: 293616148
Change-Id: Ic77a78f463691aa2c927cfa6bea009ef38e9f0d7
Test: presubmit
2023-09-07 10:48:55 +00:00
Hsin-Yi Chen
beda56ad5c Rename Target to Arch in header-checker utils.py
"target" refers to a target arch, a build target, or a make target.
This commit renames the class and the variables to avoid ambiguity.

Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py \
      -products aosp_x86_64 -release trunk_staging
Bug: 297542516
Change-Id: Icfb06e18333d56af802c74494c1d158f367026c9
2023-08-29 08:58:49 +00:00
Hsin-Yi Chen
0433a86ffd Pass release configuration to create_reference_dumps.py
This commit adds -release as a parameter to create_reference_dumps.py.
It is currently optional. Developers can use it to try different
release configurations.

Test: development/vndk/tools/header-checker/utils/create_reference_dumps.py \
      -products aosp_x86_64 -release trunk_staging
Bug: 297542516
Change-Id: Ifb7001ed42dbb9f8d0dd8e6c9738be6d5ea2feca
2023-08-28 08:06:13 +00:00
Hsin-Yi Chen
7d300d7652 Merge "Handle lsdump paths containing soong config hash" into main 2023-07-28 03:20:47 +00:00
Matthew Maurer
6937e35e01 clang-tools: Re-enable bindgen prebuilt
We turned this off for a bit because not all deps were mapped in to the
clang-tools build. Re-enabling now to produce a fresh prebuilt.

Bug: 251506715
Test: ABTD aosp-clang-tools
Change-Id: Ia843be55894946ff0803c43057e58899f99b580f
2023-07-26 23:01:40 +00:00
Hsin-Yi Chen
04cf4d41e9 Handle lsdump paths containing soong config hash
An arch variant directory may contain a soong host config subdirectory.
The ABI dump script extracts the last two directory names from an
intermediate lsdump path. It builds the lsdump if any of the directory
names matches the variant.

Test: ./create_reference_dumps.py -libs libmemtrack \
      -products aosp_arm64
Bug: 291850413
Change-Id: I3dafc68b0dc7bb7faf708e3adfd24082a12a691b
2023-07-25 17:33:29 +08:00
Yabin Cui
cc9c82d2c5 Update clang version to clang-r498229
Bug: 280683256
Test: OUT_DIR=out prebuilts/clang-tools/build-prebuilts.sh
Change-Id: Id1e6449e0792f3937298e0f47c6c0a9f9f8fd08e
2023-07-07 17:55:29 +00:00
Treehugger Robot
4ddf7eec71 Merge "Unbreak build by removing bindgen temporarily" 2023-06-30 18:28:44 +00:00
Matthew Maurer
72fe590178 Unbreak build by removing bindgen temporarily
Bindgen has been updated in platform, but additional repos need to be
mapped into this build to work properly. Since changing manifests
requires special permissions, this unbreaks the build until we can get
the manifest fixed to re-add bindgen.

Test: TH
Change-Id: Idd7bf289212a2570e267eaab0e94d332ed8a44b2
2023-06-29 02:02:52 +00:00
Justin Yun
6d08991cae vndk snapshot update: read txt file with utf-8 encoding
VNDK snapshot updater reads license text files. To avoid unexpected
text files to be read, explicitly set the encoding type and ignore
if failed to read.

Bug: 288846788
Test: add binary to read and see if it is ignored
Change-Id: I7e3d0bbdc6c692ef7dbc6d8bf9d53c67003d0f90
2023-06-28 13:48:55 +09:00
Hsin-Yi Chen
57a28a1076 Merge "Check the state of ofstream" 2023-06-26 06:02:25 +00:00
Hsin-Yi Chen
e235d32717 Check the state of ofstream
This commit fixes the bug that causes the ABI tools to produce invalid
output but return success.

Bug: 288168134
Test: development/vndk/tools/header-checker/tests/test.py
Change-Id: Ifa94667e9d38eff65e943a1d277dd2c7b5493fe5
2023-06-26 11:00:41 +08:00
Hsin-Yi Chen
01018f02c4 Merge "Fix the link to Update-Opt_in-Reference-ABI-Dumps" 2023-06-21 10:10:54 +00:00
Hsin-Yi Chen
9d4a5a7248 Fix the link to Update-Opt_in-Reference-ABI-Dumps
Test: none
Change-Id: I759f825e213cd6dcb42f2b7b29c344a41691aeaf
2023-06-20 17:56:13 +08:00
Justin Yun
d7cd02f7b7 Update ab tool path
Bug: 287915808
Test: utils.get_latest_vndk_bid('android13-gsi')
Change-Id: If5fe7f0e972cc465fd126b7b3ffa6f0234898830
2023-06-19 09:01:15 +00:00
Yi Kong
fda7cced69 Update clang version to clang-r487747c
Test: presubmit
Bug: 279955553
Change-Id: I8043ab75173420f60e828d973ba69d47011c2953
2023-05-13 18:11:44 +01:00
Hsin-Yi Chen
934663b2f0 Merge "Add README about opt-in ABI dumps" 2023-04-25 10:24:17 +00:00
Inseob Kim
46628fff98 Add min_sdk_version prop to snapshots
Bug: 277403349
Test: build vndk/vendor snapshot and build
Change-Id: I460c69cbc5820132690c9d3fb325c5eb504f5366
2023-04-18 16:50:20 +09:00
Justin Yun
9e48f54e06 VNDK snapshot tool generates license information from json
VNDK snapshot zip file includes license information in json files.
Instead of parsing the license text files, read the information from
the json files.
VNDK snapshot v33 and older do not include this information and must
parse the license text files as before.

Bug: 277317599
Test: generate snapshots with/without json information && m nothing
Change-Id: Ibdbc571c9effe6c17f5d82a7a0894ad2d800711f
2023-04-17 15:47:24 +09:00
Hsin-Yi Chen
35fabff46a Add README about opt-in ABI dumps
- Add the commands to write Android.bp, create reference dumps, and
  find the generated dumps.
- Remove "persistent-" from the repo command as it's internal only.

Test: None
Bug: 227282691
Change-Id: I07dc947c0436e2a0e7e5b3a4f812800bd7df2720
2023-04-14 19:31:49 +08:00
Hsin-Yi Chen
62081d11b4 Fix the internal type of enum values
EnumFieldIR has member functions that determine whether the enum value
is signed. The JSON dumper uses the functions to distinguish between
negative values and values >= (1 << 63).

Bug: 277299761
Test: ./test.py
Change-Id: If5f3a33aaf5f53f39019fdd10dde366d48a50340
2023-04-12 11:37:10 +00:00
Yi Kong
1784c71446 Merge "Revert^2 "Update clang version to clang-r487747"" 2023-03-24 13:19:52 +00:00
Hsin-Yi Chen
35fce6fed2 Collect libc++ headers that have no file name extensions
Test: LD_LIBRARY_PATH=prebuilts/clang/host/linux-x86/clang-r475365b/lib \
      out/soong/host/linux-x86/nativetest64/header-checker-unittests/header-checker-unittests
Bug: 271382846
Change-Id: Ica435ac635f6ab4f500e31ae1c38c2928b6dc6ac
2023-03-10 14:45:20 +08:00
Yi Kong
4476b23303 Revert^2 "Update clang version to clang-r487747"
78eb9e45d8

Change-Id: Iefe6911e88102848ef7185b6214020261f73e43e
2023-03-06 08:04:44 +00:00
Hsin-Yi Chen
0802314c7b Collect header files in subdirectories
Test: LD_LIBRARY_PATH=prebuilts/clang/host/linux-x86/clang-r487747/lib \
      out/soong/host/linux-x86/nativetest64/header-checker-unittests/header-checker-unittests
Bug: 271382846
Change-Id: I2f82c0d04870d31e29f854f5256a0d5a6b5455f0
2023-03-03 18:06:12 +08:00
Yi Kong
78eb9e45d8 Revert "Update clang version to clang-r487747"
Revert submission 2462733-fix-clang-tools-r487747

Rollback compiler update

Reverted changes: /q/submissionid:2462733-fix-clang-tools-r487747

Change-Id: I728d075c70c1a9938475069643c62a2cdf2a968f
2023-03-02 08:36:20 +00:00
Yi Kong
c08ebcfe53 Update clang version to clang-r487747
Change-Id: I254e4e31244599c7931a169a571f56b44d34b801
Test: presubmit
Bug: 264965700
2023-03-01 16:45:59 +09:00
Hsin-Yi Chen
feab6687e7 Merge "Convert type_queue to a member of AbiDiffHelper" 2023-02-23 05:04:56 +00:00
Hsin-Yi Chen
3b7728c88b Convert type_queue to a member of AbiDiffHelper
Test: ./test.py
Bug: 255702405
Change-Id: Ic1561812fe2b456b8c21440ef8a2439b0545f874
2023-02-22 13:44:09 +08:00
Hsin-Yi Chen
9a0530cb9b Link clang tools' lib directory before copying clang libraries
This commit restores lib/libc++.so.1 and lib/libclang-cpp.so.16 which
are indirect dependencies of clang tools.

Bug: 218706358
Test: out/soong/dist/bin/versioner -h
Change-Id: I3b9414645dc5b56d322d21e082feca260519d053
2023-02-21 08:26:14 +00:00
Hsin-Yi Chen
78562c0157 Merge "Replace TypeQueueCheckAndPushBack with TypeStackGuard" 2023-02-21 03:10:18 +00:00
Hsin-Yi Chen
4602059a36 Merge "Return DiffStatus from FilterOutRenamedRecordFields" 2023-02-20 08:24:42 +00:00
Hsin-Yi Chen
16e50ed2a6 Merge "Simplify the return value of CompareCommonRecordFields" 2023-02-16 02:32:37 +00:00
Yi Kong
f30be10e46 Merge "Migrate to the new clang lib dir" 2023-02-15 10:05:52 +00:00
Hsin-Yi Chen
033af47aa6 Replace TypeQueueCheckAndPushBack with TypeStackGuard
A followup commit will rename type_queue to type_stack.

Test: ./test.py
Bug: 255702405
Change-Id: Ie5c21b0883f08386d30b80ca955708aa7f4bdb16
2023-02-15 16:48:19 +08:00
Hsin-Yi Chen
17d6299cae Return DiffStatus from FilterOutRenamedRecordFields
The status of the filtered out fields is either kNoDiff or
kIndirectDiff. It does not affect the diff report, but makes
ModuleMerger determine redefined types more accurately.

Test: ./test.py ; update the prebuilt clang tools and build
Bug: 255702405
Change-Id: Ia94225d25e00597affa8b1e01a7c9de592bf5b05
2023-02-15 16:44:32 +08:00
Hsin-Yi Chen
3417140281 Simplify the return value of CompareCommonRecordFields
Before this commit, the function returns
(kDirectDiff, RecordFieldDiffIR *) or (kIndirectDiff/kNoDiff, nullptr).
The commit changes the return value to a DiffStatus. The caller decides
whether to create a RecordFieldDiffIR by the DiffStatus.

Test: ./test.py
Bug: 255702405
Change-Id: If2bfd5bca78e9d924be34ad5c522db9b91382cde
2023-02-15 16:44:18 +08:00
Yi Kong
7daeb1f361 Migrate to the new clang lib dir
Test: presubmit
Bug: 218706358
Change-Id: I6825f7c1f4340a30a14d9d8ce0fb5a3caf813f9e
2023-02-15 16:50:07 +09:00
Hsin-Yi Chen
08e0ce1066 Diff the fields located at the same offset in a class
- Rewrite the diff algorithm to handle multiple fields located at the
  same offset in a class, struct or union.
- Allow renaming a field if its (offset, type) pair is unique.

Bug: 255702405
Test: ./test.py
Change-Id: I79ebe9a827822b0f89d95952fa7d8c30499ca680
2023-02-13 10:23:02 +08:00
Hsin-Yi Chen
9b286a1967 Merge "Diff array types" 2023-02-02 08:27:42 +00:00
Hsin-Yi Chen
6ecc9e3997 Merge "Rename GenericFieldDiffInfo to RecordFieldDiffResult" 2023-02-02 06:31:49 +00:00
Hsin-Yi Chen
64930c428f Diff array types
This commit implements the function that compares array size, alignment,
and element type.

Test: ./test.py ; update prebuilts/clang-tools and build
Bug: 255702405

Change-Id: I4f25d22f060cfda04bbd88b9c2521461b95e6829
2023-02-02 12:58:35 +08:00
Hsin-Yi Chen
eb5797a263 Rename GenericFieldDiffInfo to RecordFieldDiffResult
Test: ./test.py
Bug: 255702405
Change-Id: I7e1112697f75b0a93ab821a128054e7e80acd6e1
2023-02-01 16:22:31 +08:00
Yabin Cui
7d47151afb Merge "Update clang-tools build to clang-r475365b" 2023-01-19 20:42:44 +00:00
Yabin Cui
deddd88b27 Update clang-tools build to clang-r475365b
Also remove -std=c++14 flag. Because clang 16 uses c++17
by default. And some headers don't compile with c++14.

Bug: 253033919
Test: run build-prebuilts.sh
Change-Id: Ia76c227831ed62a9de190fb1d816f23d7c92fad2
2023-01-18 10:27:50 -08:00
Hsin-Yi Chen
3a51bf53f1 Add a field for arrays of unknown bound
The ABI tools do not diff the array length. They cannot distinguish
between arrays of unknown bound (e.g., int foo[]) and arrays of zero
length (e.g., int bar[0]). To implement array diff, this commit adds
"is_of_unknown_bound" field to the ABI dumps. It defaults to false so
that it can be omitted for common cases.

Test: ./test.py ; update prebuilts/clang-tools and build
Bug: 255702405
Change-Id: I5db163eb62e95fa01377ef7202e70cc2a0e89524
2023-01-16 17:36:38 +08:00
Hsin-Yi Chen
e07e343451 Merge "Fix the bug that generates multiple definition of references" 2023-01-10 03:08:11 +00:00