Commit graph

4756 commits

Author SHA1 Message Date
Jeff Gaston
437d23c3ad Consolidate gensrcs implementation into one task each
in preparation for each task to delete its output dir
before running.

Bug: 38205169
Test: rm out -rf && m -j

Change-Id: Ifcd42073d4fb74f532adc0c095555b4a542feb99
2017-11-08 12:38:00 -08:00
Jeff Gaston
5acec2b0e0 Have genrule use $genDir as sbox's --output-root
rather than passing buildDir .
This will make it reasonable for sbox to delete its --output-root

Bug: 38205169
Test: m -j
Change-Id: Ic3a82a8df040117870c251c068a88545143257cf
2017-11-08 12:37:14 -08:00
Dan Willemsen
b760f5d638 Merge "Setup java paths in soong_ui" 2017-11-08 20:31:30 +00:00
Treehugger Robot
c7b8e72c91 Merge "Change bool, and string properties to *bool, and *string for cc" 2017-11-08 18:41:33 +00:00
Treehugger Robot
f20e48a9e5 Merge "Add support for test_suites for python_binary_host and python_test_host" 2017-11-08 18:23:16 +00:00
Dan Willemsen
d9e8f0a95a Setup java paths in soong_ui
This way config.mk no longer needs to check which java is in PATH and
fix it. It'll be consistent for all build steps under soong_ui.

Also unify handling of ANDROID_JAVA_HOME / JAVA_HOME with
OVERRIDE_ANDROID_JAVA_HOME / EXPERIMENTAL_USE_OPENJDK9.

Test: m nothing
Test: build/soong/soong_ui.bash --make-mode nothing (w/o envsetup.sh)
Test: aosp_arm ninja files are the same before/after
Test: before/after ninja files match with OVERRIDE_ANDROID_JAVA_HOME
Test: before/after ninja files match with EXPERIMENTAL_USE_OPENJDK9
Change-Id: Icdb65093d9c346524074de239a4f895e4230a24d
2017-11-08 00:44:47 -08:00
Isaac Chen
2bce8edf34 Generic 32-bit armv8 built as generic armv7 fix
When the following lines are specified in the BoardConfig.mk

TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_CPU_VARIANT := generic

The resulted binaries won't be built using 32-bit armv8-a integer
division instructions. Instead, division routines are used because
the build system will set a compiler option "-march=armv7-a", and
hence overwiting the previous "-march=armv8-a", when
TARGET_2ND_CPU_VARIANT is set to generic (or unset).

Bug: 67446726
Test: lunch aosp_arm64; make -j; emulator # boot to home screen
      Also verify -march=armv7-a is not specified in the compiler
      command line and the resulted binary actually uses integer
      division instructions.

Change-Id: I430687aa5a658d2ec9f325a66d849b4c8898c7d5
2017-11-08 04:17:35 +00:00
Nan Zhang
0007d810e2 Change bool, and string properties to *bool, and *string for cc
there's no use case for prepending/appending to bool, and string
properties within module struct. Declearing "*bool" and "*string" almost
cover everything user need.

I did see one case that user specify relative_install_path as
path prefix in cc_defaults, and concatenate with the one in real module
to get the final relative install path in Android.bp <bionic/tests/libs>.

Test: m -j checkbuild
Bug: b/68853585
Change-Id: If3a7a2689c3fc307aae136af6bc9c57f27a1e1a0
2017-11-07 15:57:16 -08:00
Colin Cross
d293e65c82 Merge "Let LoadHooks call CreateModule" 2017-11-07 22:49:47 +00:00
Dan Willemsen
4eeb44b83f Merge "Change storage behavior of multiproduct_kati" 2017-11-07 22:25:24 +00:00
Colin Cross
5a79c83893 Add presingletons
Plumb blueprint's presingletons through register.go.

Test: m checkbuild
Change-Id: I5bc0f311740c9220f7afdf2999e6f080f5b0c5ab
2017-11-07 13:36:44 -08:00
Colin Cross
99c6dfaecc Add OncePer.Get()
Allow functions to get the result associated with a OncePer key without
also specifiying a function.  Panics if the key has not already been
set.  Also replace the open-coded concurrent map implementation with
the new sync.Map.

Test: m checkbuild
Change-Id: I814fdb1ffffaee8398dc877af146e29638c8a6a8
2017-11-07 13:36:44 -08:00
Nan Zhang
c9c6cb77d8 Add support for test_suites for python_binary_host and python_test_host
Test: manually add this property, and then check Android-aosp_arm.mk
Bug: b/35394669
Change-Id: Iddaf677839714daf4f8913ff4bf9e944d38c18db
2017-11-07 13:13:59 -08:00
Colin Cross
519917db89 Let LoadHooks call CreateModule
Move AppendProperties and PrependProperties into TopDownMutatorContext
so that LoadHooks can be a subset of TopDownMutatorContext that also
includes CreateModule.

Test: m checkbuild
Bug: 35570956
Change-Id: Iffa6a6aec96f08821c2446e0e0f4622ab772b54c
2017-11-07 13:08:36 -08:00
Dan Willemsen
4647be4afe Merge changes Ieaff757f,I5bdbba8d
* changes:
  pom2mk: Fix unlisted dependency types
  pom2mk: Add a flag to specify a specific version of artifacts
2017-11-07 20:59:02 +00:00
Dan Willemsen
e348076296 Change storage behavior of multiproduct_kati
Instead of deleting artifacts/logs from successful build (unless -keep
is set), and keeping unsuccessful artifacts, keep all logs and remove
all artifacts (unless -keep is set, then we'll compress the artifacts).

If -dist is passed in, we'll put an archive of the logs into the
DIST_DIR. Even compressed, the rest of the artifacts are still a bit too
large to dist (~5.6GB on AOSP).

Test: build/soong/build_test.bash
Test: build/soong/build_test.bash -keep
Test: build/soong/build_test.bash -dist
Change-Id: I87f55978c18c8ff2e517b8271554ba383003742f
2017-11-07 11:30:19 -08:00
Dan Willemsen
5f9d8a6698 pom2mk: Fix unlisted dependency types
Android Support Library 26+ does not specify dependency types, so parse
all pom files first, then propagate missing dependency types if we've
got the information.

Bug: 64723465
Test: cd prebuilts/maven_repo/android; pom2mk -use-version 26.0.0-beta2 com/android/support
Change-Id: Ieaff757ff198c9a7b4b006623340b382728c1fd4
2017-11-06 20:55:02 -08:00
Treehugger Robot
7feb847418 Merge "Support Javac sharding in Soong." 2017-11-06 23:54:29 +00:00
Treehugger Robot
a632e9f4d2 Merge changes Ie8ecb6c9,Ia9befd7c
* changes:
  Use relative paths in copygcclib.sh deps files
  Move -fno-canonical-system-headers to global cflags
2017-11-06 23:04:09 +00:00
Nan Zhang
61eaedbddf Support Javac sharding in Soong.
Test: m clean && m -j java and java_test.go

Change-Id: I110a0ff029448d3319aed2788d25d90a6c1a7fa0
2017-11-06 14:23:59 -08:00
Colin Cross
d7903535ea Use relative paths in copygcclib.sh deps files
Strip $PWD/ off the beginning of the path printed by gcc.

Bug: 68719465
Test: m checkbuild
Test: prebuilts/build-tools/linux-x86/bin/ninja -f out/combined-${TARGET_PRODUCT}.ninja -t deps | grep -E '^[[:space:]]*/' | sort | uniq
2017-11-06 12:56:34 -08:00
Colin Cross
39d450b374 Move -fno-canonical-system-headers to global cflags
-fno-canonical-system-headers is required for gcc to use relative
paths to system headers in deps files, and is stripped out for
clang.  Move it to the global flags so it affects windows gcc builds.

Bug: 68719465
Test: m checkbuild
Test: prebuilts/build-tools/linux-x86/bin/ninja -f out/combined-${TARGET_PRODUCT}.ninja -t deps | grep -E '^[[:space:]]*/' | sort | uniq
Change-Id: Ia9befd7cf8cfd714241e636fb786c319aecc79fe
2017-11-06 12:56:34 -08:00
Treehugger Robot
9c7dcfd72c Merge "Remove CFI-related WARs that seem no longer necessary" 2017-11-06 20:28:23 +00:00
Jeff Gaston
048bf57c33 Merge "Use flag.Parse in sbox" 2017-11-06 20:08:24 +00:00
Colin Cross
5c9cf6eb84 Merge changes from topic "crt_cflags"
* changes:
  Remove no_default_compiler_flags property
  Move -fomit-frame-pointer to armCflags
  Consolidate ldflags that are used on all devices
  Remove -Wl,--gc-sections from target flags
  Consolidate cflags that are set on all devices
  Consolidate global cflags
2017-11-06 18:59:00 +00:00
Alan Leung
a39899edb9 Merge "Always use installed version of d8-compat-dx" 2017-11-06 18:54:53 +00:00
Treehugger Robot
5d37417347 Merge "Add default jar wrapper when wrapper property is not specified" 2017-11-06 18:04:27 +00:00
Colin Cross
87dd963ace Remove no_default_compiler_flags property
no_default_compiler_flags is only used by the crt* modules,
is unnecessary, and causes problems when necessary flags like
-no-canonical-prefixes are not passed.  Remove the property.

Use useVndk() instead of noDefaultCompilerFlags() to determine
if adding libc as a dependency is necessary and won't cause a
circular dependency.

Bug: 68719465
Test: m checkbuild
Change-Id: Iea1a082dc701dfeab211049a22f7066257347b80
2017-11-03 22:28:57 -07:00
Colin Cross
0f1f679f5e Move -fomit-frame-pointer to armCflags
-fomit-frame-pointer was specified twice, once for arm and once for
thumb.  Move it to the shared cflags.

Bug: 68855788
Test: m checkbuild
Change-Id: Iab1299c247808f1a2542b468084600b7c32996e8
2017-11-03 22:28:12 -07:00
Colin Cross
324a457440 Consolidate ldflags that are used on all devices
Move ldflags that are specified for all devices into
deviceGlobalLdflags, and add them to linker.go:
-Wl,-z,noexecstack
-Wl,-z,relro
-Wl,-z,now
-Wl,--build-id=md5
-Wl,--warn-shared-textrel
-Wl,--fatal-warnings
-Wl,--no-undefined-version

Bug: 68855788
Test: m checkbuild
Change-Id: I82561b4189287d7638006f9e298c5151f9930c5e
2017-11-03 22:28:03 -07:00
Treehugger Robot
8eaca18c49 Merge "Export test/benchmark factory symbols." 2017-11-04 02:59:00 +00:00
Jeff Gaston
93f0f37417 Use flag.Parse in sbox
Also removeTempDir -> !keepOutDir
Also shorten the help comment

Bug: 68336760
Test: rm out -rf && m -j
Test: sbox -c # and observe that the output does not have a stacktrace

Change-Id: I6fbb385132128ab1273c8398ff2425191049751e
2017-11-03 17:30:21 -07:00
Nan Zhang
3c807db06e Add default jar wrapper when wrapper property is not specified
Bug: b/68779881
Test: manually copied the jar-wrapper.sh to out/soong/host/linux-x86/framework
Change-Id: Idee1e7e64c6e3c89c89a8cd9c107a38533356b6c
2017-11-03 15:19:15 -07:00
Dan Willemsen
47e44a4c5c pom2mk: Add a flag to specify a specific version of artifacts
For repositories that contain multiple versions of the same artifact,
we'd only like to create makefiles for one of the versions of the
artifact.

Bug: 64723465
Test: cd prebuilts/maven_repo/android; pom2mk -use-version 25.3.1 com/android/support
Change-Id: I5bdbba8d2143a47610d56d679381eb01b3cf176d
2017-11-03 13:40:08 -07:00
Dan Albert
f45c6934c8 Stop building MIPS ABIs for the NDK.
Test: build/soong/scripts/build-ndk-prebuilts.sh
Bug: https://github.com/android-ndk/ndk/issues/272
Change-Id: Ia8d48b1ecef5e1a3b239e2817eeed5dbe43e52ef
2017-11-03 19:38:03 +00:00
Colin Cross
0e37bc78d4 Remove -Wl,--gc-sections from target flags
-Wl,--gc-sections is already added by library.go and binary.go for
anything that uses bionic.

Bug: 68855788
Test: m checkbuild
Change-Id: I229199045ef8595d69c07fcf1aa6bbdc0b753fe3
2017-11-03 11:34:45 -07:00
Colin Cross
133dbe7bb0 Consolidate cflags that are set on all devices
Move cflags that are set on all devices to deviceGlobalCflags:
-fno-canonical-system-headers
-ffunction-sections
-funwind-tables
-fstack-protector-strong
-Wa,--noexecstack
-D_FORTIFY_SOURCE=2
-Wstrict-aliasing=2
-Werror=format-security

Bug: 68855788
Test: m checkbuild
Change-Id: Iefec689fdd2749013d0cc003b3abec674a85fb74
2017-11-03 11:34:45 -07:00
Colin Cross
7278afc5a8 Consolidate global cflags
Move all the flags that are used everywhere (or should be used
everywhere) into cc/config/global.go:
-no-canonical-prefixes
-fno-exceptions
-Wno-multichar
-O2
-g
-fno-strict-aliasing

Also remove flags that are already in noOverrideGlobalCflags:
-Werror=pointer-to-int-cast
-Werror=int-to-pointer-cast

x86 and x86_64 were specifying -fstrict-aliasing, but that was
being overriden later by -fno-strict-aliasing, so remove it.
ARM devices still override -fno-strict-aliasing to -fstrict-aliasing
when using ARM (vs. Thumb) instruction set.

Bug: 68855788
Test: m checkbuild
Change-Id: Ia2b5891bdefb60f974ad92b4b84a8548c2dcc7dc
2017-11-03 11:34:45 -07:00
Pirama Arumuga Nainar
bdb17f068c Remove CFI-related WARs that seem no longer necessary
Bug: http://b/33678192

Clang has been updated past the revisions mentioned in the work arounds.
So these seem no longer necessary.

Test: Build

Change-Id: I08fee0db7c5785836a1ad0104688245435865cb7
2017-11-02 23:37:28 -07:00
Steven Moreland
87c9d7bb8f Export test/benchmark factory symbols.
Bug: 35570956
Test: manual
Change-Id: I3dc2d7fd8876a0a222d1fc3e0f6ba27ecc2f50e8
2017-11-02 21:38:58 -07:00
Steven Moreland
f9e621603b Export cc library factories.
Previously not useful, they are required to use CreateModule
to create additional libraries.

Bug: 35570956
Test: manual :)

Change-Id: Ibb6b1c0d365512fce8969e1e6237ebbed0bc9cdc
2017-11-03 00:05:54 +00:00
Treehugger Robot
845da14a35 Merge "Don't install both variants for host or non-make builds." 2017-11-02 17:41:20 +00:00
Jayant Chowdhary
7a709dae7a Merge "Convert abi warnings to errors." 2017-11-02 16:44:56 +00:00
Vishwath Mohan
e21fe42662 Don't install both variants for host or non-make builds.
This CL ensures that only one of the two generated variants are
installed for non-make builds and for host binaries.

Bug: 30227045
Test: OUT_DIR=/tmp/ndk build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I7ca78af51ea6bd3ae1107a69331abd6ff68f2150
2017-11-02 03:03:50 -07:00
Jayant Chowdhary
a3bb1b3e3b Convert abi warnings to errors.
Convert abi warnings to errors by removing the -advice-only flag from
the invocation of header-abi-diff. This will only apply to branches with
reference abi dumps checked into prebuilts/abi-dumps/(v)ndk (since
abi-diffing will only be triggered on them.)

Also allow for:

1) Extensions.
2) Changes to types in exported headers, unreferenced by public symbols still
   trigger warnings.
3) Any removal of symbols appearing in a shared library's .dynsym table, but not
   in exported headers is still a warning.

Bug: 64267858

Test: make -j64 from ToT.

Change-Id: Iadeac8d060cb693d4310afb841dc48d91f38597d
2017-11-01 17:32:26 -07:00
Treehugger Robot
d1dec3bd72 Merge "Revert "Revert "Make some common properties overridden when used in defaults modules""" 2017-11-02 00:10:39 +00:00
Colin Cross
9117c879f3 Merge "Propagate PRODUCT_MINIMIZE_JAVA_DEBUG_INFO to soong and use it" 2017-11-02 00:05:20 +00:00
Colin Cross
7d716baedf Revert "Revert "Make some common properties overridden when used in defaults modules""
This reverts commit 5c3c768187.

This reapplies I70e45caa92f65dc6a3bc81ae33a5a8f34ad11890 along with
additional changes in other projects to match the new types.

Bug: 68337468
Test: m checkbuild
Change-Id: I2d2d876b291869f834a6468d3e2ad99148f94a15
2017-11-01 14:24:48 -07:00
Colin Cross
126a25cb3d Propagate PRODUCT_MINIMIZE_JAVA_DEBUG_INFO to soong and use it
Strip debug info in javac when PRODUCT_MINIMIZE_JAVA_DEBUG_INFO
is set.

Test: m with PRODUCT_MINIMIZE_JAVA_DEBUG_INFO=true
Change-Id: I167e742662801291c516bf1ff826486560d22147
2017-11-01 12:51:16 -07:00
Vishwath Mohan
b743e9c16a Revert "Revert "Build system changes for CFI (Soong)""
This reverts commit 33c252c2f1.

I have a fix to the crashes that this CL set was causing, and have
uploaded it as a patchset to this revert.

This also contains a partial fix that was initially submitted
separately as
https://android-review.googlesource.com/#/c/platform/build/soong/+/524295/

Bug: 30227045
Test: ./art/test/testrunner/run_build_test_target.py -j110 art-asan #no
build errors
Test: m -j50 ASAN_OPTIONS=detect_leaks=0 SANITIZE_HOST=address # no
build errors

Change-Id: I3e53549fa03413d35d9a952f04de1e7629e1f06d
2017-11-01 12:50:01 -07:00