Commit graph

2394 commits

Author SHA1 Message Date
Nan Zhang
db0b9a3cf3 Supported python build in host side.
The base module handles all the common functionalites, such as version
compatibilty check, version variations split, source file format check,
source/data file duplicate check.

The library/binary module focuses on how to generate binary build actions,
such as setting up stub script, zipping, filling in __init__.py in
runfiles dir tree.

Bug: b/31676493
Test: go test under python package

Change-Id: I06608369f350f7195873d459e1c8d1bdb811e77e
2017-05-05 13:27:56 -07:00
Colin Cross
7c34c4c8eb Merge "Check reused source files in hasSrcExt" 2017-05-03 21:24:09 +00:00
Colin Cross
10d2231d44 Check reused source files in hasSrcExt
hasSrcExt is used to determine extra flags and dependencies when
generated files are used.  If the generated files are being handled
in a static library whose objects are reused in a shared library,
the flags and dependencies still need to apply.  Instead of clearing
the source files in the shared library, move them to an OriginalSrcs
property, and check that in hasSrcExt along with the Srcs property.

Also pass extra exported include directories from the static
library to the shared library.

Bug: 37555583
Test: use protos in a cc_library
Change-Id: I709779ec03b66b220b7bd58a1f6f0b9b5067d955
2017-05-03 12:28:27 -07:00
Treehugger Robot
12d713e434 Merge "Supported minor features in soong_zip" 2017-05-03 08:23:56 +00:00
Nan Zhang
f281bd8c7b Supported minor features in soong_zip
1. Added ability to keep the mixed "-f"/"-l" order as same as
command-line flags order.

2. Added "-s" flag to specify which target file within zip is stored uncompressed.

Test: manual
Change-Id: I338b25a7bd6bf1b7e9cc29ad3324575167630fb7
2017-05-02 17:28:35 -07:00
Colin Cross
5ff51b5caa Update protoc support for libplatformprotos
Allow properties to be overriden by arch variants.
Add include_dirs and local_include_dirs properties.
Pass -I . to fix:
   frameworks/base/proto/src/metrics_constants.proto: File does not
   reside within any path specified using --proto_path (or -I).  You
   must specify a --proto_path which encompasses this file.  Note that
   the proto_path must be an exact prefix of the .proto file names --
   protoc is too dumb to figure out when two paths (e.g. absolute and
   relative) are equivalent (it's harder than you think).

Test: m -j libplatformprotos
Change-Id: I3e02621ca25bfa7ca0a0e3b83377d70dd352668f
2017-05-02 14:08:29 -07:00
Colin Cross
0e409a2810 Add device_uses_hwc2 product variable
TARGET_USES_HWC2 is going away, but propagate it to soong for now
to unblock converting dependency chains that end in libhwui.

Test: soong tests
Change-Id: I20f1269caea1b5f5fc39239daa6b2e610bd36eb9
2017-05-02 11:17:45 -07:00
Colin Cross
f34d9d11d4 Merge "Add msa mips features" 2017-05-02 17:49:21 +00:00
Colin Cross
432c2860a0 Add msa mips features
References to an MSA architecture feature were added in
I3cadc29434dbd5fdb3aa780198414e90f9572ec5, but never added
to the build system.

Test: builds
Change-Id: I178813824a21475e013f7e8209d9473466ab821c
2017-05-01 16:43:41 -07:00
Treehugger Robot
f5464ba31a Merge changes Ic32cfb3e,I282be134
* changes:
  Add support for named versions in NDK map files.
  Generate stub libraries for unreleased API levels.
2017-04-30 21:31:24 +00:00
Dan Albert
3f6fb2db5f Add support for named versions in NDK map files.
Test: nose2
Test: make checkbuild
Bug: None
Change-Id: Ic32cfb3e0db767f695b617c787733a6ef75030aa
2017-04-28 16:11:13 -07:00
Dan Albert
49927d29d5 Generate stub libraries for unreleased API levels.
Generating released API levels and android-current is not sufficient
in a trunk-stable world. One branch will have the stable APIs and
possibly multiple unreleased API levels. We need to generate stubs
for each unreleased API level up to our current target.

I still need to add support for things like `# introduced=O` before
this is really done.

Whether or not we still need something like "current" that would map
to the absolute latest even it hasn't been assigned a code name yet
is uncertain.

Test: make ndk
Bug: None
Change-Id: I282be1347ab39c56fa887d4d71c03bb12c300dc5
2017-04-28 16:11:13 -07:00
Colin Cross
22eab50d45 Merge changes from topic 'reverse-arch-includes'
* changes:
  Enable mips32r2dsp[r2]-fp in mega device build
  Turn installation on in mega device build
  Prepend arch variant include directories
  Make generated_sources act like generated_headers
  Pass -I to yasm
  Add arm neon and mips dspr2 arch features
2017-04-27 23:30:43 +00:00
Dan Willemsen
f173d595c2 Support ASAN for ckati and ninja
I missed this when converting to soong_ui.

Test: m -j blueprint_tools (check soong.log)
Test: SANITIZE_HOST=address m -j blueprint_tools
Change-Id: I01eb567db6848dc36dd679557291a4e600a63bba
2017-04-27 14:33:24 -07:00
Colin Cross
1837b802e1 Enable mips32r2dsp[r2]-fp in mega device build
These seem to build now.

Test: mega device build
Change-Id: If2514258b0c57d6db484aed4c17a3e1f62109429
2017-04-27 12:21:24 -07:00
Colin Cross
893d816a6d Turn installation on in mega device build
Turn on installation in the mega device build, it is necessary for the ndk
sysroot installation.  Partially fixes mega device builds, they also need
to run without -w dupbuild=err on the ninja command line because multiple
variants of the same architecture try to install to the same ndk sysroot.

Test: mega device build
Change-Id: I982d77f9ff19f5bc29fc9fe54a0df8db3579c3e3
2017-04-27 12:21:24 -07:00
Colin Cross
ccf01e755e Prepend arch variant include directories
Arch variant include directories should override existing include
directories, add prepend_variant to the struct tags.

Test: m -j checkbuild
Change-Id: I4a758b42c19481f9496880d29dffea7836f613c5
2017-04-27 12:21:24 -07:00
Colin Cross
e90bfd157b Make generated_sources act like generated_headers
Make generated_sources dependencies honor the exported include
directories.

Test: m -j checkbuild
Change-Id: I6955cf5d985053071c2118f43fa1accdb4cc27ab
2017-04-27 12:21:24 -07:00
Colin Cross
dad8c954b2 Pass -I to yasm
external/libvpx needs -I flags to be propagated to yasm, but can't
handle all the other global flags (like -no-exceptions).  Add -I
arguments to YasmFlags as well as GlobalFlags.

Test: mega-device build of external/libvpx
Change-Id: I1607211c34b031fae8ffc1bd558b26019965a696
2017-04-27 12:21:24 -07:00
Colin Cross
0906f17f7e Add arm neon and mips dspr2 arch features
Current modules must use armv7_a_neon to specify source files that
compile only with neon.  If a future arch variant also supports neon,
all these modules will fall back to non-neon.  Support a neon arch
feature that modules can use instead.  Similarly, support dspr2 for
mips.

arm_device.go was also mixing armv7-a-neon with armv7_a_neon.  Use
armv7-a-neon consistently, and fix the - to _ when creating the
property structs.

Test: m -j checkbuild
Change-Id: I24d3764280ab3bcbb9a73c0934edc9b99fc7f6a0
2017-04-27 12:21:24 -07:00
Yi Kong
96247cef21 Merge "Fixups after llvm rebase" 2017-04-27 17:06:14 +00:00
Yi Kong
5cf3948310 Fixups after llvm rebase
Clang now generates a SHF_MERGE section that is rejected by GNU as on
Mips64. Change to use integrated assembler for Mips and Mips64.

Bug: 37423073
Test: external/clang/build.py
Change-Id: I8eae5cf370b930119eb6892db960f5f70777312f
2017-04-26 20:23:55 +00:00
Colin Cross
6d7afb8637 Merge "Make soong mm/ targets recursive" 2017-04-26 17:18:10 +00:00
Treehugger Robot
d68b8939cd Merge "Add frameworks/opt/net/wifi to root.bp" 2017-04-26 04:58:20 +00:00
Colin Cross
87d8b56eda Make soong mm/ targets recursive
Put mm/* targets into their parent directory's mm/ target.

Test: examine out/soong/build.ninja
Change-Id: Iacad3db8c904bb4d90b36e125bb359a7fb90368b
2017-04-25 13:26:40 -07:00
Logan Chien
cd304310a2 Add frameworks/opt/net/wifi to root.bp
This commit add frameworks/opt/net/wifi to root.bp so that
libwifi-system.so can become vendor_available.

Test: mmm frameworks/opt/net/wifi
Bug: 37429084
Change-Id: I98c695ec6b6c3e6788681b5dc243adab4d29d094
2017-04-25 16:16:59 +08:00
Colin Cross
e28f4e2acf Support test_suites in cc_benchmark modules
Bug: 35394669
Test: m -j checkbuild
Change-Id: I0b521d866edb1706669b8058dc128d389b5582da
2017-04-24 18:10:29 -07:00
Treehugger Robot
dd29407e74 Merge "Don't write output during tests" 2017-04-20 22:46:55 +00:00
Dan Willemsen
57a523863d Don't write output during tests
Removes the "\nPASS\n" print (since we only strip "PASS\n")

Test: m -j blueprint_tools
Change-Id: I31abd8474d92af29e1fa4c1ae5a940f6a588336d
2017-04-20 11:24:07 -07:00
Vishwath Mohan
8f4fdd8f76 Disable CFI for ASAN targets. (Soong)
This CL disables CFI if both CFI and ASAN flags are enabled. This
allows ASAN to take precedence where needed, preventing build errors
that would otherwise arise.

Bug: 30227045
Test: SANITIZE_TARGET="address" m -j40
Change-Id: Id336bf2bf5498d4c3ea6492e36b366c76c06376e
2017-04-20 08:06:09 -07:00
Vishwath Mohan
9ce4529614 Merge "Change the global CFI flag to default to enabled." 2017-04-20 01:39:56 +00:00
Treehugger Robot
f7d5dd7b35 Merge changes Ibf4d57ce,I65b49c96
* changes:
  Exit early on genrule command parsing failure
  Add frameworks/* to root Android.bp
2017-04-20 00:15:53 +00:00
Colin Cross
54c5dd5238 Exit early on genrule command parsing failure
cmd may be empty if android.Expand fails, and continuing results
in a panic.  Return immediately.

Test: m -j checkbuild
Change-Id: Ibf4d57ce048db9f7f16ce118ed9e9ecea5a6551c
2017-04-19 14:27:53 -07:00
Colin Cross
d87708ed4b Add frameworks/* to root Android.bp
frameworks/minikin is being converted, but enough of frameworks/*
is converted to switch to a glob.

Test: m -j checkbuild
Change-Id: I65b49c9661f4507aac9eacd108c9d8a71d272527
2017-04-19 14:27:53 -07:00
Treehugger Robot
8596bab0b0 Merge "Added duplicates checking when extracting source deps." 2017-04-19 19:50:11 +00:00
Treehugger Robot
5721284104 Merge "Convert soong_javac_filter to a wrapper" 2017-04-18 22:53:46 +00:00
Treehugger Robot
c957f90b10 Merge "Blacklist DISPLAY / GREP_OPTIONS" 2017-04-18 22:51:35 +00:00
Dan Willemsen
68a09854a4 Blacklist DISPLAY / GREP_OPTIONS
We keep having makefiles reading $DISPLAY, and GREP_OPTIONS with
--color=always has caused problems with shell commands in the past.

Bug: 37333696
Test: GREP_OPTIONS="--color=always" m -j
Test: DISPLAY=test m -j (modify an Android.mk to check DISPLAY)
Change-Id: Iafab37d61ecde5c6fdb35a05f18709abc17e8554
2017-04-18 14:02:38 -07:00
Jayant Chowdhary
918b1d9105 Fix lots of warnings from abi dumping.
Also fix ndk libraries are always re-building. Fix this by having the
build system know the report's file path. This will need to be changed
once we go off "advisory mode" to keep the report if builds fail on abi
breakages.

Bug: 37451651

Bug: 37450828

Test: mm -j64 in bionic/libc produces abi-dumps without warning:
argument unused during compilation: '-Wa,--noexecstack'

Test: cd system/core/init; mma -j;  NINJA_ARGS="-d explain" mma -j; The
second mma does not show a dirty libc.so.

Change-Id: I824723fd9e76586831ee2278db0b61329b1475c0
2017-04-18 10:50:31 -07:00
Colin Cross
ca3e2878d8 Convert soong_javac_filter to a wrapper
Piping the output of javac through a filter makes it hard to capture
the exit status.  Convert it to a wrapper that executes javac and
propagates the exit status.

Bug: 36666657
Test: javac_wrapper_test
Change-Id: I9b56cc3794023aabc9328138a68830e26e980f97
2017-04-18 10:36:33 -07:00
Vishwath Mohan
e87b768200 Make PIC/PIE levels compatible for LTO (Soong).
The build system currently uses -fPIC for position independent
libraries, and -fpie for position independent executables. However,
these levels are incompatible and conflict when an executable includes
a static lib with the -fPIC flag - such as when building with
LTO. This CL changes the flag for executables to the compatible -fPIE
instead, which is equivalent for all architectures except PowerPC.

Bug: 30227045
Test: ENABLE_CFI=true m -j40 checkbuild # builds and boots
Change-Id: I95b585b553bc00bc1d4f52f4271c5e30e1007d9b
2017-04-17 16:21:41 -07:00
Jayant Chowdhary
3e231fd8bd Add header-abi-checker for Vndk abi checks.
header-abi-dumper: dumps abi exported by source files for Vndk.
header-abi-linker: links abi dumps produced by header-abi-dumper.
header-abi-diff: compares linked dumps.

Test: mm -j64 showcommands > make_log in bionic/libc.
      This produced linked dumps in out/soong/.intermediates.
      Copied these dumps to
      prebuilts/abi-dumps/ndk/current/arm64/source-based/.
      Changed the abi and re-ran mm -j64 showcommands > make_log
      confirmed that the build reported compatibility breakge without
      actually failing (advisory mode).

Change-Id: Iccad6908fe68a80f47230751671d156893b96ead
2017-04-14 19:48:10 -07:00
Colin Cross
c43ae770c5 Don't install header libraries
Use library.shared() instead of !ctx.static() to avoid installing
header libraries when handling installation in soong.

Test: check build.ninja for installed .a files
Change-Id: I8c59d5845dd32419644b7ccdab3c341bc4bf3617
2017-04-14 15:42:53 -07:00
Vishwath Mohan
c32c3ebfb9 Change the global CFI flag to default to enabled.
This CL changes the ENABLE_CFI flag to default to enabled. Setting it
to false will override local settings to enable CFI.

Bug: 30227045
Bug: 22033465
Test: m -j40 works and device boots
Test: cfi is honored unless the global flag is set.
Change-Id: Ie3285c5eac60c8f6012c6b6c23be149a8787af0c
2017-04-13 17:17:28 -07:00
Colin Cross
4247f0d0ed Enable arm_on_x86 mode when arm is a secondary arch
Enable arm_on_x86 mode whenever compiling for x86 on the device,
and either arm is listed as an ABI on the x86 arch, or arm exists
as a target arch.

Bug: 35286489
Test: examine bcc cflags
Change-Id: Iebd0e7b95f584d25773a60474c27425cac7a578e
2017-04-13 16:56:14 -07:00
Colin Cross
1b59409256 Make mini-debug-info stripping pass on already stripped binaries
Prebuilts may already be stripped.  Instead of requiring every stripped
prebuilt to be annotated with LOCAL_STRIP_MODULE := false, just make
the default (mini-debug-info) pass through already-stripped modules
without failing.

Bug: 36793128
Test: manual
Change-Id: I9aec008a867eb7df0fbba82b6dd36605dcbf6b9f
2017-04-13 16:19:34 -07:00
Colin Cross
ce87b801ea Use ArchType instead of string as map key
There is no need to convert ArchType to a string, it can be used
as a map key directly.  It will also be implicity stringified when
passed as a %q parameter to fmt.Errorf.

Test: builds
Change-Id: I5c316fb543108cb88c0c9c1ebafc1bf0050d143e
2017-04-13 20:40:59 +00:00
Colin Cross
d4025826c3 Skip ndkApiMutator on disabled modules
Builds with no device architectures configured will disable all
device modules, don't run the mutator on them.  Avoids panics
in Config.PlatformSdkVersionInt() (because the sdk version is not
set in soong.variables) and in normalizeNdkApiLevel (no arch
mutator was run on the module so arch is "").

Bug: 37315968
Test: prebuilts/build-tools/build-prebuilts.sh
Change-Id: Iac124e00403eee9f2c1072788e2f51914b0112a5
2017-04-13 12:53:07 -07:00
Christopher Ferris
6e0b536cde Merge "soong: use optimal FPU for Cortex-A7" 2017-04-12 17:10:01 +00:00
Treehugger Robot
5de3812c58 Merge "Add script to make a Go-style workspace for Soong" 2017-04-12 07:56:11 +00:00