Append .Parallel() to all of the RegisterBottomUpMutator calls to tell
Blueprint it can run them in parallel.
Test: identical build.ninja, passes race detector
Change-Id: I969a0689522d4cba7c8ff51e2aa00fe2fd338a89
* changes:
Rename soong_jar to soong_zip
soong_jar: Parallel compression
Add zip2zip tool to copy zip entries from one file to another
Add archive/zip from go1.7rc5 tag
This compresses multiple files in parallel, and will split up larger
files (5MB+) into smaller chunks (1MB) to compress in parallel.
There is a small size overhead to recombine the chunks, but it's only a
few bytes per chunk, so for a 1MB chunk, it's minimal.
Rough numbers, with everything in the page cache, this can compress
~4GB (1000 files) down to 1GB in 6.5 seconds, instead of 120 seconds with
the non-parallel soong_jar and 150 seconds with zip.
Go's DEFLATE algorithm is still a bit worse than zip's -- about 3.5%
larger file sizes, but for most of our "dist" targets that is fine.
Change-Id: Ie4886c7d0f954ace46e599156e35fea7e74d6dd7
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
In preparation to patch in some custom functionality (parallel
compression and zero-decompress zip to zip copying)
Change-Id: I96a36efc09c715f6b55290af40ebfdde9ae72e33
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
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
Didn't catch these the first time because I hadn't done a clean build.
Test: rm -rf out && make ndk
Change-Id: Ia66ad614d2163272889ee6937a6449c44db16ac0
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
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
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
We were generating this, but not actually using it yet.
Test: `make ndk` with libc/libm migration patches, readelf generated
libs.
Change-Id: I9aadf58307bc645b33cab5207409552c5046937a
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
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
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
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
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
Split cc.go into files per module type, plus files for the compiler,
linker, and installer stages.
Change-Id: Id44c03f42fcd180950ccd008d4de0c144ea3597b
The list of migrated libraries is currently empty. Libraries will be
migrated as follow up patches.
Test: Migrated libc to this system and everything still builds.
build.ninja shows libraries being built and used and headers are
collected for the sysroot.
Bug: http://b/27533932
Change-Id: Iaba00543c1390f432befe0eed768ed3fbb8a9b96
The Customizer interface now provides a Flags method that takes a
CustomizerFlagsContext and can call AppendCflags to insert extra cflags
on a module.
Change-Id: I821242e7574e8ff653580325d1bef2998a50e29c