Commit graph

5892 commits

Author SHA1 Message Date
Pirama Arumuga Nainar
6ae7efd478 Merge "Switch to clang-4630689"
am: f975865a12

Change-Id: I9733c5b3d29a7e7e46bca7c68b320dab4ed2a3b8
2018-03-05 18:13:07 +00:00
Pirama Arumuga Nainar
f975865a12 Merge "Switch to clang-4630689" 2018-03-05 17:57:38 +00:00
Colin Cross
dfcdeec8b2 Merge changes I6f7d40b7,I25654032
am: 83a495830b

Change-Id: Ie7c908f45fcd7e9d8858e77035700d67cee009fe
2018-03-03 03:38:04 +00:00
Treehugger Robot
83a495830b Merge changes I6f7d40b7,I25654032
* changes:
  add a library to report build numbers without causing rebuilds
  Rewrite symbol_inject to be testable
2018-03-03 03:16:48 +00:00
Jayant Chowdhary
1ce7bf12b7 Disable abi diffs for sanitized variants of modules.
am: ea0a2e1928

Change-Id: I790236678fea78c379ab1d7c32e8a5ae2cd0446b
2018-03-03 02:48:21 +00:00
Colin Cross
86803cfe6e add a library to report build numbers without causing rebuilds
Allow native modules to specify use_version_lib, which will make
an android::build::GetBuildNumber() function available.  For host
builds, the function will return the build number at the time that
the module was linked.  For device modules it will return the
value of the ro.build.version.incremental property.

Bug: 71719137
Test: build_version_test
Test: m build_version_test && touch build/make/core/Makefile build/soong/cc/libbuildversion/tests/build_version_test.cpp && m build_version_test shows different build numbers for binary and library tests.
Change-Id: I6f7d40b7574bb8206866c4e39bad9c710c796e32
2018-03-02 16:55:51 -08:00
Colin Cross
8673b5b959 Rewrite symbol_inject to be testable
Parse the machine-specific symbol tables into a custom symbol table
object and use a single function to find the offset and size of the
symbol in the custom table.  Make the functions to convert a
machine-specific symbol table into the custom table also take mocks,
and provide functions to dump mocks from real files.  Add tests
that take the mocks and verify they produce the right offset and
size.

Test: cmd/symbol_inject/*_test.go
Change-Id: I25654032b5017dd13a9a1fe29f8b8826ce5bc82b
2018-03-02 16:47:13 -08:00
Jayant Chowdhary
ea0a2e1928 Disable abi diffs for sanitized variants of modules.
asan variants can sometimes have extra exported symbols (this is a vndk
extension violation). Since asan variants are only used for testing,
don't do abi diffs for them.

Bug: 66301104

Test: Without the change, libc++.so.lsdump exists for the asan variant;
      with the change, it does not.

Test: make -j64.

Change-Id: I61a4c7a3e9aa0028a54ad0ca8715e8c77aebad94
2018-03-02 22:13:15 +00:00
Pirama Arumuga Nainar
4a825ee14a Switch to clang-4630689
Bug: http://b/73127367
Bug: http://b/68659946

These new prebuilts have fixes for the bugs mentioned above.

Test: Build and verify that issues in both bugs above are fixed.
Change-Id: I410a43b70920d509118f8e6fdb012ef6b078d657
2018-03-02 13:38:42 -08:00
Jayant Chowdhary
eccf4774b1 Create a make variable for all lsdump files.
am: dcd33b6c29

Change-Id: Id08bc4331950a9198705f7fcbcb171e731e89965
2018-03-02 01:50:09 +00:00
Jayant Chowdhary
1bb2bac825 For abi diffing, factor in arch variant and primary arch.
am: ac066c6b90

Change-Id: Ifb7df61cee156e4578bf8af90b7d9263335c4448
2018-03-02 01:50:05 +00:00
Jayant Chowdhary
dcd33b6c29 Create a make variable for all lsdump files.
This is needed so that we can embed the paths of lsdump files in a file,
in order to make lookup faster, while creating reference dumps.

Test: mm -j64 in external/libjpeg-turbo for aosp_arm64_ab;
      out/soong/make_vars-aosp_arm64_ab.mk contains
      SOONG_LSDUMP_PATHS := <list of lsdump paths>

Change-Id: I04608429e1add307cc1ee79d2f0c348fb041613c
2018-03-01 17:19:25 -08:00
Jayant Chowdhary
ac066c6b90 For abi diffing, factor in arch variant and primary arch.
binder_size_t has a different size for builds with different primary
arches.

Also maintain seperate reference dumps for different arch variants,
since different cflags may be legally specified for them (similar to
what GSI does)

Test: create reference dump for libjpeg at
      prebuilts/abi-dumps/vndk/current/arm64/arm64_armv8-a/source-based/libjpeg.so.lsdump.gz
      mm -j64; header-abi-diff gets invoked.

Change-Id: I55eae4d4811c9754fe8dbd1009c7929fea119eeb
2018-03-01 17:19:25 -08:00
Dan Willemsen
f49ff89266 Turn GlobFiles into a Glob for files, use it
am: 540a78c1ce

Change-Id: Ia5811eb2fe2db20d4ab8e554341b875392cc345a
2018-03-02 00:18:04 +00:00
Dan Willemsen
540a78c1ce Turn GlobFiles into a Glob for files, use it
GlobFiles had allowed results to be anywhere in the source tree,
restrict it to results within the current module directory.

Then use it for ExpandSources and other places where we only want files.
This fixes using '*' in cc_test's `data` property, which can only
support files.

The only thing this changes today is that java_resource_dirs and
java_resources no longer pass directories to soong_zip's -f argument.
core-libart previously added some icu directories, now it only passes
files.

Bug: 71906438
Test: only expected changes in out/soong/build.ninja
Test: add data: ["**/*"] to a cc_test, build successfully
Change-Id: Iff1bd8c005a48e431c740706d7e23f4f957d8b1d
2018-03-01 14:05:20 -08:00
Dan Willemsen
1ba2989d4f Merge "Add droiddoc_template"
am: f6366cc0a1

Change-Id: I0b977eea1f67813615ca3eadb02bb4456f0abf3e
2018-03-01 18:04:47 +00:00
Dan Willemsen
f6366cc0a1 Merge "Add droiddoc_template" 2018-03-01 17:53:25 +00:00
Jeff Gaston
3181870d1f Merge "Remove unused property"
am: 491ace3c0a

Change-Id: Iea675b40d041034f2fd9f90642cf43b21bc0f2e1
2018-03-01 16:27:40 +00:00
Jeff Gaston
491ace3c0a Merge "Remove unused property" 2018-03-01 16:14:03 +00:00
Colin Cross
fd316aa69c Merge "Fix finding next symbol when multiple symbols have the same address"
am: 8d43b7cf81

Change-Id: I188c96f3bd6fab327e961b06817813ee4e02bd4f
2018-03-01 05:43:13 +00:00
Treehugger Robot
8d43b7cf81 Merge "Fix finding next symbol when multiple symbols have the same address" 2018-03-01 05:15:42 +00:00
Nan Zhang
b1e6641a77 Change name of droiddoc target output to *-stubs.srcjar
am: 3bb14200e2

Change-Id: I68ffb9ca9c86da503f8ba4911d405438a6e895f8
2018-03-01 02:20:27 +00:00
Dan Willemsen
cc09097359 Add droiddoc_template
We prefer not to use absolute paths in modules, but to reference modules
that have associated paths. This a few benefits:

* it's easier to move a module than to update all the references
* if the module doesn't exist, we treat it as a normal missing
dependency, not having to deal with the missing dependency in path.go
* implementing visibility(etc) in the future would be simpler if there
was a module attached to the reference, so we don't have to do various
path-based lookups to try and match things up.

So define a `droiddoc_template` module, which takes a path, and will run
the glob once in that module. All of the `droiddoc` modules can then
specify it through the `custom_template` property, which will pull the
necessary data.

Also fix that htmldirs should be references from the local path, the
htmldir2 argument never being specified, and complain if more than two
htmldirs are specified, or if the custom template isn't specified.

Test: m core-docs
Test: out/soong/build.ninja is nearly identical
      - line numbers in comments
      - adds directories to droiddoc template dependency lists, which
        is more correct, since we need to rerun on added or removed
	files too.
Change-Id: Iff630bddb3818b8eeed439de7e41fc7fbe7cdcb0
2018-03-01 02:10:51 +00:00
Nan Zhang
3bb14200e2 Change name of droiddoc target output to *-stubs.srcjar
Test: m -j core-docs
Bug: b/70351683
Change-Id: If8c00a9992d262b7cd4c95794073591dcc245bd2
2018-02-28 16:15:05 -08:00
Colin Cross
dfce764476 Fix finding next symbol when multiple symbols have the same address
Some exe files have a .data symbol at the same address as the
soong_build_number symbol.  If the .data symbol is after
soong_build_number in the symbol list, symbol_inject would think
the end address was the same as the start address, and use
uint32(-1) as the size.

Use sort.Search to find the first symbol whose section number is
the same as the target symbol, but whose address is higher than
the target symbol.

Test: manual
Change-Id: I51d6e53c6b906222ba68c5cf93be944843e23550
2018-02-28 15:04:59 -08:00
Jeff Gaston
f7542544d2 Remove unused property
Bug: 72552085
Test: androidmk prebuilts/sdk/current/support/Android.mk \
      | grep LOCAL_UNINSTALLABLE_MODULE && echo failed

Change-Id: Idcdd571812594599267985dfef2cc2fc6efbb5ba
2018-02-28 15:00:15 -05:00
Colin Cross
8c5d337c80 Merge changes I41d1c3c3,I9de0a0f5
am: 0c74ad9381

Change-Id: I6f496938039222eedfe42724fa34ba497e98fa15
2018-02-27 23:06:41 +00:00
Treehugger Robot
0c74ad9381 Merge changes I41d1c3c3,I9de0a0f5
* changes:
  Sort macho symbol table entries
  Fix symbol_inject on win32 exes
2018-02-27 22:55:21 +00:00
Colin Cross
aa14355b6a Report errors when opening config files
am: 15cd21a492

Change-Id: I3625ab981fae0c9d647c5a1c37d67e7807c68264
2018-02-27 22:21:00 +00:00
Colin Cross
15cd21a492 Report errors when opening config files
The error handling when opening config files was ignoring all errors
except ENOEXIST.  Report other errors, instead of passing nil to
json.NewDecoder and getting:
config file: out/soong/soong.config did not parse correctly: invalid argument

Bug: 73951413
Test: touch out/soong/soong.config && chmod a-r out/soong/soong.config && m
Test: rm out/soong/soong.config && m
Change-Id: I4a609b7f060b760b76ee829b83c0eb405340f58f
2018-02-27 19:30:40 +00:00
Colin Cross
c4a18e0291 Sort macho symbol table entries
macho symbol table entries are not always in order, which breaks
finding the next symbol to find the size of the target symbol.

Test: build_version_test
Change-Id: I41d1c3c3ff9929694e9ec2b034553d6b7ddef937
2018-02-23 22:45:55 -08:00
Colin Cross
64c6d4bf14 Fix symbol_inject on win32 exes
Win32 exes seem to prefix each symbol with an underscore like
macho.

Test: build_version_test
Change-Id: I9de0a0f5f25f93ad17d34b7c1b993511c77a57eb
2018-02-23 18:24:48 -08:00
Colin Cross
113265ec4c Merge changes I84868c92,If1690a70,Ia9aeb2ff
am: d2092dbc0d

Change-Id: Ib6f5ac0c1a6c6d30f692ccbef52d78318820f540
2018-02-24 00:56:32 +00:00
Colin Cross
d2092dbc0d Merge changes I84868c92,If1690a70,Ia9aeb2ff
* changes:
  Use PathForSource instead of PathsForSource
  Move AllowMissingDependencies check from PathsForSource to PathForSource
  Pass nil instead of []string{} to ctx.Glob* functions
2018-02-24 00:39:56 +00:00
Dan Willemsen
c530837d4c Merge "Add proto.canonical_path_from_root"
am: 7c695eb797

Change-Id: I072c8db0a9b8d4f351adc21d5eaf59b1e02f3f28
2018-02-23 20:49:18 +00:00
Dan Willemsen
7c695eb797 Merge "Add proto.canonical_path_from_root" 2018-02-23 20:38:10 +00:00
Colin Cross
480cd76672 Use PathForSource instead of PathsForSource
This reapplies If1690a708393964d3030cb908beaf7b6897c0084.

PathForSource does the AllowMissingDependencies check now, use it
instead of PathsForSource.

Test: m checkbuild
Change-Id: I84868c92ee43779f9b5c8b285dac92f5f87b018c
2018-02-23 11:31:45 -08:00
Colin Cross
192e97a95c Move AllowMissingDependencies check from PathsForSource to PathForSource
This reapplies Id7925999a27ea75a05e9301bbf1eb9f9a6bc4652 with
additional fixes to not use PathForSource in PathForModuleSrc.

PathsForSource was handling the AllowMissingDependencies case, but
PathForSource was not.  Refactor PathForSource and
ExistentPathForSource, and add logic to PathForSource to fall back
to behavior similar to ExistentPathForSource when
AllowMissingDependencies is set.

PathForModuleSrc uses PathForSource, which causes too many
globs (>50k).  The AllowMissingDependencies check doesn't make
much sense for PathForModuleSrc, since we already know the
project containing the definition of the module exists, we can
expect its local source files to exist.  Use pathForSource and
do an manual existence check instead.

Test: paths_test.go
Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: If1690a708393964d3030cb908beaf7b6897c0084
2018-02-23 11:31:45 -08:00
Colin Cross
461b445d62 Pass nil instead of []string{} to ctx.Glob* functions
[]string{} is unnecessary, just use nil.

Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: Ia9aeb2ffc483429787da0e473a7f1bc87eb4cad1
2018-02-23 11:31:45 -08:00
Colin Cross
be6724dd30 Merge "Revert "Use PathForSource instead of PathsForSource""
am: 0c18d451d2

Change-Id: Iaad079afd21e00dd92bb7cefc177bfed198c125e
2018-02-23 07:39:52 +00:00
Colin Cross
0c18d451d2 Merge "Revert "Use PathForSource instead of PathsForSource"" 2018-02-23 07:32:19 +00:00
Colin Cross
6fe8d17dd2 Revert "Move AllowMissingDependencies check from PathsForSource to PathForSource"
am: c48c14369c

Change-Id: Ib0a5754a9958a8876573a744f28bb93276831e91
2018-02-23 07:18:44 +00:00
Colin Cross
c48c14369c Revert "Move AllowMissingDependencies check from PathsForSource to PathForSource"
This reverts commit 94a321045a.

Reason for revert: Broke builds with ALLOW_MISSING_DEPENDENCIES=true

Change-Id: I9604887f796a79809ef8d6c741597796219dcaf3
2018-02-23 07:09:15 +00:00
Colin Cross
5a49e1c65e Revert "Use PathForSource instead of PathsForSource"
This reverts commit 9d37831dd3.

Reason for revert: Broke builds with ALLOW_MISSING_DEPENDENCIES=true

Change-Id: Ibff79642f747b83364c83d6b298334121028e02d
2018-02-23 07:08:43 +00:00
Colin Cross
b3407069ee Merge changes If1894fd9,Id7925999,I4fe11c3f,Iea2b0781,Id2c0a503
am: 1b5599e462

Change-Id: If6ed7347189045341276d527b1fd555400203899
2018-02-23 02:34:06 +00:00
Treehugger Robot
1b5599e462 Merge changes If1894fd9,Id7925999,I4fe11c3f,Iea2b0781,Id2c0a503
* changes:
  Use PathForSource instead of PathsForSource
  Move AllowMissingDependencies check from PathsForSource to PathForSource
  Propagate errors out of validatePath
  Add t.Run and t.Helper to paths_test.go
  Remove unused intermediates parameter from ExistentPathForSource
2018-02-23 02:28:35 +00:00
Dan Willemsen
ab9f4268c0 Add proto.canonical_path_from_root
Historically, we've always passed '-I .' as the first argument to
protoc, essentially treating all proto file package names as their full
path in the android source tree. This would make sense in a monorepo
world, but it makes less sense when we're pulling in external projects
with established package names.

So keep the same default (for now), but allow individual builds to opt
into using local paths as the default names with
'canonical_path_from_root: false'. A cleanup effort and/or large scale
change in the future could change the default to false.

As part of this, run protoc once per input proto file, since the flags
may need to change per-file. We'll also need this in order to specify
--dependency_out in the future.

Bug: 70704330
Test: aosp/master build-aosp_arm.ninja is identical
Test: aosp/master soong/build.ninja has expected changes
Test: m
Test: Build protobuf test
Change-Id: I9d6de9fd630326bbcced1c62a4a7e9546429b0ce
2018-02-22 16:48:35 -08:00
Colin Cross
b4b91fa725 Fix java_import and android_library_import conversions
am: 336ad7a667

Change-Id: Ib4963012cee1f839ef141e61676d60365cb674c1
2018-02-22 23:28:41 +00:00
Colin Cross
0ae9d91508 Don't pretend *parser.List is immutable
am: 3fad895e75

Change-Id: I342ed780933174e1126980c9f658891c0c73dd80
2018-02-22 23:28:36 +00:00
Colin Cross
cb7137994f Soong AAR prebuilt support
am: fabb608b27

Change-Id: I38ce0673ecbd0b81e29f433480dcbd2e295b9eea
2018-02-22 23:28:29 +00:00