Commit graph

181 commits

Author SHA1 Message Date
Josh Gao
8e13b67c64 versioner: properly handle extern "C", "C++".
extern "C" and "C++" are parsed as a LinkageSpecDecl with the real Decl
as a child node. This leads to the preprocessor sticking its guard
between the extern specifier and the declaration.

Update the AST visitor to add a special-case for calculating the
SourceRange on a LinkageSpecDecl, and add a test.

Bug: https://github.com/android-ndk/ndk/issues/440
Test: python run_tests.py
Change-Id: I76445fe366cef46cfd2f16fb93d534d410c5edca
2017-11-06 17:23:36 -08:00
Pirama Arumuga Nainar
ac5603a979 Make versioner depend on lib{LLVM,clang}_android.so
Bug: http://b/64121881

The modules built in the Android tree are now named
lib{LLVM,clang}_android.so.  Let versioner depend on these temporarily
before eventually depending on the prebuilt libraries.

Test: aosp_marlin checkbuild with FORCE_BUILD_LLVM_COMPONENTS set and
unset.

Change-Id: I4e04dd2c74a19e0918f81bac04c1daee63ed6b24
2017-11-06 11:26:57 -08:00
Sergii Piatakov
564ed96caf tools: fix error when /bin/sh isn't bash
The following scripts use `bash` specific variable `${BASH_SOURCE[0]}`
so this doesn't work correct in case when `/bin/sh` isn't `bash`.

Test: repo upload bionic
Change-Id: I12ce0666f9404107dceb03960bad4ec11b14ba2d
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2017-11-02 20:41:59 +02:00
Josh Gao
ab25d0bd10 versioner: compile headers in both C and C++ mode.
Bug: https://github.com/android-ndk/ndk/issues/440
Test: python run_tests.py
Change-Id: Ib572a8fdcc00f6b88a25003a085b16ce9698d692
2017-10-30 12:47:24 -07:00
Josh Gao
38685e1887 versioner: follow __asm__ labels.
Attribute the versioning information on `void foo() __asm("bar")` to
bar, not foo.

The various long double functions in <math.h> run into this.

Bug: https://github.com/android-ndk/ndk/issues/440
Test: python run_tests.py
Test: m
Change-Id: Idd3681ddbd006b4705608449935c9cfacfa3556e
2017-10-30 12:47:24 -07:00
Josh Gao
35aa21352e versioner: kill some obsolete versions.
Make the selection of a non-default API level non-fatal, so that we
won't have to continually fix all of the tests every time we remove an
API version.

Test: versioner
Test: python run_tests.py
Change-Id: I96429584e352f7e012c5129da3c02dc1b4b30061
2017-10-24 17:51:25 -07:00
Josh Gao
0062b3e60a versioner: properly handle declarations with no identifier.
Some declarations, like bitfield members, don't need identifiers.

Bug: https://github.com/android-ndk/ndk/issues/440
Test: ran versioner with -x c++ on a manually reduced <linux/timex.h>
Change-Id: Ic7eea780762cff653c54fdde4d10df203d630c25
2017-10-24 17:51:06 -07:00
Josh Gao
5317f2d48b versioner: add extern "C" to tests.
Bug: https://github.com/android-ndk/ndk/issues/440
Test: python run_tests.py
Change-Id: Id893979146bc609a17bd1fa2a6bec6f10dfe4804
2017-10-24 16:02:25 -07:00
Chih-Hung Hsieh
84f0dcd59e Use -Werror in bionic
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Ic68141a5c50880c485646e38349f94b866267bd9
2017-10-02 13:21:22 -07:00
Elliott Hughes
b3639adf9c Merge changes I76dde1e3,I54fec461
* changes:
  Add <sys/random.h>.
  Run other maintenance scripts as part of the preupload hooks.
2017-09-29 15:39:29 +00:00
Elliott Hughes
9651093569 Run other maintenance scripts as part of the preupload hooks.
And get back up to date by actually running them...

Bug: N/A
Test: uploaded this
Change-Id: I54fec461190e8570929fdcbcbf2746ddd6a4b293
2017-09-28 22:28:23 -07:00
Dan Willemsen
7ebc81f4a2 Fix error found building relocation packer for host bionic
bionic/tools/relocation_packer/src/main.cc:109:7: error: comparison of constant
-1 with expression of type 'typeof (read(fd.get(), e_ident, (16)) != (16))'
(aka 'bool') is always false [-Werror,-Wtautological-constant-out-of-range-compare]

  if (TEMP_FAILURE_RETRY(read(fd.get(), e_ident, EI_NIDENT) != EI_NIDENT)) {
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

bionic/libc/include/unistd.h:243:18: note: expanded from macro 'TEMP_FAILURE_RETRY'
    } while (_rc == -1 && errno == EINTR); \
             ~~~ ^  ~~
1 error generated.

Bug: 31559095
Test: mmma bionic
Change-Id: I473a19e3d51ff355233ae7f87b1013be069edb1f
2017-09-22 19:37:35 +00:00
Treehugger Robot
ad5c4e3596 Merge "Fix out-of-bounds deque access causing build failure." 2017-08-18 01:55:39 +00:00
Andreas Huber
113e9b1bc1 Fix out-of-bounds deque access causing build failure.
Bug: http://b/64802958
Test: built successfully

Change-Id: I8029826f0e4c7f578155d7db545e7786c76a0cdf
2017-08-17 22:26:20 +00:00
George Burgess IV
1de2e358ca Enable FORTIFY in unoptimized builds
GCC's FORTIFY required optimizations to be enabled in order to function
properly. Clang's FORTIFY doesn't have this limitation, so it seems
pointless to keep it disabled due to a GCC-specific limitation.

Bug: 12231437
Test: Checkbuild on bullhead internal master + CtsBionicTestCases. No
new failures.

Change-Id: I74aa35f9d3f3d2a6b11a7adfe72a787e3d7f7f36
2017-08-15 21:20:09 -07:00
Treehugger Robot
1db06faa38 Merge "libc: Split FORTIFY into its own headers" 2017-08-01 02:03:52 +00:00
Treehugger Robot
b1bbf2bb24 Merge "versioner: compile with clang -include foo.h -." 2017-07-29 16:36:33 +00:00
Josh Gao
d2ab9ffcb6 versioner: compile with clang -include foo.h -.
At least one warning only triggers in files that are included, instead
of being passed directly. Switch to compiling with -include, and fix
the resulting warnings.

Bug: https://github.com/android-ndk/ndk/issues/474
Test: mma -j && versioner
Test: python tools/versioner/run_tests.py
Change-Id: I784698c18540c9cc30f372f279a1cec1d75721ea
2017-07-28 12:57:16 -07:00
George Burgess IV
b97049c039 libc: Split FORTIFY into its own headers
This patch cleans up our standard headers by moving most of the FORTIFY
cruft out in to its own sandbox. In order to include the *_chk and
*_real declarations, you can either enable FORTIFY, or `#define
__BIONIC_DECLARE_FORTIFY_HELPERS`.

Both sys/select.h and strings.h are explicitly ignored by this patch.
Both of these files have very small __BIONIC_FORTIFY blocks, and don't
define any actual FORTIFY'ed functions (just macros, and 3 *_chk
functions).

This patch also makes the versioner ignore the FORTIFY implementation
headers, since we're guaranteed to pick the FORTIFY'ed headers up when
looking at the regular headers. (...Not to mention that making the
FORTIFY'ed headers freestanding would be annoying to do and maintain for
~no benefit).

We bake the knowledge of where FORTIFY headers live directly into the
versioner. We could go with a more general approach (e.g. adding an -X
IGNORED_FILE flag that tells the versioner to ignore
$HEADER_PATH/$IGNORED_FILE), but we'd then have to repeat that for every
test, every manual invocation of the versioner, etc. for no benefit
that's obvious to me.

Bug: 12231437
Test: m checkbuild on bullhead internal master + CtsBionicTestCases. no
new errors.

Change-Id: Iffc0cc609009b33d989cdaddde0a809282131a5b
2017-07-27 17:00:13 -07:00
dimitry
0acb63aaa6 Properly handle elf-files without relocation sections
Relocation packer no longer complains about missing
relocation sections.

Test: relocation-packer-unit-tests
Test: mm
Change-Id: I56814be326c15e046db1a96d14568d951f689ae2
2017-07-11 17:00:09 +02:00
Treehugger Robot
05fd20c797 Merge changes Ia7200bf0,I86999bb7
* changes:
  versioner: fix leak.
  versioner: add symlink for dependencies.
2017-05-04 04:08:22 +00:00
Andreas Gampe
d10d3eece1 versioner: disable container overflow checks
Temporary workaround.

Bug: 37775238
Test: ASAN_OPTIONS= SANITIZE_HOST=address m
Change-Id: If9e9df45d83f8412caafcece87337a5c9df3a1c8
2017-05-01 16:31:51 -07:00
Josh Gao
b50b8c8886 versioner: fix leak.
Replace an intentional leak of a buffer allocated by realpath with a use
of android::base::Realpath.

Bug: http://b/37727515
Test: tools/versioner/run_tests.py
Change-Id: Ia7200bf0e1c485050e860e21ff15784941366bec
2017-04-27 17:25:32 -07:00
Josh Gao
0be1dabfc6 versioner: add symlink for dependencies.
Add a symlink where dependencies used to live, so that `versioner`
works.

Test: versioner
Test: tools/versioner/run_tests.py
Change-Id: I86999bb79baad16039709306591cb9540fb533ca
2017-04-27 17:25:23 -07:00
Yi Kong
06be3459ca Update bionic after Clang rebase
After the new rebase of Clang, we now supports alloc_size attribute, so
we can remove the warning about switching to alloc_size once Clang has
support.

Compiler.setInvocation has changed argument type from raw pointer to
shared pointer. Add version check here so that we can build under either
old rebase or the new rebase.

Test: build
Bug: 37423073
Change-Id: I4563eaf93bae6c59a4a19318f8caa92bd361b3ab
2017-04-26 10:44:12 -07:00
Yi Kong
ff6c8de4f5 Remove unused lambda captures
Clean up. This fixes build under -Wunused-lambda-capture.

Test: build
Change-Id: Ic12aa39e14ed55dbb28cf55303f9c4258179037d
2017-04-20 14:37:56 -07:00
Treehugger Robot
a07033e0dc Merge "versioner: fix LLVM assertion failure." 2017-04-06 23:35:52 +00:00
Josh Gao
8ef9874d56 versioner: fix LLVM assertion failure.
MemoryBuffer::getOpenFileSlice asserts that the map size passed in
isn't -1 (presumably because the offset can be nonzero). Switch to
getOpenFile, which results in an identical call to the implementation
function without the assert.

Bug: http://b/37002637
Test: export FORCE_BUILD_LLVM_COMPONENTS=true
      export FORCE_BUILD_LLVM_DEBUG=true
      export FORCE_BUILD_LLVM_DISABLE_NDEBUG=true
      mma -j && versioner

Change-Id: Ib610db9e07429aa3f64128eaef6ef555c4d1868e
2017-04-06 13:37:56 -07:00
Josh Gao
acc7921580 versioner: remove useless log message.
Test: tools/versioner/run_tests.py
Change-Id: I70edafb7ad6a6274e7daa508903520dbb4b399c8
2017-04-03 12:41:35 -07:00
Josh Gao
d744a9bcd5 versioner: fix indentation in usage.
Test: versioner -h
Change-Id: I96cba65e53c564c8f47714c74d300e8f3dee7e82
2017-04-03 12:41:35 -07:00
Josh Gao
3fcf747f1d versioner: guard preprocessing messages with -v.
Bug: http://b/36751878
Test: tools/versioner/run_tests.py
Change-Id: I5142a33519b101548ccaec8a3bc498e446a648a7
2017-04-03 12:41:35 -07:00
Dan Albert
69cb22f4d7 Build the versioner even on unbundled branches.
This is needed to generate the NDK, so unbundled projects using the
NDK need to build this. If they don't need the NDK, they should just
remove bionic from their manifest.

Test: make checkbuild
Bug: None
Change-Id: I7db816c4a341cf34d4d11739dc64182af630ad63
2017-03-27 13:28:27 -07:00
Dan Albert
22805ea9b8 Revert "Revert "Run the versioner as part of the build.""
This reverts commit 69c7562f59.

Test: make checkbuild
Change-Id: Ie443029398c01b45e0a0317a8074808b064f35d4
2017-03-27 13:06:45 -07:00
Josh Gao
b8a3ae4bcb versioner: fix darwin build.
Use struct stat::st_mtime instead of the underlying st_mtim, which is
called something different on Darwin.

Test: mma on linux, darwin
Change-Id: I2695a6c83ebb7d08ec56b1355e0f4bc0993a0acb
2017-02-23 13:52:49 -08:00
Josh Gao
0a284f5c05 versioner: start using C++17.
Bug: None
Test: python run_tests.py
Change-Id: I10101d26b7816a83445f25b33b97ed47d42fd135
2016-12-15 13:56:00 -08:00
Colin Cross
68d6a9288a Convert versioner to Android.bp
See build/soong/README.md for more information.

Test: mma -j
Change-Id: I0e648143ac480c1257d9829f9b9087ee22005855
2016-12-15 10:44:41 -08:00
Josh Gao
cdbf6fe94f versioner: use unique_ptr to handle ownership of FTS*.
Bug: None
Test: python run_tests.py
Change-Id: I510063e9b57afda4f5492198cd40c15fc6380d2d
2016-11-29 08:28:49 -08:00
Josh Gao
9f9200c2ee Merge "versioner: extract strict warnings out of -v into its own flag." 2016-11-22 00:51:14 +00:00
Josh Gao
2796894c98 Merge "versioner: use a single work queue." 2016-11-22 00:50:59 +00:00
Josh Gao
acc3d80edf versioner: extract strict warnings out of -v into its own flag.
Bug: None
Test: versioner -v; versioner -s
Change-Id: I8f6ac7064c6f05de0811677f7fcfce929a2568c1
2016-11-17 18:12:21 -08:00
Josh Gao
338cf12963 versioner: use a single work queue.
Previously, each thread was assigned a fixed list of work, and the main
thread would block until every thread was finished, leading to most
cores sitting idle for the last few hundred milliseconds while a few
particularly long running threads would keep working. Use a single work
queue to evenly distribute load across the threads.

Bug: http://b/32748936
Test: python run_tests.py
Change-Id: I80e231ece3b95e2721a32f658905841b89a8dc3b
2016-11-17 18:11:57 -08:00
Josh Gao
3091f5a06e versioner: ignore non-header files.
Don't try to compile non-headers (vim swap files, etc.) that happen to
be in the header directory.

Bug: none
Test: manually created a file in libc/include
Change-Id: I2c1647ec7174dc617898dc2f07c9a80a08b69c72
2016-11-16 17:01:57 -08:00
Treehugger Robot
b3321c9614 Merge changes I72d37b7c,I7d254a10,I2e967acf
* changes:
  versioner: use a virtual filesystem for input files.
  versioner: cache -cc1 flags generated by the clang Driver.
  versioner: refactor to use CompilerInstance directly.
2016-11-15 00:54:09 +00:00
Josh Gao
78b8a1430d versioner: use a virtual filesystem for input files.
Use an InMemoryFileSystem to store and share input files across
compilations.

This improves the result of `time versioner` further, from:
    versioner  109.12s user 17.43s system 2433% cpu 5.201 total
to:
    versioner  112.20s user 1.38s system 2416% cpu 4.700 total

Bug: http://b/32748936
Test: python run_tests.py
Change-Id: I72d37b7c30850b8399cc40338247700fe3e7b2f9
2016-11-09 18:12:10 -08:00
Josh Gao
b5c496346f versioner: cache -cc1 flags generated by the clang Driver.
Profiling showed that majority of time spent by versioner was being
spent in the x86 and x86_64 driver statting random files in /usr/lib,
looking for a toolchain. Hardcode a list of per-target flags which
correspond to a subset of the ones generated by clang, and use those
instead of calling out to Driver.

This changes the result of `time versioner` from:
    versioner  156.57s user 1180.08s system 4109% cpu 32.525 total
to:
    versioner  109.12s user 17.43s system 2433% cpu 5.201 total

Bug: http://b/32748936
Test: python run_tests.py
Change-Id: I7d254a105bf1a283cbba0546321b04e308e703d1
2016-11-09 18:10:15 -08:00
Josh Gao
16016df79f versioner: refactor to use CompilerInstance directly.
This will make it easier to switch over to a virtual filesystem,
which should drastically improve performance.

This also fixes an issue with warning/error reporting.

Bug: http://b/32748936
Test: python run_tests.py
Change-Id: I2e967acf75db29c95f3a03f4f94cccd22c367ad5
2016-11-09 13:50:07 -08:00
Treehugger Robot
84e269d5af Merge "versioner: don't always hide future decls." 2016-11-09 02:07:17 +00:00
Josh Gao
9ae2b9a521 versioner: don't always hide future decls.
Bug: http://b/32748732
Test: python run_tests.py
Change-Id: I8f799015ebb1017f5e7d1324fb4c724e12a268bc
2016-11-08 16:28:07 -08:00
Treehugger Robot
147fdb4724 Merge "Clean up update_headers.sh." 2016-11-05 20:09:12 +00:00
Josh Gao
1a176de2f1 versioner: allow static inlines that don't conflict.
Bug: http://b/32664285
Test: python run_test.py
Change-Id: I9d050e545390eccd82661325c0ec58055f5f28a3
2016-11-04 13:16:29 -07:00
Josh Gao
a00e672361 versioner: fix output.
Bug: http://b/32664285
Test: python run_test.py
Change-Id: Ic487036a17cc6778493e316146e54ead8ce3e65b
2016-11-04 13:16:16 -07:00
Dan Albert
b89b7a5022 Clean up update_headers.sh.
Clean up some output, check for errors from the versioner.

Test: tools/update_headers.sh
Bug: None
Change-Id: Ib398b534a9a8ee6dc6a2b4d90747f628aa911bab
2016-11-04 11:41:14 -07:00
Dan Albert
ae50e9d85c Copy the NOTICE file when updating headers.
Test: ./update_headers.sh
Bug: None
Change-Id: Ibde1e6d7ef1750d8369b65b3125b55023efb5b2a
2016-10-31 16:18:29 -07:00
Pirama Arumuga Nainar
079be165a6 Make versioner build with LLVM r275480
Bug: http://b/31320715

Test: tools/versioner/preupload.sh
Change-Id: Icdff19b214b2b26c60288e49d26a88f04df68ef0
2016-10-25 09:35:20 -07:00
Elliott Hughes
dfb74c5f59 Minor copyright header unification.
Regenerating the NOTICE file the other day left me scratching my head at
various "how do they differ?" cases, resolved by this patch.

Test: N/A
Change-Id: I4230bfa1d7ec842a4b9fb8c73dd3b39443d74054
2016-10-24 12:57:55 -07:00
Dan Albert
c30862fdbc One NOTICE file to rule them all.
Generate a single NOTICE file rather than one per library. All the
headers come from libc these days anyway.

Test: tools/update_notice.sh
Bug: None
Change-Id: I127da185fdabc2815042e19aea74c507ec108f46
2016-10-20 11:48:55 -07:00
Dan Albert
32d5592a69 Update our notice files as a pre-upload step.
Also updates the license files, since apparently they're out of date.

Test: repo upload --cbr .
Bug: None
Change-Id: Ic8d855a7ee5185c4933da699292868e02ef79531
2016-10-20 11:27:50 -07:00
Josh Gao
0173379610 Add versioner to preupload hook.
Bug: http://b/31676510
Change-Id: Ic7cfad1cb214c9f711a985bace484a20db1a89b6
Test: submitted this patch, and it failed
2016-09-23 14:34:03 -07:00
Josh Gao
ac3e564142 versioner: turn on -Wundef.
Poking around with -Wundef exposed a pretty horrifying bug, so we
should probably keep it turned on.

Bug: http://b/31496165
Change-Id: Iada279eec91ded0d59ff3841d5a3ce1a36e34c3a
2016-09-15 14:21:28 -07:00
Josh Gao
bb96628f48 versioner: turn on -Wall -Wextra -Werror.
Change-Id: Ica47d0fa671934a1ea193869265de8986b012a58
Test: mma && versioner
2016-09-14 14:22:27 -07:00
Josh Gao
fff29fe17a versioner: add support for __VERSIONER_NO_GUARD.
Add an attribute that tells the preprocessor not to guard a
declaration, primarily for use with symbols that get reexported by
libc++ of the form `namespace std { using ::wctrans; }`.

Bug: http://b/28178111
Change-Id: I08c8751214797e37e8f26e7f7416a19e81c2bb4c
2016-09-07 18:34:39 -07:00
Treehugger Robot
061446c2df Merge "Add a script to update the bionic headers." 2016-08-16 17:08:46 +00:00
Josh Gao
a77b3a9464 versioner: handle _FILE_OFFSET_BITS=64.
Compile headers with both -D_FILE_OFFSET_BITS=32 and -D_FILE_OFFSET_BITS=64.

Bug: http://b/30170081
Change-Id: I92651e075cc69bdc1a2581f99892c9a7fdcdb35b
Test: python run_tests.py
2016-08-15 16:43:13 -07:00
Josh Gao
9ab148c450 versioner: add idempotence test that uses the bionic headers.
Bug: http://b/30170081
Change-Id: Iaf798077518a1a82c626c3b1524633c6df578409
Test: python run_tests.py
2016-08-15 14:28:25 -07:00
Josh Gao
9f7ce3d27f versioner: fix off-by-one error in header guard calculation.
This was causing redundant guards to be emitted in cases where
declarations were already guarded by another macro.

Bug: http://b/30170081
Change-Id: I9080838fbea5a56225df4b26d0918657fb6c4f21
Test: python run_tests.py
2016-08-15 14:09:53 -07:00
Dan Albert
8420be9bcc Add a script to update the bionic headers.
Test: ./update_headers.sh
Bug: http://b/30465923
Change-Id: I888a1ec0c4f26134845583a03bbaad88fa17afa0
2016-08-15 13:55:22 -07:00
Josh Gao
1b4b3d7a3c versioner: improve preprocessor tests.
Make sure everything works with relative/absolute paths, and with and
without trailing slashes.

Bug: http://b/30170081
Change-Id: Ia13a8ae2fa44590e835d0f4b006d4c31e9eaea83
Test: python run_tests.py
2016-08-15 13:42:36 -07:00
Josh Gao
a6b8c4e163 versioner: always copy over source headers when preprocessing.
Also, be less noisy when preprocessing.

Bug: http://b/30170081
Change-Id: If0d81b0a3a49756164e4945a20703afeb302fd4d
Test: python run_tests.py
2016-08-15 13:41:57 -07:00
Josh Gao
b0af100297 versioner: add test output directories to gitignore.
Bug: http://b/30170081
Change-Id: Ie493d8c321bb0e8d308234dec2d42ac8306c21c6
Test: python run_tests.py
2016-08-15 13:41:47 -07:00
Andreas Gampe
64da006063 versioner: Ignore if Clang is missing
This happens in some branches. Work around for now.

Change-Id: I75c01a3ae52ce89f6c56a19728903bf86db0a309
2016-08-12 19:10:21 -07:00
Josh Gao
79786347db versioner: copy unmodified headers when preprocessing.
Change-Id: I2517f560fd44fb519d6ee7e8d0a485036d3ecd87
2016-08-12 16:24:04 -07:00
Josh Gao
f8592a3ff3 versioner: add support for preprocessing headers.
Bug: http://b/30170081
Change-Id: I9b662ca9e0fa3a1f9c0211594e851f5f9bef7266
2016-08-08 16:39:07 -07:00
Josh Gao
8feba83242 versioner: fix makefiles.
Move the Android.mk to src/ so that mm in that directory works.
Also, remove the dependency on FORCE_BUILD_LLVM_COMPONENTS.

Change-Id: Iad7f3fc96f5f26f9535141d752ba865b40d5ff7e
2016-08-08 16:39:07 -07:00
Josh Gao
566735df35 versioner: purge iostreams.
Change-Id: I1b16a4b5c4a8a1333f05636c8c67890d8ce1a090
2016-08-08 16:39:07 -07:00
Josh Gao
16057886d7 versioner: assorted fixes.
Zero initialize the contents of ArchMap, keep track of the symbol name
in Declaration, remove unnecessary copies in loops.

Change-Id: I47b07755846f252b83ffc4c89547a34b2f7ab868
2016-08-08 16:39:07 -07:00
Josh Gao
bfb6bae9fb versioner: replace availability attributes with annotate.
Major refactor to use __attribute__((annotate)) to be able to keep
track of the semantic differences between __INTRODUCED_IN(x) and
__INTRODUCED_IN_X86(x), for use in the upcoming preprocessor.

Bug: http://b/30170081
Change-Id: I6496a8c40ba7f4553de9a2be0bbddcf37c813937
2016-08-08 16:39:07 -07:00
Josh Gao
681f6b59d2 versioner: improve the test script.
Make it actually run under python3, and add checking for unexpected
success.

Change-Id: I9aac0e8cc1526fd63db21e57554f3aa5a9b4091d
2016-08-08 16:39:07 -07:00
Josh Gao
f9128bc7d4 versioner: remove unnecessary kernel/common symlink.
The target was moved by commit 5956b4e, but none of the headers
contained were actually necessary to compile any bionic headers.

Bug: http://b/30170081
Change-Id: I8c1a7464de0992c20af194340c0e36d131a836e7
2016-08-02 14:32:42 -07:00
Josh Gao
180c883f09 versioner: add symlink for kernel/android/uapi.
The android-only kernel headers were moved to their own directory by
commit d6e8b8c. Add a new symlink to match.

Change-Id: I06ce7c3167fbb1e058e4a137fae9375bb5792a46
2016-08-02 14:32:42 -07:00
Colin Cross
0e25b3425b Fix clean mma in bionic
Change-Id: If2410c5ff9c08372098e5ec831e33e4da0e04b30
2016-07-14 16:53:18 -07:00
Colin Cross
d3b6bc7624 Move relocation_packer from Android.mk to Android.bp
Change-Id: I3d24f8513fe3ca19900705d4861ab797464e0930
2016-07-14 09:07:13 -07:00
Josh Gao
d8c77257ea versioner: whitelist atexit, turn on symbol checking by default.
Change-Id: I32e726c74ee618ace3a4329d46408a42732a8d9d
2016-06-03 15:01:19 -07:00
Josh Gao
4af829acb7 versioner: add missing test.
Change-Id: I1dc9a708b53dbb46af9e4b8ab69bf8ed46ab045f
2016-06-03 15:01:19 -07:00
Josh Gao
958f3b31c4 versioner: fix false positive with functions only available as inlines.
Change-Id: I09cc335b4006c6ceafcbd1bec9e50161f8262942
2016-06-03 15:01:19 -07:00
Josh Gao
173e7c0753 versioner: improve error output slightly.
Print [introduced = 9, deprecated = 10, obsoleted = 11] instead of
[9,10,11].

Change-Id: Ifb8a66abbcec92aa13086d220af7ee6fa17b0897
2016-06-03 15:01:19 -07:00
Josh Gao
658dbd920d versioner: merge stdout and stderr in the test runner.
Some of the error messages emitted by versioner (the ones where it was
invoked incorrectly) go to stderr, which meant that the test runner
ignored them. Merge stdout and stderr, and switch from testing for
exact equality to endswith, because of the compilation errors test.

Change-Id: I0e2c25bcc9dea4c12ea82a6a05b29e561a61a902
2016-06-03 15:01:18 -07:00
Josh Gao
80d909bbfb versioner: clean up tests, test runner.
Git doesn't track empty directories, so most of the tests would fail on
a fresh checkout because of dependencies/common being missing. Remove
the use of dependencies from all of the non-dependency related tests.

Change-Id: I09cc5765aae1576914c1c5d7dfa3fb666eab4a3f
2016-06-03 15:01:18 -07:00
Josh Gao
d67dbf003e versioner: ignore functions that are __INTRODUCED_IN_FUTURE.
Bug: http://b/28178111
Change-Id: I8026181e08ed8f2d59b31a37adcf8b469fb6bdaf
2016-06-03 15:01:18 -07:00
Josh Gao
9b5af7ad5e versioner: autodetect paths when no specified.
Search for the header/dependency/platform directories in a hard-coded
path relative to $ANDROID_BUILD_TOP when they're not specified.

Change-Id: I476385cfc0247e3b2009348ec37c1810a0e9a7f7
2016-06-03 15:01:18 -07:00
Josh Gao
62aaf8f8fe versioner: improve usage messages.
Don't spew all of usage when called improperly, and add a -h option
that exits cleanly.

Change-Id: I1a4517edce75afe0f9a80bc8d6c81353d6c12e99
2016-06-03 15:01:18 -07:00
Josh Gao
bf8a285e64 versioner: introduce.
Add a clang-based tool to inspect header availability attributes and
verify them against the NDK platform definitions.

Bug: http://b/28178111
Change-Id: I1bb1925a620e98cc9606cb5a3360b1224c700bd0
2016-06-02 13:40:36 -07:00
rnk
18d0e8c11d Re-land "Fix invalid using decl in bionic relocation_packer"
This time with more namespace qualification.

Tested manually by building clang_x64/android_relocation_packer locally,
as the Android trybot analyze step does not think it needs to run for
this change.

Original description:

> The code was essentially doing 'using Logger::INFO' in the global
> namespace to make its 'LOG(INFO)' macros work. Unfortunately, C++ does
> not allow you to use using decls on classes like this unless you are in
> a derived class. GCC does not accept this code, and Clang was recently
> updated (LLVM r268594) to reject it as well.
>
> This should fix the Chromium Android ASan build with TOT Clang:
> https://build.chromium.org/p/chromium.fyi/builders/ClangToTAndroidASan/

TBR=thakis@chromium.org,sgurun@chromium.org
BUG=609543

Review-Url: https://codereview.chromium.org/1952353005
Cr-Commit-Position: refs/heads/master@{#391952}
(cherry picked from commit 5762af8ad13e62957493c3e4314a234ee57a4200)

Change-Id: Ibc6f6023aef028c5029be128ac799dc67fc6683c
2016-05-06 14:09:58 -07:00
Lazar Trsic
83b44a9e73 Rename DT_MIPS_RLD_MAP2 flag to DT_MIPS_RLD_MAP_REL
Change-Id: I2c0972f5ce3586c3f4f130034f7063f97557ab4e
2016-04-06 17:52:16 +00:00
Elliott Hughes
7de1ff2ad6 Move relocation_packer off libnativehelper.
Also remove other bits of makefile cruft.

Change-Id: I8b69822200959368003a8af9d1595bea9182d6d8
2016-03-22 20:27:39 -07:00
Chih-Hung Hsieh
20322c25e7 Include libz for new libelf.
New external/elfutils needs libz.

Change-Id: Ib2f2d56d4831809509a0fb3a849656f68adece7f
2016-01-25 11:12:14 -08:00
Colin Cross
4032d344d4 Turn common INFO messages down to VLOG(1)
Turn messages that are printed on every run of relocation_packer down to
VLOG(1) to clean up ninja build output.

Bug: 24409581
Change-Id: I040aed6a7b4261eefa6f7278fa451180115b0716
2015-09-28 15:30:37 -07:00
Ying Wang
4900f1c4cd Fix Mac checkbuild.
Bug: 21669400
Change-Id: I54691661605a2e2c1871781964aed343840b8560

(cherry-pick from commit 33c2d441b8)
2015-06-08 12:23:48 -07:00
Simon Baldwin
1011e1a402 Fix unit tests, and extend for other architectures
On unpacking, reinstate any p_align values that packing reduced to
page size.  Ensures a round-trip pack and unpack is bit-equivalent
to the original input.
https://android-review.googlesource.com/#/c/148492/

Extend unit tests to include ia32, x64, and mips32.

Recreate test data for arm32 and arm64.  Generate new test data for
ia32, x64, and mips32.

Bug: http://b/20687795
Bug: http://b/18051137
Change-Id: Ifbca8e206ef447297ba4f19272b813702be27a35
2015-05-27 13:20:00 +01:00
Dan Albert
ded34ce94f Apply same URL workaround to clean build.
Change-Id: I63e63f6ffb879f49e36ee2d09821fc6fc47952c8
2015-05-07 16:33:42 -07:00
Dmitriy Ivanov
4637f3d66d Do not adjust PT_GNU_STACK segment
Bug: http://b/20687795
Bug: http://b/18051137
Change-Id: Ie8af3892cfbebcc0249e7981284c4ad97ff40317
(cherry picked from commit 064a9800f3)
2015-05-04 12:34:42 -07:00