Commit graph

956 commits

Author SHA1 Message Date
Dan Willemsen
3bf1a08505 Add zip2zip tool to copy zip entries from one file to another
This doesn't do any decompression / recompression, but just copies over
the already compressed contents. So it's similar to zip -U, but allows
rewriting of the paths.

The first expected usecase is to replace img_from_target_files during
the build, since it does the equivalent of this:

zip2zip -i <target-files.zip> -o <img.zip> OTA/android-info.txt:android-info.txt IMAGES/*:.

Except it decompresses and recompresses the images, which takes over a
minute instead of a few seconds.

Change-Id: I88d0df188635088783223873f78e193272dbdf1c
2016-08-10 16:57:03 -07:00
Dan Willemsen
25a4e07df8 Add archive/zip from go1.7rc5 tag
In preparation to patch in some custom functionality (parallel
compression and zero-decompress zip to zip copying)

Change-Id: I96a36efc09c715f6b55290af40ebfdde9ae72e33
2016-08-10 16:10:16 -07:00
Colin Cross
adbf48c3df Convert defaults to a top down mutator
am: 1317701114

Change-Id: I3736f583432d56a7dd1889ba948b9253158c9543
2016-08-09 23:23:01 +00:00
Colin Cross
476861290e Update build.ninja.in for blueprint fs.go changes
am: 6debdbad42

Change-Id: I2fd3171f980ff02ff2b7665f80fdbed3535f489e
2016-08-09 22:07:06 +00:00
Colin Cross
1317701114 Convert defaults to a top down mutator
BottomUpMutators are going to lose their ctx.Visit* functions in order
to allow parallelizing them, move defaults to a TopDownMutator using
WalkDeps to only visit defaults modules.

Test: no changes to out/soong/build.ninja
Change-Id: I54ba65a7e2ae9503f4d217f63aa9178a7c5341f0
2016-08-09 13:54:03 -07:00
Colin Cross
6debdbad42 Update build.ninja.in for blueprint fs.go changes
Change-Id: I05bca49a563b13731ccb89d6f073edd59fee7049
2016-08-09 13:40:08 -07:00
Colin Cross
3099506f27 Merge "Use nil pointers for arch property structs"
am: 142d4fd01d

Change-Id: I006c7325e0b16aeeb947788545184fc96e018cf5
2016-08-09 00:19:18 +00:00
Treehugger Robot
142d4fd01d Merge "Use nil pointers for arch property structs" 2016-08-09 00:08:23 +00:00
Dan Albert
0f2f0fa282 More fixes for decorator refactor.
am: cdd4c24ff7

Change-Id: I169c2e8271d5e446f1a8a7fd358672c60c6b93c0
2016-08-08 23:13:01 +00:00
Colin Cross
62496a0d2e Use nil pointers for arch property structs
Blueprint can now handle creating a zero-valued struct when it
encounters a nil pointer to a struct, reducing the amount of allocations
and copying for arch structures that are not used.

Change-Id: If36da5603dbe6469fe6406c821f21a122ea6ea49
2016-08-08 15:56:19 -07:00
Dan Albert
cdd4c24ff7 More fixes for decorator refactor.
Didn't catch these the first time because I hadn't done a clean build.

Test: rm -rf out && make ndk
Change-Id: Ia66ad614d2163272889ee6937a6449c44db16ac0
2016-08-08 14:45:24 -07:00
Dan Albert
80f3a040cd Fix ndk_library following decorator refactor.
am: 705c84b9ee

Change-Id: I228224014450f4cb2cdbf13bdcf3d94e8f95aa23
2016-08-08 20:49:21 +00:00
Dan Albert
705c84b9ee Fix ndk_library following decorator refactor.
https://android-review.googlesource.com/#/c/253603/ accidentally
dropped the ndk_library properties and was using the base cc
properties instead.

Change-Id: Ia2dcd767f98871dbdbbd9d0ff6d2a73b9b4889ac
2016-08-08 12:44:23 -07:00
Dan Albert
df66aa3ecf Don't generate intermediate NDK libraries.
am: 7fa7b2efd3

Change-Id: I049ab976019bf085943cc4cf0bceb68e0c6ef59b
2016-08-08 18:44:14 +00:00
Dan Albert
7fa7b2efd3 Don't generate intermediate NDK libraries.
It's better to clip to the existing versions here rather than build
the lower levels as if they existed.

cc.Module's begin() will now normalize the sdk_version to a valid
value for the given architecture so that doesn't have to be checked
later.

Test: make checkbuild with all other libc ndk_library changes
Change-Id: I2fa834f7a1ac3b03a0723291778d86207fcfda72
2016-08-05 16:48:36 -07:00
Dan Willemsen
f7f5b8c1b3 Merge changes I5144bc62,Id6d6561f
am: 8a274392ac

Change-Id: I62a802f7ad60f9bd3a50ecf7f462642b10516fbd
2016-08-05 20:54:00 +00:00
Dan Willemsen
8a274392ac Merge changes I5144bc62,Id6d6561f
* changes:
  soong_jar: Hardcode time
  soong_jar: Implement symlinks, fix directories
2016-08-05 20:44:25 +00:00
Colin Cross
91790d64c7 Refactor cc modules to use decorators instead of inheritance
am: b916a38233

Change-Id: I3b43134205a739aa6e0baf2aef56507d1e1fa221
2016-08-05 18:45:32 +00:00
Colin Cross
987c4de3cd Remove unused flags.Nocrt
am: 01344df46e

Change-Id: I1c8c1dbf408072a1c6fb644151a3e33182665e52
2016-08-05 18:45:31 +00:00
Dan Willemsen
77a6b8655a soong_jar: Hardcode time
We want reproducible builds, so timestamps are not useful.

Change-Id: I5144bc62ac37c3c9d7e0638f3b3648a60d887702
2016-08-05 11:22:40 -07:00
Dan Willemsen
a59a3bc5ec soong_jar: Implement symlinks, fix directories
Ensure that we only create one directory entry, not one with a / at the
end and another without. Clean incoming paths to prevent other similar
duplicates.

When adding directories specified directly as inputs, use the relative
path just like files, not the full path.

Instead of traversing symlinks, addg them to the zip file directly.

Present an error instead of crashing when an input does not exist.

Change-Id: Id6d6561fe12c28398f6096bf9bcae602bb7aa491
2016-08-05 11:22:40 -07:00
Colin Cross
b916a38233 Refactor cc modules to use decorators instead of inheritance
For example , instead of trying to have libraryLinker inherit from
baseLinker and libraryCompiler inherit from baseCompiler, create a
single decorator object that wraps both baseLinker and baseCompiler.

Test: Builds, no unexpected changes to build.ninja
Change-Id: I2468adaea8466c203a240259ba5694b8b1df7a52
2016-08-05 10:25:09 -07:00
Colin Cross
01344df46e Remove unused flags.Nocrt
Nocrt is handled through deps.CrtBegin/End, flags.Nocrt is unused

Change-Id: I8ab5313bb2eb3a00e336504d6dd3813350fbe14d
Test: soong builds
2016-08-05 10:22:29 -07:00
Dan Albert
cbfe300d8a Auto-fill ndkMigratedLibs.
am: 7e9d295807

Change-Id: I2d20a3e4b7b87b86902fccd06e263f32d39a1494
2016-08-05 00:32:59 +00:00
Dan Albert
ae9175cefd Merge "Check NDK API level link compatibility."
am: 5c395b39b4

Change-Id: I1ffa2f563e0693fbf95be28d777dfe7ea4f7d981
2016-08-04 23:21:54 +00:00
Dan Albert
7e9d295807 Auto-fill ndkMigratedLibs.
Change-Id: Ifb91f62eccb17dedb71c1a9a0f5c1471edbcbd44
2016-08-04 16:10:54 -07:00
Treehugger Robot
5c395b39b4 Merge "Check NDK API level link compatibility." 2016-08-04 23:07:16 +00:00
Colin Cross
0a8fe7cf0d Merge "Don't cache InstallInData"
am: a7d1d4b0aa

Change-Id: I37aaf58a0e3d4b4b0ceee66d561576aea5163154
2016-08-04 21:43:18 +00:00
Colin Cross
a7d1d4b0aa Merge "Don't cache InstallInData" 2016-08-04 21:02:56 +00:00
Dan Albert
a1b846602f Use the version script for ndk_library.
am: 2bc91ba549

Change-Id: I5b07296ad3f458f901ee99297eefc6d5b536896c
2016-08-04 18:23:34 +00:00
Dan Albert
9e10cd4746 Check NDK API level link compatibility.
Mixing NDK API levels is only supported when linking against something
equal or older.

Change-Id: I2c3022a3d75465b736f2e65160da3113cfd6e635
2016-08-03 14:31:25 -07:00
Colin Cross
8d8f8e21cc Don't cache InstallInData
Change-Id: If38670cc68989a7ec11ba5f8c71b1fac6c69f3a6
2016-08-03 11:57:50 -07:00
Dan Albert
2bc91ba549 Use the version script for ndk_library.
We were generating this, but not actually using it yet.

Test: `make ndk` with libc/libm migration patches, readelf generated
      libs.
Change-Id: I9aadf58307bc645b33cab5207409552c5046937a
2016-08-02 13:45:40 -07:00
Dan Albert
4216e1e6f0 Merge changes I0f73b41a,I0cd2f80c
am: f77e8d7ffc

Change-Id: I4ddecc0a430e413016e65898470c7661829ca895
2016-08-02 01:33:33 +00:00
Treehugger Robot
f77e8d7ffc Merge changes I0f73b41a,I0cd2f80c
* changes:
  Add a real parser for the version scripts.
  Add tag for "versioned=API".
2016-08-02 01:26:41 +00:00
Colin Cross
5cf03973aa Merge "Rename compiler, linker and installer methods to be unique"
am: cab3d65445

Change-Id: Ide8b387dca1ba29eae3744cb39a9d6d1952ee9ba
2016-08-02 00:37:00 +00:00
Treehugger Robot
cab3d65445 Merge "Rename compiler, linker and installer methods to be unique" 2016-08-02 00:28:36 +00:00
Colin Cross
5d90e94a62 Merge "Fix mac soong build"
am: 35ef8bdf32

Change-Id: I1e9e3b5103fc627d5043316e8acc32e7d3cde1e5
2016-08-02 00:12:59 +00:00
Treehugger Robot
35ef8bdf32 Merge "Fix mac soong build" 2016-08-02 00:02:06 +00:00
Dan Albert
8bdccb9429 Add a real parser for the version scripts.
Bionic's version scripts are unfortunately complicated enough that the
naive processing I was doing before is not going to be sufficient.
Add a real parser/generator with a bunch of tests to fix this.

Test: cc/test_gen_stub_libs.py && make ndk
Change-Id: I0f73b41ade1e6cf4e31bf70ba43a743429ce770b
2016-08-01 16:12:40 -07:00
Dan Albert
c42458e2ff Add tag for "versioned=API".
This adds the `versioned=API` tag. This should be a very uncommonly
needed tag, and is really only needed to fix versioning mistakes that
are already out in the wild.

For example, some of libc's __aeabi_* functions were originally placed
in the private version, but that was incorrect. They are now in
LIBC_N, but when building against any version prior to N we need the
symbol to be unversioned (otherwise it won't resolve on M where it is
private).

Test: make ndk
Change-Id: I0cd2f80cf4b32356356914cf7ff4119e67f15032
2016-08-01 16:12:32 -07:00
Dan Albert
9ac9847f0b Merge changes I21f54c67,I41f6e493,I6f2ae636
am: 3a5af487f2

Change-Id: I94ecadea6ce396788f3b86f16783943410458834
2016-08-01 23:10:53 +00:00
Treehugger Robot
3a5af487f2 Merge changes I21f54c67,I41f6e493,I6f2ae636
* changes:
  Allow more symbol file tags at top level.
  Add a new tag to NDK symbol files: future.
  Don't warn for TODOish comments.
2016-08-01 23:06:55 +00:00
Dan Albert
08532b6779 Allow more symbol file tags at top level.
A version block might need to be omitted for reasons beyond just
"future". Support all the same tags we do at symbol scope.

Test: `make ndk` with libc/libm migration patches.
Change-Id: I21f54c67079dae10fee1e5e08bcd01f8810e7a67
2016-08-01 16:04:37 -07:00
Colin Cross
a24166b5c7 Fix mac soong build
Change-Id: I50b3ca1af571d00a0cc5efc80c5d1c6f0b1f789b
2016-08-01 15:42:38 -07:00
Colin Cross
f820949bb8 Move toolchain and global variables into separate package
am: b98c8b0595

Change-Id: Ia93d006fca1a219276c9f387c564778c9c961894
2016-08-01 22:21:22 +00:00
Dan Albert
a85042a040 Add a new tag to NDK symbol files: future.
Symbols that have been added to a library but should not be exposed
in any of the current NDK API levels should be tagged with "future".
These will be suppressed from the NDK libraries.

Once all this is in better shape we'll have `sdk: "current"`. Symbols
tagged with "future" will be available for that.

Note that this tag can be applied directly to a version. Aside from
being more ergonomic than tagging an entire section, this also solved
the problem of gen_stub_libs.py emitting an empty global section
(which is not valid syntax) in the case where every symbol is
"future". Tag the version instead and it will be omitted.

Test: `make ndk` with libc/libm migration patches.
Change-Id: I41f6e4939c406f695ab5725f360ec6554ad8ab31
2016-08-01 14:36:22 -07:00
Dan Albert
db26530b73 Don't warn for TODOish comments.
These just make it harder to detect when the file is clean of
interesting errors.

Change-Id: I6f2ae6368cdbd2800ce3f0461a3d456f79e6e994
2016-08-01 14:36:22 -07:00
Colin Cross
42742b8bb0 Rename compiler, linker and installer methods to be unique
compiler, linker, and installer interfaces may be implemented by a
single decorator object, rename their methods to be unique to avoid the
same method being called multiple times.

Test: out/soong/build.ninja unchanged
Change-Id: I1608c41cd68f614ba99c11bb9fcc7936f618d9aa
2016-08-01 13:47:15 -07:00
Colin Cross
b98c8b0595 Move toolchain and global variables into separate package
Move all of the configuration into a cc/config package

Change-Id: If56fc7242062ed1ce3cb297f78a1e0ef7537373c
2016-08-01 13:37:01 -07:00