Commit Graph

2458 Commits

Author SHA1 Message Date
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
Dan Willemsen 862e5cc72e Merge "Split /system and /vendor modules, allow multi-installation" 2017-04-12 00:06:52 +00:00
Jake Weinstein 5cfd709529 soong: use optimal FPU for Cortex-A7
* Cortex-A7 supports VFPv4 instructions

Test: make otapackage
Change-Id: I709811980cda398994ba8c6e791a8625a3422455
2017-04-11 14:37:04 -07:00
Christopher Ferris a688be8f7d Merge "soong: always use -mfpu=neon-vfpv4 for Krait targets" 2017-04-11 19:54:38 +00:00
Dan Willemsen 4416e5db69 Split /system and /vendor modules, allow multi-installation
Nothing changes if BOARD_VNDK_VERSION isn't set.

When the VNDK is enabled (BOARD_VNDK_VERSION in Make), this will split
/system and /vendor modules into two different variant spaces that can't
link to each other. There are a few interfaces between the two variant
spaces:

The `llndk_library` stubs will be available in the /vendor variant, but
won't be installed, so at runtime the /system variant will be used.

Setting `vendor_available: true` will split a module into both variants.
The /system (or "core") variant will compile just like today. The
/vendor ("vendor") variant will compile against everything else in the
vendor space (so LL-NDK instead of libc/liblog/etc). There will be two
copies of these libraries installed onto the final device.

Since the available runtime interfaces for vendor modules may be
reduced, and your dependencies may not expose their private interfaces,
we allow the vendor variants to reduce their compilation set, and export
a different set of headers:

  cc_library {
      name: "libfoo",
      srcs: ["common.cpp", "private_impl.cpp"],
      export_include_dirs: ["include"],
      target: {
          vendor: {
	      export_include_dirs: ["include_vndk"],
	      exclude_srcs: ["private_impl.cpp"],
	      srcs: ["vendor_only.cpp"],
	  },
      },
  }

So the "core" variant would compile with both "common.cpp" and
"private_impl.cpp", and export "include".

The "vendor" variant would compile "common.cpp" and "vendor_only.cpp",
and export "include_vndk".

Bug: 36426473
Bug: 36079834
Test: out/soong/build.ninja, out/soong/Android- only changes due to _core addition and
      .llndk -> .vendor
Test: attempt to compile with BOARD_VNDK_VERSION:=current
Change-Id: Idef28764043bf6c33dc0d2e7e2026c38867ff769
2017-04-11 12:27:41 -07:00
Dan Willemsen 01a90597bc Remove explicit suffixes from (ll)ndk_library
Soong can rename these automatically for internal use, so don't require
users to set these.

Bug: 33241851
Test: Android-aosp_arm.mk is the same before/after
Test: build.ninja is the same before/after
Test: build-aosp_arm.ninja is the same before/after
Merged-In: Ia92356a0ec079f908fd49812231228046783e50d
Change-Id: Ia92356a0ec079f908fd49812231228046783e50d
2017-04-11 15:14:11 +00:00
Jake Weinstein fff256f817 soong: always use -mfpu=neon-vfpv4 for Krait targets
* GCC and Clang both support this, so we may as well simplify
  the logic.

Test: make otapackage
Test: verified that the options are exactly the same, just slightly different order.

Change-Id: I8c2e9f3875cb662db708c799c9ce54f9fdd55981
2017-04-10 21:32:09 +00:00
Nan Zhang 2439eb7761 Added duplicates checking when extracting source deps.
Added this functionality since Blueprint layer won't check deps
duplicates.

Test: Manual m -j.
Change-Id: I28d5f558a211609ecd0b4c2223be897fc1baae17
2017-04-10 12:16:30 -07:00
Treehugger Robot 2ce95652a8 Merge "Implement vendor as a synonym of proprietary" 2017-04-08 00:08:52 +00:00
Christopher Ferris 56d299d614 Merge "soong: use optimal FPU on Kryo targets" 2017-04-07 23:18:24 +00:00
Dan Willemsen aa118f95a6 Implement vendor as a synonym of proprietary
The vendor image will have more than just proprietary modules in it
under Treble, so let's stop marking open source code as proprietary just
to move it to vendor.

Bug: 36452052
Bug: 37134596
Test: compare build.ninja before/after, no changes.
Test: Set vendor: true, ensure it works.
Change-Id: I44b0ec7007d0e311bdcbd44b238b1ef2d05cc6ff
2017-04-07 14:59:18 -07:00
Jake Weinstein 1783a2f3e8 soong: use optimal FPU on Kryo targets
* -mfpu=neon-fp-armv8 enables the ARMv8 floating-point and
  Advanced SIMD extensions.

Test: Marlin builds successfully

Change-Id: Ibdf71dae61b966372e3bcb946aa18d1a6cd0f8e6
2017-04-07 14:25:28 -04:00
Dan Willemsen b916b80bf3 Add LLNDK support for the VNDK
Instead of using the NDK headers and libraries, add LL-NDK specific
headers and library stubs for VNDK users. This allows us to provide an
expanded liblog interface.

Test: aosp_arm; m -j
Test: Enable BOARD_VNDK_VERSION on aosp_arm; m -j
Test: Inspect out/soong/build.ninja before/after (w/o vndk)
Change-Id: Ic85f07fa10c695b5baab10c41f5e0ad38700bf3d
2017-04-07 10:18:56 -07:00
Dan Willemsen 86a1c7dd15 Merge "Support a `vndk` tag in gen_stub_libs.py" 2017-04-07 17:16:09 +00:00
Alex Naidis 5df73d02ce Make use of specific Kryo targeting in Clang
Clang supports specific CPU targeting and optimization
for Kryo.

This switches us to using the specific Kryo targeting
when Clang is used. For other compilers, we fallback
to cortex-a57 targeting.

Also, move the replaceFirst function to a shared location.

Bug: 36728278

Test: Built and booted sailfish, ran bionic unit tests and art tests.
Test: Disassembled libc.so before this change and after and looked at
Test: the differences. Mostly the results were the order of instructions
Test: changing.
Test: Verified with the clang person (srhines) that our clang has this support
Test: and that it appears to be mostly instruction scheduling changes.

Change-Id: I4ee73d8bcc1e4f5eccb162c18937811fe199b16f
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2017-04-06 14:35:44 -07:00
Dan Willemsen b01e7f7fd6 Support a `vndk` tag in gen_stub_libs.py
This hides a particular symbol from the NDK stubs, while allowing the
symbol to be exposed to the VNDK through the LLNDK stubs. This doesn't
introduce any sort of versioning yet, this will need to change when we
add a new symbol to a new version of the VNDK.

Test: test_gen_stub_libs.py
Test: With my LL-NDK patches, inspecting the generated map files
Change-Id: Iee86aafda7985d6d7a016d0d5ff951505634913b
2017-04-05 14:13:55 -07:00
Dan Willemsen f3d98fbb59 Merge "Pass exportedFlags directly to Make" 2017-04-05 05:43:05 +00:00
Dan Willemsen 5853940a18 Pass exportedFlags directly to Make
Instead of using LOCAL_EXPORT_C_INCLUDE_DIRS, use LOCAL_EXPORT_CFLAGS.
This will let us pass -isystem (or potentially other cflags) in the
future. Also refactors the function to be on libraryDecorator instead of
a private lambda so that wrappers can use it.

Test: m -j
Merged-In: Id0dbde7dd03f4e1e1602f7958c445c86f5db15fe
Change-Id: Id0dbde7dd03f4e1e1602f7958c445c86f5db15fe
2017-04-05 03:36:10 +00:00
Yoshisato Yanagisawa 13fd3ff296 Export JAVAC_WRAPPER environment.
To allow to inject a wrapper program for compiling java code, let
me allow soong to export JAVAC_WRAPPER.

Test: Set JAVAC_WRAPPER and ANDROID_COMPILE_WITH_JACK=false envs,
Test: and make -j 32

Change-Id: Ib77fe00bd781f8f4ddf965c5e7905eab466a057a
2017-04-05 11:35:24 +09:00
Treehugger Robot bb5e5fb4c5 Merge changes Id38ce60b,I7c24c39b
* changes:
  Disable .toc generation for windows
  Add ctx.Windows()
2017-04-05 01:07:37 +00:00
Colin Cross d8f8d076c0 Disable .toc generation for windows
toc.sh doesn't support windows.

Bug: 36874115
Test: builds
Change-Id: Id38ce60bf2d11a56938eb37193589ccee845a855
2017-04-04 15:56:54 -07:00
Colin Cross 3edeee113a Add ctx.Windows()
Replace ctx.Os() == android.Windows with ctx.Windows()

Test: builds
Change-Id: I7c24c39bcf54a51ad152b21c0021e40a0c07f189
2017-04-04 15:39:04 -07:00
Dan Willemsen 866810db9f Exclude ndk stubs from notice file list
Set LOCAL_NO_NOTICE_FILE so that we don't list them in the third party
notices:

out/soong/ndk/platforms/android-10/arch-arm/usr/lib/libc.so
out/soong/ndk/platforms/android-10/arch-arm/usr/lib/liblog.so
...

These are just stub libraries, and aren't distributed on the device. The
real versions of these libraries will be distributed on the device, and
already have the license information.

Bug: 36867708
Test: Diff aosp_arm's system/etc/NOTICE.html.gz file before/after
Change-Id: Ib647c64e9ce55f700738b00d2ff685e784ed3801
2017-04-04 14:59:57 -07:00
Alex Naidis ac01ff5447 Add support for an armv8 variant for Kryo
* Use mcpu=cortex-a57, since it is the closest to Kryo.
* Clang doesn't support Kryo as a target yet.

Bug: 36728278

Test: Built and booted a sailfish using Kryo.

Change-Id: Ic0c9588d86fba41896e50e3f0cf0d2b310ffee93
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2017-04-04 19:09:43 +00:00
Alex Naidis ae4fc18406 Add support for an armv7 variant for Kryo
* Kryo is closer to Krait than to cortex-a53, so choose Krait defaults.

* Made together with Jake Weinstein (xboxfanj)

Bug: 36728278

Test: Built and boot sailfish set up as kryo.

Change-Id: I04fa0a1dca6f97ae19202d28ee3ce8a59bf169b5
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2017-04-04 19:09:36 +00:00
Steven Moreland 1889d015c5 Merge "multiproduct_kati: better directory names."
am: a41a5da52a

Change-Id: I332b487bdbce5a52b57d78cd1bc4999824b14d54
2017-04-04 17:21:13 +00:00
Treehugger Robot a41a5da52a Merge "multiproduct_kati: better directory names." 2017-04-04 17:16:06 +00:00
Jeff Gaston d3c86d2826 Merge "Microfactory support for transitive link dependencies"
am: 12bd6fef8a

Change-Id: Idd5666df91d58dd28a084857fba54a71da10c504
2017-04-04 00:49:56 +00:00
Treehugger Robot 12bd6fef8a Merge "Microfactory support for transitive link dependencies" 2017-04-04 00:42:40 +00:00
Dan Shi 10d454db64 Correct variable name LOCAL_COMPATIBILITY_SUITE
am: 4df566d313

Change-Id: I62520ce0a77d8817c6f89837d4774d3993870a73
2017-04-03 21:19:39 +00:00
Dan Shi 4df566d313 Correct variable name LOCAL_COMPATIBILITY_SUITE
Test: m -j checkbuild
Bug: 35394669
Change-Id: I117224b2266520e6aec44aef62551b0836a83520
2017-04-03 12:29:25 -07:00
Dan Albert 67e0712b17 Merge "Add `sdk_version: "minimum"`."
am: fe7f2f393b

Change-Id: I0c95617b21d1f717540e4bdd52cdeb8f9fe233ba
2017-04-01 04:56:32 +00:00
Treehugger Robot fe7f2f393b Merge "Add `sdk_version: "minimum"`." 2017-04-01 04:49:35 +00:00
Jeff Gaston 1ae73a67f0 Microfactory support for transitive link dependencies
Bug: 36816202
Test: make -j
Change-Id: Idbdf81002ed4c363a2b725905d91ffc204ef3d0e
2017-03-31 17:21:33 -07:00
Stephen Hines b3f4bc7df3 Merge "Add prebuilts/clang/host/linux-x86 to root.bp."
am: 3c0e2cdc41

Change-Id: I1411459a8019cbfb4566a68f277882fe00b0f99d
2017-03-31 23:58:24 +00:00
Treehugger Robot 3c0e2cdc41 Merge "Add prebuilts/clang/host/linux-x86 to root.bp." 2017-03-31 23:48:48 +00:00
Dan Albert 2e5d7d41f4 Add `sdk_version: "minimum"`.
This maps to the lowest supported API level for the given
architecture.

Test: make checkbuild # after setting some things to use this
Bug: None
Change-Id: Ied6d44cb2719b73f35dde38a2dca6d3c87c7c924
2017-03-31 16:19:51 -07:00