Commit graph

1135 commits

Author SHA1 Message Date
Chih-hung Hsieh
e41f450a35 Merge "Add default -Werror to libbufferhub" 2017-12-13 01:53:46 +00:00
Justin Yun
8fe1212261 Install current VNDK libs to the versioned directories.
If PLATFORM_VNDK_VERSION has a version $VER other than "current",
install current VNDK libs to /system/lib[64]/vndk[-sp]-$VER.
Otherwise, they will be installed to /system/lib[64]/vndk[-sp].

Bug: 69883025
Test: device boot
Change-Id: Ifa8564f39687dab5b407bf2178b13022625a94f3
2017-12-13 10:47:44 +09:00
Stephen Crane
10cd187963 Propagate LTO type from binary/DSO to object files
Propagation of LTO flags from a main binary or library to its static
dependencies is necessary so that objects being linked with LTO are built as
bitcode rather than native objects. This propagation was broken when thin LTO
was added to the build system. This patch propagates the LTO mode (thin or full)
down to object and archive dependencies.

Test: Build libhwui with full and thin LTO and check that intermediate objects
are LLVM bitcode.
Change-Id: Ic57a80d75052d86940db076fbc0f5375a79c89a1
2017-12-12 14:33:45 -08:00
Chih-Hung Hsieh
1bb807bb45 Add default -Werror to libbufferhub
bug: 66996870
Test: normal build
Change-Id: I1a5d17a2752972f91fd7196128c10dddedca177d
2017-12-12 14:33:18 -08:00
Chih-hung Hsieh
0bdcb21f2e Merge "Add default -Werror to sdk/emulator/mksdcard." am: 6f822b8b93 am: a6e2d7d6c3
am: 821ae0fcbf

Change-Id: Iaeefa36bde5d45d4ef6ba9ad537e573f6dd3a3fd
2017-12-12 07:48:38 +00:00
Chih-hung Hsieh
c39b72656b Merge "Add default -Werror to frameworks/ml/nn." am: a3818107e8 am: d0857b30f7
am: ea1d5420f6

Change-Id: Ida83b351cfd7b3eb7593919ab7bb1589f44677d9
2017-12-12 02:40:05 +00:00
Chih-Hung Hsieh
a227ea38f0 Add default -Werror to sdk/emulator/mksdcard.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I6499be53a2539143ad6785c1513fe4bd5d3a9910
2017-12-12 01:45:01 +00:00
Chih-Hung Hsieh
65b76252cc Add default -Werror to system/vold/tests. am: 75f2e70dff am: 167803be63
am: 474373d399

Change-Id: I0583b8832291dce6caa2ec14527d82e467132d78
2017-12-11 23:37:22 +00:00
Chih-hung Hsieh
24f7a8e71d Merge "Add default -Werror to cts." am: 44c235d4d7 am: b95ec525bf
am: 716133f307

Change-Id: If2773262684c0243b0ef58d449d43129e9ddaa81
2017-12-11 23:34:22 +00:00
Chih-Hung Hsieh
8fd29d3bb8 Add default -Werror to frameworks/ml/nn.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I6c7fb32b0abaf9b1dc03292daf7c584b1648eeeb
2017-12-11 23:24:46 +00:00
Chih-Hung Hsieh
75f2e70dff Add default -Werror to system/vold/tests.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I730943ace4aa329459d6280d1c2be601f7383343
2017-12-11 23:21:57 +00:00
Chih-hung Hsieh
44c235d4d7 Merge "Add default -Werror to cts." 2017-12-11 23:20:47 +00:00
Colin Cross
114db0a93f Merge "Split logtags implementations for cc and java" am: e304cc4575 am: b18d19f9ba
am: 40e8b3dc40

Change-Id: Iadaeec9973069815bb116be3b7f6e6180a8a9025
2017-12-08 16:43:42 +00:00
Chih-hung Hsieh
29499fcf68 Merge "Remove 6 directories from WarningAllowed*Projects." am: 4b9bb14dd2 am: fcf1e5795d
am: 611a50668f

Change-Id: If75baf84695522fefce8a4fde7e1a265575e6c02
2017-12-08 01:07:45 +00:00
Colin Cross
4c2977f8be Merge changes from topic "soong_dexpreopt" am: 9e094ebe1d am: ccb900af00
am: d0bc0dcb68

Change-Id: Ia0d14e27fc9dada7ca6777707d21fff86d4865ca
2017-12-08 01:05:43 +00:00
Colin Cross
5beccee92c Split logtags implementations for cc and java
Logtags files in cc and java are treated fundamentally differently.
In cc, they are not used for compiling at all, but need to be passed
to Make to be combined into the global logtags list, and logtag files
are listed in a logtags property.  In java they are listed in srcs
and produce generated code that is compiled in, and so shouldn't
also need to be listed in a logtags property.

Move the logtags property to cc and export it to Make from there,
and have java extract logtags files from srcs to be exported to
Make.

Test: m checkbuild
Change-Id: I31d49289efe72db60d2f33566df771b4a3ebc8a0
2017-12-07 15:32:30 -08:00
Chih-Hung Hsieh
2c07fc68fd Add default -Werror to cts.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I4900286f75c4f0ee17967085ed7012ddbe6024c9
2017-12-07 11:22:00 -08:00
Chih-hung Hsieh
4b9bb14dd2 Merge "Remove 6 directories from WarningAllowed*Projects." 2017-12-07 17:02:15 +00:00
Chih-Hung Hsieh
b47ac038e8 Remove 6 directories from WarningAllowed*Projects.
Test: normal build
Change-Id: I44381a2a7994d9f74329b0516d2bb303b5866a66
2017-12-07 00:12:35 +00:00
Colin Cross
7a6fcbe302 Run gofmt -w
Test: none
Change-Id: I2b503e06a4ae8e72a08f6bfb64692dfd33e2b7e2
2017-12-06 13:19:14 -08:00
Chih-Hung Hsieh
674f089a0a Allow warnings in libbufferhub. am: 809d3f8f63 am: 875e78c85e
am: 8cd2aee922

Change-Id: I18a67fb72e9f0f246718715c9b44ca9093b581b1
2017-12-06 02:29:51 +00:00
Chih-Hung Hsieh
809d3f8f63 Allow warnings in libbufferhub.
* This directory still has warnings.

Test: normal build
Change-Id: Ie322ebf38d828d63e9115308b8e71769fc2a452a
2017-12-05 16:51:22 -08:00
Chih-Hung Hsieh
f589d4e673 Reduce WarningAllowedProjects. am: 8ca48361ef am: 02c11fa130
am: 88b3e5ca83

Change-Id: Id4335e08e99c61ae7b64de9be31de95db6adccfa
2017-12-05 23:13:40 +00:00
Chih-Hung Hsieh
8ca48361ef Reduce WarningAllowedProjects.
* Warnings were fixed or suppressed in these projects.

Test: normal build
Change-Id: I24ef1b59d6c5ccd50979b7d792764de9d6da7e30
2017-12-05 09:12:35 -08:00
Justin Yun
3978135eea Install VNDK snapshot libraries for system build am: 7154928c93 am: 702a40d5cd
am: bc90006024

Change-Id: I4bbfc018d62fb67bdad7828fa8a2a2298d4b2369
2017-12-05 01:59:44 +00:00
Chih-Hung Hsieh
24d2de496a Merge "No need to dump modules added -Werror." am: 5760c9a12c am: 7197aaee21
am: 3cebffc7fc

Change-Id: Ibe19b02589765626fcb8b6f61180a85072b34149
2017-12-05 01:29:10 +00:00
Justin Yun
7154928c93 Install VNDK snapshot libraries for system build
When BOARD_VNDK_VERSION := <VNDK version>, or
PRODUCT_EXTRA_VNDK_VERSIONS includes the needed <VNDK version> list,
the prebuilt VNDK libs in prebuilts/vndk/ directory will be
installed.

Each prebuilt VNDK module uses "vndk_prebuilt_shared" for shared
VNDK/VNDK-SP libs.

Following is the sample configuration of a vndk snapshot module:
vndk_prebuilt_shared {
    name: "libfoo",
    version: "27",
    vendor_available: true,
    vndk: {
        enabled: true,
    },
    arch: {
        arm64: {
            srcs: ["arm/lib64/libfoo.so"],
        },
        arm: {
            srcs: ["arm/lib/libfoo.so"],
        },
    },
}

The Android.bp for the snapshot modules will be auto-generated by a
script.

Bug: 38304393
Bug: 65377115
Bug: 68123344
Test: set BOARD_VNDK_VERSION := 27
      copy a snapshot for v27
      build with make command

Change-Id: Ib93107530dbabb4a24583f4d6e4f0c513c9adfec
2017-12-05 10:19:43 +09:00
Chih-Hung Hsieh
fa0e27a1f3 No need to dump modules added -Werror.
* This reduces size of output file wall_werror.txt.
* Stop collecting SOONG_MODULES_ADDED_WERROR.

Bug: 66996870
Test: normal build
Change-Id: Ic6d87f6ee2b36b90ad0de4ac4f6f176334aba55e
2017-12-04 15:30:26 -08:00
Treehugger Robot
9c9540d008 Merge "Add system_$(VER)" 2017-12-01 04:19:45 +00:00
Dan Willemsen
0622caeff0 Merge "Add base variables for windows clang" am: d0704cf7fa am: 1ef719f19c
am: 07ec9e246e

Change-Id: Ia30f7f5cd450005e0cf0b1b8ee6fff7ef2906634
2017-12-01 03:01:52 +00:00
Sundong Ahn
0926fae350 Add system_$(VER)
The system_$(VER) is added for vendor, similar to sdk.

Bug: 67724799
Test: build
Merged-In: I2545c92707591ca278066870c74e9f49e9825855
Change-Id: I2545c92707591ca278066870c74e9f49e9825855
(cherry picked from commit b8baff1fa3)
2017-12-01 00:41:59 +00:00
Dan Willemsen
01f388c343 Add base variables for windows clang
This just copies most of what exists for clang on Linux, but doesn't
actually turn on clang support.

Bug: 69933068
Test: m nothing; compare ninja files
Change-Id: I2cf203026e7ced32004a91d7f3baf4a6415085eb
2017-11-30 15:42:53 -08:00
Dan Willemsen
213bcb7d6d Expose $(prefix)CLANG_SUPPORTED to make am: 7b6d9b956d am: 3f5e5a3714
am: 13df65138b

Change-Id: I86b1ec372b03ab145311a284f57150d74b3eec48
2017-11-30 08:20:20 +00:00
Dan Willemsen
7b6d9b956d Expose $(prefix)CLANG_SUPPORTED to make
So that we can switch clang on and off for windows from just Soong.

Bug: 69933068
Test: grep CLANG_SUPPORTED out/soong/make_vars-aosp_arm.mk
Change-Id: Ic304c1138ee2302c5733ef465bd462a0a25e949f
2017-11-30 05:08:32 +00:00
Sundong Ahn
b8baff1fa3 Add system_$(VER)
The system_$(VER) is added for vendor, similar to sdk.

Bug: 67724799
Test: build
Change-Id: I2545c92707591ca278066870c74e9f49e9825855
2017-11-30 13:23:10 +09:00
Colin Cross
da86065675 Merge changes Ic88be643,Ibe21efde am: 46029a4131 am: b3280409fd
am: caed993752

Change-Id: Ib97bc56eafc6f8e9305aeada1f208e588eb186da
2017-11-30 02:39:55 +00:00
Treehugger Robot
46029a4131 Merge changes Ic88be643,Ibe21efde
* changes:
  Replace ModuleContext.AConfig() with Config()
  Make *Context.Config return a Config instead of a interface{}
2017-11-30 02:21:30 +00:00
Chih-Hung Hsieh
90aee69ac6 Merge "Reduce WarningAllowedProjects." am: c92168f08d am: 9741b57ad8
am: 3365041fae

Change-Id: Ia26ecbbcf1a68c1648fce9f416eb11b508e328b0
2017-11-30 01:03:30 +00:00
Colin Cross
6510f91a1c Replace ModuleContext.AConfig() with Config()
AConfig() now duplicates Config().  Replace the uses of AConfig()
with Config().  Leave AConfig() for now until code in other
projects is cleaned up.

Test: m checkbuild
Change-Id: Ic88be643049d21dba45dbd1a65588ed94bf43bdc
2017-11-30 00:44:18 +00:00
Colin Cross
aabf67968c Make *Context.Config return a Config instead of a interface{}
In Soong, a Config() method will always return a Config.  Make
ModuleContext, SingletonContext, TopDownMutatorContext and
BottomUpMutatorContext's Config() methods explictly return
a Config to avoid having to type-assert everywhere.  Overriding
the Config method requires duplicating the list of methods in
blueprint.BaseModuleContext and blueprint.BottomUpMutatorContext,
following the same pattern used by the other *Contexts.

Config() obsoletes the AConfig() method used in some places, which
will be cleaned up in the next patch.

Test: m checkbuild
Change-Id: Ibe21efde933959811d52443496967ab8ce71215e
2017-11-30 00:44:11 +00:00
Chih-Hung Hsieh
0082636a14 Reduce WarningAllowedProjects.
* Warnings were fixed or suppressed in these projects.

Test: normal build
Change-Id: I5eec81704472c1675adf5fa784112c025f3c0222
2017-11-29 13:52:26 -08:00
Jeff Gaston
4aeb0e984a Merge "Sort cfi static libs to make them consistent" am: 5313911912 am: aa2476bd42
am: 62b9326663

Change-Id: I11ca05eb5dad3dff2ab95b4b44a252f2937dbe0d
2017-11-29 20:18:06 +00:00
Jeff Gaston
5313911912 Merge "Sort cfi static libs to make them consistent" 2017-11-29 19:58:38 +00:00
Colin Cross
22e8960a6d Wrap PackageContext and SingletonContext am: 0875c52de7 am: a0a0b7fd90
am: a0b69a22a9

Change-Id: I638dc4c80e2bd8a805bb92a23b5991b932bc0ab4
2017-11-29 05:25:41 +00:00
Colin Cross
0875c52de7 Wrap PackageContext and SingletonContext
Wrap blueprint.PackageContext so that the *Func methods can provide
an android.Config instead of an interface{}.  The modified signatures
means that every method in ModuleContext and SingletonContext
that takes a blueprint.PackageContext now needs to be wrapped to
take an android.PackageContext.

SingletonContext wasn't previously wrapped at all, but as long
as it is, wrap everything like ModuleContext does.  This requires
updating every Singleton to use the android-specific methods.

Test: builds, all Soong tests pass
Change-Id: I4f22085ebca7def6c5cde49e8210b59d994ba625
2017-11-29 05:04:30 +00:00
Jeff Gaston
7276539d6a Sort cfi static libs to make them consistent
To make it easier to diff the ninja files with diff_build_graphs.sh
Bug: b/69133815
Test: m -j

Change-Id: Ic08094f7dc3adb773ebb64a7d34125fc24641bf3
2017-11-28 16:39:12 -08:00
Elliott Hughes
6bf790f87e Merge "Skip MIPS headers when generating NDK prebuilts" am: f2a56f0e0d am: 29e5618645
am: b9d8d85787

Change-Id: I352df73da06ad4992ba25bbb74e9f0d9800b1634
2017-11-28 23:52:11 +00:00
Elliott Hughes
f2a56f0e0d Merge "Skip MIPS headers when generating NDK prebuilts" 2017-11-28 23:26:03 +00:00
Jayant Chowdhary
ecf16f9221 Merge "Copy abidiffs into /abidiffs on abi breakages." am: 3e6584556d am: eb11ca9596
am: c86d1850c7

Change-Id: I399e16e00ae818bf7e3245f829a6301fce4dd436
2017-11-28 23:00:06 +00:00
Jayant Chowdhary
3e6584556d Merge "Copy abidiffs into /abidiffs on abi breakages." 2017-11-28 22:38:32 +00:00
Jeff Gaston
e839a68736 Merge "Have Soong cc static linker dep order account for shared deps too" am: 5921ab3347 am: f93e082b68
am: d384cc7b9a

Change-Id: I39d1dac7c19cab41fd5918ad6c7751ff65979f19
2017-11-28 20:44:34 +00:00
Lazar Trsic
cdb710fed5 Skip MIPS headers when generating NDK prebuilts
When generating NDK prebuilts, skip installing MIPS headers, but keep
them when doing regular platform build. Ndk_abis property is only set
to true with build/soong/scripts/build-ndk-prebuilts.sh

Revert this once MIPS is supported in NDK again.

This effectively skips installing the following header modules when
creating NDK prebuilts:
- libc_asm_mips
- libc_asm_mips64

This fixes the issue introduced by commit:
050f046 Remove mips/mips64 headers from the NDK sysroot.

Test: build/soong/scripts/build-ndk-prebuilts.sh
Test: build aosp_mips[64]-eng

Change-Id: I3af73649bc8ac304bca0e21ec81f156abe546c90
Signed-off-by: Lazar Trsic <Lazar.Trsic@mips.com>
2017-11-28 15:07:16 +01:00
Jayant Chowdhary
219139df8c Copy abidiffs into /abidiffs on abi breakages.
Bug: 64267858

Test: create reference abi dump for libjpeg locally. Change return type
      of libjpeg_std_err and build with :
      BOARD_VNDK_VERSION=current mm -j64 showcommands dist
      Build fails and abidiff report gets copied into out/dist/abidiffs.

Change-Id: I7c8ecfac95361e731009e5913bd3a7bb323a9597
2017-11-27 17:16:29 -08:00
Jeff Gaston
f5b6e8f8c7 Have Soong cc static linker dep order account for shared deps too
Bug: b/69639803
Test: m -j nothing # which runs unit tests
Test: m -j checkbuild
Change-Id: I2eedfe8b88ec5c715ef729bf113d168a2bc3524d
2017-11-27 17:14:06 -08:00
Vishwath Mohan
07bea23f6b Merge "Reduce how often both mutated variants are needed." am: 5c986c3dc3 am: 24725d967b
am: bf7dbc748a

Change-Id: Ib553076a13d6a4581a0b92436644b2383dfc9fa5
2017-11-22 00:20:40 +00:00
Treehugger Robot
5c986c3dc3 Merge "Reduce how often both mutated variants are needed." 2017-11-22 00:05:30 +00:00
Pirama Arumuga Nainar
032939e376 Merge "Use -mcpu=cortex-a53 for devices with Kryo" am: 49b14daf03 am: 34fcefe690
am: 9a1483bfe6

Change-Id: Ie03c8344b712bf70cdac7c07bcda3c721fc58cb8
2017-11-21 22:19:39 +00:00
Vishwath Mohan
e712879d5d Reduce how often both mutated variants are needed.
This CL rolls back how often we bubble up both sanitized and
un-sanitized variants of a component. With this change only
CFI-enabled target static libraries will do this, all other cases
suppress one of the two variants (both from being installed and from
being exposed to Make for make-embedded builds).

This means we shouldn't need a separate sanitizer suffix for ASAN at
all (.asan), and similarly for non static-lib CFI components (.cfi),
so this CL changes that as well.

Lastly, because the version of ar meant for the host is not built
with plugin support (which CFI requires), this CL disables CFI for
host targets.

This CL should fix the following 2 issues:
(1) Removing warnings about multiple rules existing for the same
installable target.

(2) Fixing VTS packaging, which had been broken by the generation of
the .asan suffix.

Bug: 69172424, 69059192, 67507323
Test: m -j40 # Soong generated .mk file does not have duplicate rules.
Test: SANITIZE_TARGET="address" m -j40 libstagefright # installed
correctly.

Change-Id: Ib90fdbc8a6ad3924fc2a691b7277a8a1bc67cda8
2017-11-21 14:09:09 -08:00
Treehugger Robot
49b14daf03 Merge "Use -mcpu=cortex-a53 for devices with Kryo" 2017-11-21 22:05:44 +00:00
Chih-hung Hsieh
a48f9209eb Merge "Add default -Wall -Werror or -Wall." am: 488131912f am: 20cfee85b4
am: fc49581152

Change-Id: I4c1bbd4645a3a3dd378ebc890a9a5f0b5cab57bd
2017-11-21 21:30:57 +00:00
dimitry
2be7fa991c Ignore 'extern "C++"' section in a version script
This allows creating extern "C++" {} sections in version script in order
to export some of private platform symbols from NDK libraries.

Example for context: 3a11413a25/libs/nativewindow/include/private/android/AHardwareBufferHelpers.h

Bug: http://b/69603741
Test: make
Change-Id: I2f9e6678c0a6cd90113543e890786876d4c3e992
2017-11-21 20:31:48 +01:00
Pirama Arumuga Nainar
c17b275ed3 Use -mcpu=cortex-a53 for devices with Kryo
Bug: http://b/69481735

While Clang supports -mcpu=kryo, the GNU assembler doesn't.  Use
Cortex-a53 instead, which is close to Kryo.  The current alternative of
using Krait causes problems when also using armv8, which is not
available in Krait.

Test: Build marlin with internal CL 3248394 cherry-picked.
Change-Id: I571739e6ab4f1b37fafb304ecad2865c9394e04f
2017-11-21 09:35:42 -08:00
Chih-Hung Hsieh
64a38dcb18 Add default -Wall -Werror or -Wall.
* When -Wno-error and -Werror are not used:
  add -Wall to the front of cflags
  if the project is in the WarningAllowedProjects,
  otherwise add -Wall -Werror.
* Add -Wall -Werror to ndk_library build targets.
* Collect names of modules with -Wno-error or without -Werror,
  and pass them to makefile variables:
      SOONG_MODULES_USING_WNO_ERROR
      SOONG_MODULES_ADDED_WERROR
      SOONG_MODULES_ADDED_WALL
* Generate ANDROID_WARNING_ALLOWED_PROJECTS for old makefiles.

Bug: 66996870
Test: normal build
Change-Id: I31385e12b80ca946c7395a5a184ef259b029aac6
2017-11-20 18:28:26 -08:00
Colin Cross
e2a1c906f3 Merge "Revert "Set -fomit-frame-pointer for all devices"" am: ea7b201536 am: 8a4e6952f6
am: 1d58fbc8d9

Change-Id: I392bdf00fe21d43c08385e948aa593f600907b27
2017-11-18 02:19:20 +00:00
Treehugger Robot
ea7b201536 Merge "Revert "Set -fomit-frame-pointer for all devices"" 2017-11-18 02:13:08 +00:00
Colin Cross
bc2c7c26e1 Revert "Set -fomit-frame-pointer for all devices"
This reverts commit 20823f95e6.

Reason for revert: caused a minor performance regression in some benchmarks.

Bug: 69470341
Test: builds
Change-Id: I1a852b5d7a2aa1d08ecb54617898f814cddd7600
2017-11-18 00:11:21 +00:00
Colin Cross
09f673cc5a Add license headers to all go and shell files am: d00350c61b am: 12a6e4705e
am: f168cbcf20

Change-Id: I068e1a8c332e9f0fbc39887890a897aff14d4e27
2017-11-17 23:14:42 +00:00
Colin Cross
d00350c61b Add license headers to all go and shell files
Test: none
Change-Id: I75c443e05f2b1e17fcb6823182717d2e6f5df7c4
2017-11-17 23:05:26 +00:00
Colin Cross
2a7fd69293 Merge changes I0434b003,I1a1a01c5 am: fd9b570c5e am: 93d0b33f46
am: 66c39fa0ff

Change-Id: Ie8725548854eb183d7318cf45efbc2c4b6e25c40
2017-11-17 21:15:20 +00:00
Colin Cross
f18e11074d Fix using aidl files from filegroups
Compute sources including from filegroup and genrule dependencies
before determining if any sources will cause flags to be added.

Test: gen_test.go
Change-Id: I0434b003bbda07a58bb2ce1a0a72997918c8fae2
2017-11-17 11:22:08 -08:00
Colin Cross
ad59e75a56 Add cc_library tests
Add tests around reusing objects between static and shared
libraries.

Test: library_test.go
Change-Id: I1a1a01c5ea9f9edfbcaa5b29c39c281630e04f70
2017-11-17 11:22:04 -08:00
Colin Cross
5ed07bf6ec Set -fomit-frame-pointer for all devices am: 20823f95e6 am: c7155993ee
am: 255924d2a2

Change-Id: I74da5f76ff30b53c294aa7dd2cd66b27180ce222
2017-11-15 21:56:05 +00:00
Colin Cross
20823f95e6 Set -fomit-frame-pointer for all devices
-fomit-frame-pointer was only being set for arm and mips.  Since
we always use unwind tables and not frame pointers to unwind, and
since ART generated code does not use frame pointers, just turn
off frame pointers everywhere to gain an extra register.

Bug: 68951394
Test: m checkbuild
Change-Id: I9237d486a0c0215cdafd96d66712082df0eba785
2017-11-15 18:52:42 +00:00
Colin Cross
49ab9666ba Merge changes Iae2bda98,I68e64888,I75af16e7 am: d03553cf13 am: f053a45ad9
am: 59ec9ffe3c

Change-Id: I441f23f7de21754306ec7f387153ed81fb183021
2017-11-15 02:00:03 +00:00
Jiyong Park
46e61e26b2 Merge "Make cc.NewLLndkStubLibrary as public" am: 31c3239038 am: bd913486bf
am: 76681e64f7

Change-Id: I4d895c9a7f29f02d04835718ee1fa41ce780731e
2017-11-15 01:51:09 +00:00
Treehugger Robot
d03553cf13 Merge changes Iae2bda98,I68e64888,I75af16e7
* changes:
  Remove gcc-specific optimizations
  Move some flags to affect all devices
  Move -fvisibility-inlines-hidden to global device cppflags
2017-11-15 01:34:46 +00:00
Colin Cross
b37620f870 Remove gcc-specific optimizations
These flags were added for gcc, but are always stripped out when
compiling for clang.  Since gcc is barely used, removed them.

Bug: 68855788
Bug: 68947919
Test: m checkbuild
Change-Id: Iae2bda9808dd9499848ce145ccdf71c4c490b80e
2017-11-14 17:43:33 +00:00
Colin Cross
ea3141d06d Move some flags to affect all devices
Move -fdata-sections and -fno-short-enums to global device flags.
-fdata-sections was not previously set on x86[_64], -fno-short-enums
was not previously set on mips[64].

Bug: 68855788
Test: m checkbuild
Change-Id: I68e64888d5414fc022366eb2b6c5cd92c28a5542
2017-11-14 17:43:24 +00:00
Jiyong Park
64ca4b722a Make cc.NewLLndkStubLibrary as public
We need to extend llndk_library to automatically set symbol_file for the
llndk version of libclang_rt.asan* libraries.

Bug: 67011251
Test: build

Change-Id: Ib6964817759f9228456e4fb2a27fce3bc09423a9
2017-11-14 20:53:13 +09:00
Nan Zhang
b2bc27a53d Merge "Change remaining properties to *string, *bool in Soong." am: bafc47aea6 am: 0791bbf4ca
am: b84d38dc2e

Change-Id: Ic349292370b44b0ccc35b74e0af5e3d673458147
2017-11-14 11:31:49 +00:00
Pirama Arumuga Nainar
eaffec54ba Merge "Re-enable -Wunknown-warning-option" am: cc178b3e78 am: e25bbfdc04
am: e5d53e9cdf

Change-Id: Id4b71f0e0372987102e689653de9fefac21721d5
2017-11-14 11:22:38 +00:00
Colin Cross
26f14509d1 Move -fvisibility-inlines-hidden to global device cppflags
It was previously set on arm[64] and mips[64], this will cause it
to be set for x86[_64] too.

Bug: 68855788
Test: m checkbuild
Change-Id: I75af16e7d259963ad633cc664929144332bb435d
2017-11-13 15:18:19 -08:00
Treehugger Robot
bafc47aea6 Merge "Change remaining properties to *string, *bool in Soong." 2017-11-13 19:04:56 +00:00
Pirama Arumuga Nainar
4c0e1bf4e0 Re-enable -Wunknown-warning-option
Bug: http://b/68236396

This warning only needs to be enabled for frameworks/base/core/jni.

Test: Build the topic
Change-Id: I9f6aab2045f135d691696f9fd461c895a5aadb38
2017-11-10 13:54:47 -08:00
Nan Zhang
a5e7cb4eab Change remaining properties to *string, *bool in Soong.
Test: m -j checkbuild
Bug: b/68853585
Change-Id: I0fd10ff31e90c1941e80cfbf25e40e9988f1e202
2017-11-09 22:42:32 -08:00
Jeff Gaston
ce29f4ae9f Merge "Pass results of Finder into Blueprint" am: 99a5635733 am: 01452934fb
am: 8babc15d24

Change-Id: I6e6647ec2ab69a9c561f8582640dbec5671da635
2017-11-09 03:16:56 +00:00
Vishwath Mohan
4045457e65 CFI include/exclude path support (Soong) am: 1fa3ac552d am: fbfc32ea1b
am: 3caa24c44c

Change-Id: I25301cf069f730dcf32465cdb6dec7be65b3c9b7
2017-11-09 03:12:54 +00:00
Jeff Gaston
99a5635733 Merge "Pass results of Finder into Blueprint" 2017-11-09 03:07:36 +00:00
Vishwath Mohan
1fa3ac552d CFI include/exclude path support (Soong)
This CL adds the ability to centrally enable or disable CFI for
components using either an environment or product config
variable. This is a better, nore manageable option that enabling CFI
across each component individually.

Bug: 67507323
Test: CFI_INCLUDE_PATHS= system/nfc m -j40
Test: CFI_EXCLUDE_PATHS = frameworks/av m -j40

Change-Id: I38b77946759121aec99ab25f31aaee2e5d993f73
2017-11-08 18:56:10 -08:00
Jeff Gaston
d3e141de80 Pass results of Finder into Blueprint
Bug: 64363847
Test: m -j

Change-Id: I79db8c524af6e77c35a0199ec1876e5eb94e8971
2017-11-08 23:48:44 +00:00
Nan Zhang
be36215591 Merge "Change bool, and string properties to *bool, and *string for cc" am: c7b8e72c91 am: 33ced05309
am: e608086c05

Change-Id: I90f35c184fe0fd6dd46b3a11db664c2128512d39
2017-11-08 19:01:37 +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
Isaac Chen
e36b180f54 Generic 32-bit armv8 built as generic armv7 fix am: 2bce8edf34 am: 8fb28462e3
am: 8f5d5282e0

Change-Id: I2bf4294ae75c3f00a41bf6f0cc762bd4671ee88d
2017-11-08 04:34:28 +00: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
ee40f04b3c Merge changes Ie8ecb6c9,Ia9befd7c am: a632e9f4d2 am: 0ced97e7f1
am: 354b878e31

Change-Id: I8e548d8508bf5d0816f772f00103344df0ed1eb7
2017-11-06 23:25:50 +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
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
Pirama Arumuga Nainar
cc9206b313 Merge "Remove CFI-related WARs that seem no longer necessary" am: 9c7dcfd72c am: dae7f2b07b
am: 46695ac392

Change-Id: I718895793df2a93bbe86a3d8f6e1f4e8dfa6f49c
2017-11-06 20:39:40 +00:00
Treehugger Robot
9c7dcfd72c Merge "Remove CFI-related WARs that seem no longer necessary" 2017-11-06 20:28:23 +00:00
Colin Cross
3d2da75029 Merge changes from topic "crt_cflags" am: 5c9cf6eb84 am: 3568303af8
am: b916e0f4f9

Change-Id: I4871e64c0b3e611c0c72321218f15a2080a3742e
2017-11-06 19:07:43 +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
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
Steven Moreland
726652c007 Merge "Export test/benchmark factory symbols." am: 8eaca18c49 am: c09932274b
am: e7a2ee9c6e

Change-Id: I4a8e8cc49d379c5ed0a5fb29e44f9036073a21a6
2017-11-04 03:07:48 +00:00
Treehugger Robot
8eaca18c49 Merge "Export test/benchmark factory symbols." 2017-11-04 02:59:00 +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
578fa4a9a3 Export cc library factories. am: f9e621603b am: 9fa7f9ecc1
am: d33cce05f0

Change-Id: I8265c86087d3f75036f34c503e561bd4d96cf154
2017-11-03 02:04:38 +00: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
Vishwath Mohan
777109063f Merge "Don't install both variants for host or non-make builds." am: 845da14a35 am: 511ff4330f
am: d9f2552053

Change-Id: I275ca2f82b09ae8f390c95d0b463b63a9d174c23
2017-11-02 17:50:09 +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
d55c644e96 Merge "Convert abi warnings to errors." am: 7a709dae7a am: 4845af3d41
am: e3811588b5

Change-Id: Ie07e7ac7582794c47f2ce665fe3dabecfe91578c
2017-11-02 16:58:02 +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
Vishwath Mohan
4f34146713 Revert "Revert "Build system changes for CFI (Soong)"" am: b743e9c16a am: 39375fe131
am: 2f85998479

Change-Id: I66198384659259f34b79458d9d85b2861a310288
2017-11-01 23:17:00 +00: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
Orion Hodson
4e628dd1ba Revert "Build system changes for CFI (Soong)" am: 33c252c2f1 am: db9c663d66
am: c39c56f06b

Change-Id: If348f5e9091bd7ae80fca87d1761594f9c6bfbb5
2017-11-01 00:53:23 +00:00
Orion Hodson
754deece71 Revert "Hide mutated variant in non-make builds." am: da11d7422f am: 062d42f4e9
am: 86fee971ea

Change-Id: If9a453c59ec3e994b0f1ba0ea795d1e308eec904
2017-11-01 00:53:13 +00:00
Orion Hodson
33c252c2f1 Revert "Build system changes for CFI (Soong)"
This reverts commit d4b484b070.

Rationale: second in group of commits that left aosp_x86_64 not
building. (See https://android-build.googleplex.com/builds/
submitted/4426589/aosp_x86_64-eng/latest/logs/build_error.log)

Bug: 30227045
Test: builds
Change-Id: I38ab5284c614d6ee68e7359219bd75c7d50131be
2017-10-31 21:01:00 +00:00
Orion Hodson
da11d7422f Revert "Hide mutated variant in non-make builds."
This reverts commit 6147c6972a.

Rationale: first in group of commits that left aosp_x86_64 not
building. (See https://android-build.googleplex.com/builds/
submitted/4426589/aosp_x86_64-eng/latest/logs/build_error.log)

Bug: 30227045
Test: builds
Change-Id: I632869d13d09b43e2040da187d7ced4f05c332de
2017-10-31 20:47:44 +00:00
Vishwath Mohan
665f603423 Hide mutated variant in non-make builds. am: 6147c6972a am: 34cb708379
am: 2f84c65d3b

Change-Id: I7012d41646618418628e3f34c318bdff86f268fb
2017-10-31 12:10:28 +00:00
Vishwath Mohan
6147c6972a Hide mutated variant in non-make builds.
This CL hides (using Module.Properties.PreventInstall) either the
sanitized or stock variant for non-make embedded builds (based on
whether a sanitizer is enabled or not) so we don't have duplicate
rules for installing the same target.

Bug: 30227045
Test: OUT_DIR=out build/soong/scripts/build-ndk-prebuilts.sh # no
longer generates a duplicate build error.

Change-Id: I0b2dbb0afd5d426b32da67f951e2a4f9fbb3f3b9
2017-10-30 20:33:41 -07:00
Vishwath Mohan
89037dddd2 Merge "Build system changes for CFI (Soong)" am: 9ee01976fe am: 33af0d78bf
am: 7a8a392974

Change-Id: I6b560262ac999f461ace5fc62bd8ab0d5c890723
2017-10-31 02:04:42 +00:00
Vishwath Mohan
9ee01976fe Merge "Build system changes for CFI (Soong)" 2017-10-31 01:42:16 +00:00
Stephen Hines
62110067b7 Switch to clang-4393122. am: 0ed7d24f7a am: bc7ab77eb9
am: a3b8634ce3

Change-Id: I537685aa802ea64842b3416f25f7520b3f5a06d8
2017-10-30 20:06:47 +00:00
Stephen Hines
0ed7d24f7a Switch to clang-4393122.
Bug: http://b/62580008
Bug: http://b/68236239
Bug: http://b/68236396
Test: https://goto.google.com/clang-4393122-testing
Change-Id: Ib6bcf93e356172aad2a762b730a6f93916a5d845
2017-10-30 16:00:44 +00:00
Vishwath Mohan
d4b484b070 Build system changes for CFI (Soong)
This CL makes multiples changes in preparation for platform-wide CFI.

(a) Adds a second -version-script=... to the command line
when building components that use a version script. This ensures that
__cfi_check is also exported, and allows CFI to be enabled for these
components.

(b) Adds both topdown and bottom up mutators for CFI to help propagate
dependencies correctly for components that may need CFI disabled.

(c) Fixes an issue with the mutators to correctly apply settings to
both generated variants

(d) Fixes issues when components have more than a single visibility
flag.

Bug: 30227045
Test: SANITIZE_TARGET=cfi m -j40 # dependencies are correctly built
                                 # with/without CFI

Change-Id: I44793cc03bcbcdaa957cc49c7240b87d7c9db327
2017-10-30 01:42:31 -07:00
Jayant Chowdhary
cc793be92b Merge "Make clang libTooling tools ignore all lto flags." am: bdb04acd57 am: 4b26316680
am: a744ff6711

Change-Id: I9ba560a610d5341b10e9dece263e97e175082ab9
2017-10-27 21:01:39 +00:00
Treehugger Robot
bdb04acd57 Merge "Make clang libTooling tools ignore all lto flags." 2017-10-27 20:42:19 +00:00
Dan Albert
6227619e54 Merge "Add support for packaging static libs in the NDK." am: 3ae6d30804 am: 33196e13c3
am: 7998e52156

Change-Id: I1ba9584d7d081ff1bc70a9a152aa96368f3eaf6f
2017-10-27 18:38:28 +00:00
Jayant Chowdhary
20f5d137ed Make clang libTooling tools ignore all lto flags.
LLVM r275480 does not recognize flto flags, suppress the option in clang
libTooling tools for now.

Bug: 62839002

Test: mma

Change-Id: Ia9d80b46320e551a93dbff780405d8ff8ad73f35
2017-10-27 11:29:52 -07:00
Treehugger Robot
3ae6d30804 Merge "Add support for packaging static libs in the NDK." 2017-10-27 18:20:31 +00:00
Dan Albert
f563d25578 Add support for packaging static libs in the NDK.
Adding `static_ndk_lib: true` to a module installs the static library
to the NDK sysroot.

Test: Set property for libc.a, make ndk
Test: Set property for libc.a, scripts/build-ndk-prebuilts.sh
Bug: https://github.com/android-ndk/ndk/issues/272
Change-Id: Ib368a25705f2adb7129dac207c1b727d4ccc1eb2
2017-10-26 12:19:29 -07:00
Dan Willemsen
208506f373 Merge "Switch instruction_set to *string" am: b563989f97 am: 4f487cdd96
am: 9d2cb72bb8

Change-Id: I43a56b7dc30ff2b1a8441efec233cbeb35109ea2
2017-10-26 07:09:23 +00:00
Treehugger Robot
b563989f97 Merge "Switch instruction_set to *string" 2017-10-26 06:56:35 +00:00
Dan Willemsen
5922f3cb6e Switch instruction_set to *string
So that the contents gets replaced when prepended/appended instead of
merged.

Test: Set instruction_set in a cc_defaults, and in a module.
Change-Id: I0f2c789231d89efa1ab053f9dc118cd19f11b0e6
2017-10-25 15:20:50 -07:00
Jiyong Park
9e272b9f69 LLNDK can re-export headers am: 2a45412445 am: 939658c4a8
am: 4d7d02483e

Change-Id: Icfb55fd76d74752ce7a44c5d27fe213439f09ddd
2017-10-25 03:15:22 +00:00
Jiyong Park
2a45412445 LLNDK can re-export headers
Added export_llndk_headers properties to llndk_library module. And a new
module type llndk_headers is added. This is to enable an LLNDK library
to reexport other LLNDK headers.

Bug: 65395259
Test: do the following
// frameworks/native/libs/arect/Android.bp
llndk_headers {
    name: "libarect_vendor_headers",
    export_include_dirs: ["include"],
}

// frameworks/native/libs/nativewindow/Android.bp
llndk_library {
    name: "libnativewindow",
    ....
    export_llndk_headers: ["libarect_vendor_headers"],
}

check that
-Iframeworks/native/libs/arect/include is in LOCAL_EXPORT_CFLAGS of
libnativewindow.vendor in out/soong/Android-<product>.mk

Change-Id: If1650414b2967f2042f4ebe2b593ed3f3ea45d3a
2017-10-25 10:30:05 +09:00
Colin Cross
64e6cac877 Merge changes Id806633d,I05e945f3,Ieac84040,I18eb8cc0,If11c298e am: 17ae970a92 am: 70898c5f45
am: cee7bf36c3

Change-Id: I6316265003aec91f8e68c78785ca184ddf35c328
2017-10-24 21:36:45 +00:00
Colin Cross
d11fcda940 Convert Visit*Deps from blueprint.Module to android.Module
Also adds checks that the dependencies are android.Modules and
are not disabled.

Test: m checkbuild
Change-Id: I05e945f38915d49cd3c0ab72a86576949bc7eff2
2017-10-24 13:01:03 -07:00
Colin Cross
b671544973 Move first/last unique elements utility functions to android package
Move firstUniqueElements to android.FirstUniqueStrings,
lastUniqueElements to android.LastUniqueStrings, and lastUniquePaths
to android.LastUniquePaths.

Test: m checkbuild
Change-Id: Ieac840405126c7f8f98afb4a4ef35c01a18fe7fb
2017-10-24 12:12:32 -07:00
Colin Cross
ae88703df5 Move ModuleContext.ModuleBuild to ModuleContext.Build
Now that android.ModuleContext does not include blueprint.ModuleContext
we can rename android.ModuleContext.ModuleBuild to
android.ModuleContext.Build without colliding with
blueprint.ModuleContext.Build.  Leave ModuleBuild as a wrapper around
Build for now to avoid having to update all the users outside
build/soong simultaneously.

Test: m checkbuild
Change-Id: I18eb8cc04faf002049a11d9aac97e9732ff5d638
2017-10-24 10:59:00 -07:00
Jiyong Park
810f7c7293 Merge "Allow macro definition with space" am: d8cc795f86 am: f14986b8a6 am: 7fdca00c33
am: a771b248dd

Change-Id: I8f554c6388ccc1c9fc594320c24b770593fd5897
2017-10-22 07:49:04 +00:00
Treehugger Robot
d8cc795f86 Merge "Allow macro definition with space" 2017-10-22 07:38:51 +00:00
Colin Cross
477dc0ef34 Add $ORIGIN to rpath for host tests am: bd75e1d0bd am: 24d1ed50ac am: 0c10682d7e
am: 9dd0f4dc0b

Change-Id: I8f6a67ee0213ed57e38713bb608c1a73c120ffe5
2017-10-21 17:58:12 +00:00
Colin Cross
bd75e1d0bd Add $ORIGIN to rpath for host tests
Allow loading test libraries installed into the test directory.

Test: builds
Change-Id: I15a462ebd41b99e9eb76b5be889ed3bd013732e0
2017-10-21 16:04:14 +00:00
Yabin Cui
f6e7f03f88 Merge "Support tsan in Android.bp." am: ef784b537e am: 3e6e44e0e3 am: a02b5e6be2
am: 5936252d8d

Change-Id: Ib9b6226b53c4ec6d69de4934c40479390f424ee7
2017-10-20 18:21:58 +00:00
Yabin Cui
ef784b537e Merge "Support tsan in Android.bp." 2017-10-20 17:56:00 +00:00
Jiyong Park
0d2a24117b Merge "Add two more vendor-specific properties" am: fa9ff8441a am: 34f79d0edd am: 5cc211852a
am: 671505b62d

Change-Id: I68d56ce7a48c0e4e2e3ac8e7ca63d5a26001c8b4
2017-10-20 02:37:31 +00:00
Yabin Cui
6be405ef69 Support tsan in Android.bp.
Bug: http://b/25392375
Test: build a unit test with tsan.

Change-Id: Ifbd30e41e3a9558a8f106750c2a08778db5d5c81
2017-10-19 15:53:02 -07:00
Jiyong Park
d08b697828 Allow macro definition with space
cflags: ["-DMACRO=\" definition \""] should not be rejected.

Bug: 66914194
Test: TestCompilerFlags in cc_test.go

Change-Id: I7f96505a83898616415ef1fb7e13596b56a063f3
2017-10-19 22:39:32 +09:00
Jiyong Park
52d25bd812 Add two more vendor-specific properties
target.vendor.exclude_static_libs: this is the static counterpart of
target.vendor.exclude_shared_libs. This removes the libs from the static
dependency when build the vendor variant.

target.vendor.version_script: vendor-specific version script.

Right now, these are required to merge libseliux_vendor into libselinux
and make it vendor_avaialble:true. libselinux is using libpackageparser
which is a platform-only library. The vendor variant of libselinux can't
depend on the library.

Bug: 66914194
Test: lunch aosp_arm64_ab-userdebug; m libselinux.vendor

Change-Id: I163e634f2f54d419f9471a585a3b04731b63f809
2017-10-19 17:30:48 +09:00
Jeff Gaston
923e9dff62 Merge "Automatically reorder C/C++ link dependencies in Soong" am: 92d3dadf3b am: 3e8af0143a am: caa76581d0
am: a1e1cf38cc

Change-Id: Ibe8122f476c3f2e895298bbd21172075dc42b19f
2017-10-18 23:31:10 +00:00
Jeff Gaston
294356f045 Automatically reorder C/C++ link dependencies in Soong
This uses knowledge of transitive dependencies to reorder
linker command line arguments such that if module A depends
on module B, then module A is automatically listed before
module B in the linker command line.

This should mostly remove the need for Android.bp files to
list all of their static dependencies in link order

Bug: 66260943
Test: reorder the entries of static_libs in an Android.bp and see that linking still succeeds

Change-Id: I20f851ab9f2f30031254e4f30023b6140d15d6c3
2017-10-18 14:30:05 -07:00
Jeff Gaston
ec24f41b7a Some clarifications in preparation to automatically order linker dependencies am: af3cc2d23c am: f7ed978c87 am: ed0515a951
am: 2cc7443190

Change-Id: I6b85e23ed62fc5820241ea5b7e9d5567440f3377
2017-10-18 20:04:39 +00:00
Goran Jakovljevic
9a6ceb55c2 Merge "MIPS: Remove -U__unix and -U__unix__ from cflags" am: 16b9ce4dff am: d58c6031ed am: 8fc41212e2
am: 1796fabc88

Change-Id: If492fb50c308d2bb8bb8ce45478fbc02e9d1001c
2017-10-18 18:42:04 +00:00
Jeff Gaston
af3cc2d23c Some clarifications in preparation to automatically order linker dependencies
Test: Browse the code and determine whether it's easier to understand
Bug: 66260943
Change-Id: I88c24a8a31ef68f428919087d206433659265684
2017-10-18 18:06:02 +00:00
Goran Jakovljevic
68a321d92f MIPS: Remove -U__unix and -U__unix__ from cflags
Leave '__unix' and '__unix__' defined on mips/mips64, like arm.
This is needed to avoid a warning in external/libcxx project.

Test: successful build and boot aosp_mips-eng
Test: successful build and boot aosp_mips64-eng

Change-Id: I8f0e17bdbeffd5078c19aa7506564b8e79a9c945
2017-10-18 16:37:21 +02:00
Colin Cross
2ab89c3cd0 Merge "Explicitly document that export_include_dirs implies local_include_dirs" am: 63160240d8 am: 546a5af5a5 am: f7f633e299
am: ffb3720cc4

Change-Id: Ic3fc58854559ba59ca7c5abaff5f719a0d535257
2017-10-18 07:35:58 +00:00
Colin Cross
5d19560e5e Explicitly document that export_include_dirs implies local_include_dirs
Test: none
Change-Id: I601919447a5539c49350378d7422083f5a076bf7
2017-10-18 05:44:31 +00:00
Pirama Arumuga Nainar
5f1de0f704 Merge "Add enable_profile_use property" am: 0e8afed83a am: ba6593f5fa am: 4b5fab84eb
am: 062a825a08

Change-Id: I179ae252f43aeeebc61e440a1949222e2a3e8318
2017-10-17 04:07:46 +00:00
Pirama Arumuga Nainar
0e8afed83a Merge "Add enable_profile_use property" 2017-10-17 03:00:05 +00:00
Pirama Arumuga Nainar
6aeed8b439 Add enable_profile_use property
Bug: http://b/65598278

This property defaults to 'true' and setting it to false skips profile
use.  This escape hatch lets us disable PGO for a module without
completely removing the 'pgo' property.  Additionally, this also helps
selectively disabling PGO for some architectures, if desired.

Test: Test that -fprofile-use is not added for a test module if
'enable_profile_use: false' is set.

Change-Id: Ifcf1a48c194bc86efd88a529cc2d66a47b7ab080
2017-10-16 13:36:29 -07:00
Elliott Hughes
a92ecc9b36 Merge "Unified sysroot: arch-X/include directories are gone." am: 4d219e801d am: 3808a8c1a6 am: 394944459a
am: d5b4607533

Change-Id: Ibe8e592e76a0ad9203c57aa572e0e31407e4d308
2017-10-15 04:19:53 +00:00
Jiyong Park
5b5854b4ef Squash vendor sources before linkageMutator runs am: 6a43f04777 am: be4d89249a am: 7c7ce296ee
am: dcbdb9e18a

Change-Id: Iafccc06704367f933206d42ec419246675fc1dcf
2017-10-15 04:19:17 +00:00
Elliott Hughes
4d219e801d Merge "Unified sysroot: arch-X/include directories are gone." 2017-10-13 17:35:41 +00:00
Jiyong Park
6a43f04777 Squash vendor sources before linkageMutator runs
linkageMutator removes srcs property of the shared variant of a lib in
order to reuse *.o files compiled for the static variant also to the
shared variant.

However, this causes problem when vendor-specific srcs are specified in
target: {vendor: {srcs: ["..."]}}. For example, let's assume

cc_library {
    name: "libfoo",
    srcs: ["foo.c"],
    target: {
        vendor: {
            srcs: ["bar.c"],
        },
    },
}

Then,
static_vendor: inputs = foo.o, bar.o
shared_vendor: inputs = foo.o (from static_vendor), bar.o (from
static_vendor), bar.o

So, bar.o is included twice and this causes multiple symbol definition
error.

In order to handle the problem, vendor mutator is applied before the
linkage mutator and the vendor-specific srcs are squashed in the vendor
mutator.

Bug: 67731122
Test: build
Test: cc_test.go

Change-Id: I2a5390295dddfc41260e9b6f02746908cdf47228
2017-10-13 14:36:12 +09:00
Elliott Hughes
de28deb460 Unified sysroot: arch-X/include directories are gone.
Bug: N/A
Test: builds
Change-Id: I98fc6a1a3c0be1c90b1deb35b54f36ab16a202ac
2017-10-12 09:07:53 -07:00
Colin Cross
9624f6025e Merge "Let tests override environment" am: 432a2d4033 am: 786a19151b am: 6623676b08
am: 3e9df09d7c

Change-Id: I6b7126657130fa57c7cefb14121f90ae9392a3ba
2017-10-11 08:31:29 +00:00
Treehugger Robot
432a2d4033 Merge "Let tests override environment" 2017-10-11 08:18:17 +00:00
Colin Cross
6ccbc913e4 Let tests override environment
Pass an environment to TestConfig that will be used for
all Config.Getenv calls.

Test: none
Change-Id: I683cd9c9e0db61c9bfd2adb27fca78f558f225c4
2017-10-10 23:28:43 -07:00
Jiyong Park
fea11db35a Merge "vendor_available:false hides a lib from vendors" am: 7228a62297 am: b08d2636ef am: da14b3a0af
am: bd0f961c72

Change-Id: Ib9581e92c5b30dc43c52f221b1ec416ba2a56513
2017-10-11 02:06:20 +00:00
Treehugger Robot
7228a62297 Merge "vendor_available:false hides a lib from vendors" 2017-10-11 01:45:36 +00:00
Pirama Arumuga Nainar
fe2348fa21 Merge changes Ib23bad52,I1923ebde am: 3656beab20 am: c5a3ea48b5 am: 23fb908da4
am: 8cd5f8dbcd

Change-Id: I3fc9292b4872a75368bc99b9d18574d1b7692d58
2017-10-11 01:08:38 +00:00
Pirama Arumuga Nainar
0fdfc459cf Do not use profiles if ANDROID_PGO_NO_PROFILE_USE is set
Bug: http://b/65598278

Non-PGO builds (with this environment variable set) can be used to
measure the performance difference induced by PGO.

Test: Build PGO modules with ANDROID_PGO_PROFILE_USE set.
Change-Id: Ib23bad5208ac7f54894c7768d7532f53b6b91179
2017-10-10 15:41:25 -07:00
TreeHugger Robot
94595bd41b Merge "Change the directory scanned for PGO profiles" 2017-10-10 20:08:58 +00:00
Pirama Arumuga Nainar
f361d4a715 Change the directory scanned for PGO profiles
Bug: http://b/65598278

Test: None
Change-Id: I36cdb769a67831f0871dce67d33b1d0b52a81573
2017-10-10 11:13:31 -07:00
Pirama Arumuga Nainar
3f5bb9c89b Refactor methods to be on PgoProperties struct
These methods only need the 'PgoProperties' struct.  Avoid the extra
indirection by directly using this struct.

Test: Build modules with PGO property.
Change-Id: I1923ebde4b0d546810de8e696514d218b3a4f54b
2017-10-10 10:58:37 -07:00
Jiyong Park
82e2bf3b7f vendor_available:false hides a lib from vendors
When a lib is explicitly marked as `vendor_available: false`, then it
can't be directly depended by a vendor lib which is installed to /vendor
partition. This is to hide some VNDK libs (including llndk) from vendors
so that platform owners can have a freedom of modifying their ABI
without breaking vendors.

In addition, the list of the private libs are exported to the make world
as VNDK_PRIVATE_LIBRARIES.

Also, fixed a bug that allowed a vndk lib to link against to vendor
library (or vendor variant of a system lib) if the lib is prebuilt.

Bug: 64730695
Bug: 64994918
Test: Add `vendor_available: false` to libft2 and libcompiler_rt.
Add the libs to shared_libs property of a vendor library in soong
(i.e. libnbaio_mono). The build fails with the error message.

Change-Id: Iab575db96bb4f6739a592f3fa0a75124296bea0c
2017-10-10 19:38:06 +09:00
TreeHugger Robot
ba874a0328 Merge "Fixup location for jni.h automatic header include." 2017-10-09 22:51:19 +00:00
Steven Moreland
3afa3cd574 Fixup location for jni.h automatic header include.
include_deprecated -> include_jni

include_jni only includes jni.h. Other dependencies which
are provided as part of libnativehelper can be included
by using libnativehelper or by using them with in their
proper location (e.x. nativehelper/JNIHelp.h).

Bug: 63762847
Test: modules find their headers
Change-Id: I8674d2feed08bd80c1fc7b54e3ee38b9ee3484b2
2017-10-09 16:35:08 +00:00
Treehugger Robot
c7ba6a2e46 Merge "Use correct flags for host-side assembly" 2017-10-06 11:48:24 +00:00
Greg Hartman
09302bee38 Use correct flags for host-side assembly
BUG: 67434336
Test: Built libjpeg-turbo, confirmed flags
Change-Id: I54c1cc968d0a08d3a221ef4c46f2572269420c6a
2017-10-05 13:08:28 -07:00
Pirama Arumuga Nainar
6fc8d9126c Check if "instrumentation" and "sampling" are set together
Setting these simultaneously is an error.

Test: Check error generation in a test module

Change-Id: I2ee127fa1b7157fa5f4489d2541ff023c64f9ba5
2017-10-05 10:33:57 -07:00
Pirama Arumuga Nainar
49b53d5c7c Explicitly link the profile runtime during PGO
Bug: http://b/65598278

The profile runtime depends on libgcc for some symbols (only under some
circumstances - armv5, ndk r14, static executables).  Since Android
build passes -nostdlib and adds libgcc manually, the profile runtime
gets passed to the linker later than libgcc.

Instead, explicitly add the profile runtime to the linker command (and
pass one other flag added by the clang driver to the link).

Test: Build a library with profile instrumentation that otherwise fails
instrumented build.

Change-Id: I24b34cebd2c3bb6a540f8f4c465ace1be4eb90f3
Signed-off-by: Pirama Arumuga Nainar <pirama@google.com>
2017-10-04 22:25:19 -07:00
Jeff Gaston
60e38b613f Merge "Revert "Some clarifications in preparation to automatically order linker dependencies"" 2017-10-04 21:09:29 +00:00
Jeff Gaston
7b6118be6b Revert "Some clarifications in preparation to automatically order linker dependencies"
This reverts commit 2370af0e23.

Reason for revert: New Build Breakage: aosp-master/aosp_arm64_ab-userdebug @ 4376965

Change-Id: Ibe4b819c4292457c454bf42e6d94fba3071ec04b
2017-10-04 21:07:42 +00:00
Jeff Gaston
2ade0243ae Merge "Some clarifications in preparation to automatically order linker dependencies" 2017-10-04 17:45:40 +00:00
Pirama Arumuga Nainar
c144b86014 Merge "Pass -Wno-backend-plugin when using profiles" 2017-10-04 05:55:14 +00:00
Jeff Gaston
2370af0e23 Some clarifications in preparation to automatically order linker dependencies
Test: Browse the code and determine whether it's easier to understand
Bug: 66260943
Change-Id: Ia3fdb8f38e83ad8225a72c8de2804db23a90ef9b
2017-10-03 17:18:01 -07:00
Pirama Arumuga Nainar
f4c0baf317 Pass -Wno-backend-plugin when using profiles
Bug: http://b/63768402

Wno-backend-plugin warnings are generated by IR-based PGO when sources
evolve and the profiles become stale.  Disable these warnings when
profiles are passed to the compiler.

Test: Build a module with a PGO property when profiles are used.
Change-Id: I462bbf55aafd8770a90c2c23462bf71607ac9108
2017-10-03 14:35:18 -07:00
Colin Cross
6af17aa022 Add support for .proto files in java modules
Test: m -j checkbuild
Change-Id: Ia03429948baebff85164a91a34507866c97a08ef
2017-10-03 10:25:15 -07:00
Dan Willemsen
bd42549743 Don't use the platform copy of libz
We'll always provide our own.

Test: m nothing
Change-Id: I4749c0fc3ec0922e975fc5f60976bee964ed3d5e
2017-09-27 15:35:29 -07:00
Dan Willemsen
c2992232ca Merge "Add target.linux_glibc and target.bionic" 2017-09-27 22:03:02 +00:00
Dan Willemsen
866b563d4c Add target.linux_glibc and target.bionic
target.linux_glibc will apply to host builds with glibc, which is
identical to the current target.linux. In a future change, target.linux
will change to affect all targets using the Linux kernel (android,
linux_bionic, and linux_glibc).

target.bionic will apply to all OS variants using Bionic.

Bug: 31559095
Test: Add target.linux_glibc, target.bionic sections to an Android.bp, build
Test: m host
Change-Id: I677a67c22fba148fec264132311e355283f9d88d
2017-09-26 22:41:37 -07:00
Dan Willemsen
27991b7652 Add -lm to the default libs for Linux & Darwin
libm is a default library for device builds, so default it for host
builds as well.

Also removes duplicate additions of -ldl, -lpthread, -lm and -lrt.

Test: m host
Change-Id: I8f7e799d48a1f427e48dcfb1d0ccba93c5f9780b
2017-09-26 20:25:09 -07:00
Treehugger Robot
fdb573147e Merge "Add 10.13 Mac SDK to whitelist" 2017-09-26 00:37:55 +00:00
Dan Willemsen
652b383a3f Expose host AvailableLibraries to Make
Test: Check out/soong/make_vars-aosp_arm64_ab.mk
Change-Id: I8410942698f3c142b03a2e1e447c880184ab82bf
2017-09-25 22:00:41 +00:00
Nathan Harold
01abb0948b Add 10.13 Mac SDK to whitelist
Add the latest Mac SDK to the version
whitelist.

Test: compilation
Change-Id: I86fcbf2bb100a0af6a2cfea62f524a17ba1a67b9
2017-09-24 01:51:26 -07:00
Pirama Arumuga Nainar
ada83ec0a6 Add PGO support to soong
Bug: http://b/63768402
Bug: http://b/65598278

Add support for the 'pgo' property to specify how a module is processed
under PGO.  A sample property is below:

pgo: {
    instrumentation: true, // could be "sampling: true" when supported
    profile_file: "pgo_simple.profdata",
    benchmarks: ["pgo_simple"],
}

1. Runtime profiles can be gathered using "sampling" or
"instrumentation".  Sampling is not supported initially.

2. If 'toolchain/pgo-profiles' project is found,
'toolchain/pgo-profiles/${profile_file}' is passed to the compiler and
linker when building this module.

3. If ANDROID_PGO_INSTRUMENT environment variable is set, and includes a
benchmark in the 'benchmarks' list, appropriate flags (for e.g.
-fprofile-generate for instrumentation) are passed to the compiler and
linker when building this module.

Test: Add example modules that specify the pgo property and verify
appropriate flags and dependencies in the Ninja file.  Some
tests/examples are in https://android-review.googlesource.com/474805

Change-Id: I6242e0c904497a115e367dea6927ba1c4b906355
2017-09-21 12:37:19 -07:00
Dan Willemsen
c77a0b3f9c Extract the linker and embed it into host bionic binaries
The linux kernel requires that the ELF interpreter (runtime linker)
that's referenced by PT_INTERP be either an absolute path, or a relative
path from the current working directory. We'd prefer a relative path
from the binary, similarly to how we handle looking up shared libraries,
but that's not supported.

Instead, extract the load sections from the runtime linker ELF binary
and embed them into each host bionic binary, omitting the PT_INTERP
declaration. The kernel will treat it as a static binary, and we'll use
a special entry point (linker_wrapper) to fix up the arguments passed by
the kernel before jumping to the embedded linker. From the linker's
point of view, it looks like the kernel loaded the linker like normal.

Bug: 31559095
Test: Enable host bionic,
      out/soong/host/linux_bionic-x86/nativetest64/libdemangle_test/libdemangle_test
Change-Id: I8d0aea9790b5e86fcc3ea6e2d00cfa33907e2853
2017-09-20 15:34:33 -07:00
Dan Willemsen
efb1dd93bf Add prefix_symbols support to cc_object
Test: add cc_object with prefix_symbols, use objdump to check
Change-Id: I15eb47e6888eb1c4837734a44a7ad86205a48c02
2017-09-20 13:16:13 -07:00
Dan Willemsen
38394b962f Fix ToolchainClangCflags for host bionic
Move these flags from the normal flags to the toolchain flags, since we
want them to always apply.

Test: Add #ifdef __ANDROID__ to crtbegin.c, check to see if it's set for host bionic
Change-Id: I382dd229e3e4a889bc916f6f8e1248c7debb8fad
2017-09-20 13:16:13 -07:00
Dan Willemsen
6f91fbff76 Don't add a rpath to the linker
It doesn't need one, and doesn't handle it well either (it tries
allocating memory before the memory allocators are initialized).

Test: out/soong/host/linux_bionic-x86/bin/linker64
Change-Id: Ic4f75e8914093f13f28d53cf771f518f2b4e5d2e
2017-09-20 13:16:13 -07:00
Dan Willemsen
3e5bdf29ba Add cc_genrule
cc_genrule is the same as a normal genrule, but can depend on other cc
modules (like cc_object).

Test: mmma external/minijail
Change-Id: I8df87665c7bdc76ce89c92755c054f967a818e57
2017-09-18 23:33:25 -07:00
Dan Willemsen
0c16293821 Allow cc_object to use libc headers under the VNDK
Bionic headers aren't implicit when building with the VNDK, they're
exported from libc. So add libc to the shared libraries of a cc_object
if it wants the standard flags.

Removes a duplicate No_default_compiler_flags

Test: Add cc_object with vendor_available, build on aosp_arm64_ab (VNDK-enabled)
Change-Id: I9bfcd1e1a65de4edc597bd348b79d625ecae4f5e
2017-09-18 16:51:35 -07:00
Dan Willemsen
15d54d5551 Make test_suites arch_variant
In most cases, we don't care about arm vs x86 when selecting whether a
module is in a test suite or not, but we do care about whether we need
to add the host or device module(s) to the suite. So enable the arch
mutator.

Test: Add android-specific test_suites property, look in out/soong/Android.mk
Change-Id: I1e258d6e97e18c8d20297568cd8ee8d4161d5023
2017-09-18 16:51:35 -07:00
Dan Willemsen
d6ba0d592c Use dependency tags for genrules
So that we don't get confused when using :<module> in srcs to depend on
a module that could also be a HostBinTool.

Test: m -j
Change-Id: Ia3b1c26826e70f84c6dc5ff78c95dd11d76901b6
2017-09-14 22:59:33 +00:00
Yi Kong
2f7a367e7c Merge "Add support for thin LTO" 2017-09-13 05:07:36 +00:00
Jayant Chowdhary
a4fce191ba Dump abi for vendor variants of VNDK libraries.
Currently, abi is dumped for platform variants of system libraries.
Dump them for vendor variants since they are the ones which need to be abi
stable on security updates. This also ties abi dumping to BOARD_VNDK_VERSION.

Test: For libfoo:
	1) Added a source file with a dummy function for the core
	   variant.
	2) Excluded the source file from the vendor variant.
	3) BOARD_VNDK_VERSION=current mm -j64 produces libfoo.so.lsdump with no
	   dummy_function since the source file was not included in the vendor
	   variant.

Test: Inspected build.ninja and confirmed that all of a library's abi
dump dependencies (.sdump files are dependencies of the final .lsdump files) are
from vendor variants.

Change-Id: Ie0bf91fcd81606c131845d9872261166b5db72aa
2017-09-11 17:36:46 -07:00
Colin Cross
38f794ee49 Refactor proto in preparation for java proto support
Test: m -j checkbuild
Change-Id: Idf00ea0bacb2777458f9af2c7eb47e1e1854eeba
2017-09-11 12:41:58 -07:00
Dan Willemsen
b18cf7a5a0 Add windows libraries used by mdnsresponder
Test: Check for presence in prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8
Change-Id: Iaa0b56ca8ff94ebcd925238f211d9bd5d52a4a0c
2017-09-09 13:06:25 -07:00
Dan Willemsen
4f1c3d4116 Add support for Windows Message Compiler
We've only got one user of this currently, but since it needs the
location of the toolchain, and different flags based on 32 vs 64-bit,
it's easier just to add support than to get this into a genrule.

Test: Convert external/mdnsresponder to Soong, build
Change-Id: I6c19a82bc14f6ab556f6cc5f37164862ba5f9083
2017-09-09 13:06:25 -07:00
Treehugger Robot
ace7a6ba43 Merge "Make -ldl -lrt -lpthread implicit for host builds" 2017-09-09 01:32:23 +00:00
Colin Cross
c5fdbb842a Make -ldl -lrt -lpthread implicit for host builds
Instead of requiring every host module to specify -ldl -lrt -lpthread
and then break the mac build because -lrt doesn't exist, make them
implicit to match the behavior of modules built for the device.

Test: m -j checkbuild
Change-Id: I63c26adef71e71d314b9c9caa31c1aeb1d8f6651
2017-09-08 16:39:05 -07:00
Colin Cross
28690e9c74 Move benchmarks to /data/benchmarktest[64] to match make
Port Ife0f43062e36ffc856f41683ddc4d91a7787333e to soong.

Test: m -j checkbuild
Change-Id: I66a0a53061b547e30aedd16ee617723197069171
2017-09-08 16:32:16 -07:00
Nan Zhang
d4e641b6e9 <Hermetic> Replace Soong Python bootstrap process with embedded
launcher.

For Python2, we bundle embedded launcher as bootstrapper within every
.par file. This feature is only enabled for linux_x86_64 for now. We
provide a user flag: hermetic_enabled within bp file. By default, Pyhon2
still use classic bootstrapping way to construct .par file and relys on
host interpreter. Once embedded_launcher is enabled, launcher will be
used to bootstrap .par file and execute user program.

For Python3, the launcher will be ready soon, and for now it still relys
on classic bootstrapping.

Test: Real example is used to test.

Bug: b/63018041

Change-Id: I28deba413d8ad3af407595e46f77d663e79a3705
2017-09-05 17:26:57 -07:00
Yi Kong
244bf079f9 Add support for thin LTO
ThinLTO achieves comparable performance to full LTO while taking much
less time for compilation.

Test: Build hwui with "thin" and "full" LTO
Change-Id: If3400b82af0d5e0226410c8b740999cdad746a59
2017-09-01 14:21:44 +08:00
Colin Cross
5c51792926 Make binaries executable
Split InstallFileName into InstallExecutable that does chmod +x
after copying the file.  Also remove InstallFile and rename
InstallFileName to InstallFile.

Test: m -j checkbuild
Change-Id: Id41ad4eafe521f6cd5d8cc250b7747ecb3da8dfc
2017-08-31 13:48:52 -07:00
Treehugger Robot
25393ebcc4 Merge "Remove more duplicated flags and dependencies" 2017-08-29 22:38:57 +00:00
Dan Willemsen
fe92c968b9 Remove more duplicated flags and dependencies
All the stats below are for a hikey960-eng build on AOSP master.

Number of order-only inputs in out/soong/build.ninja:
Before: 2847162
After:   606508

Size of:                       Before  After
out/soong/build.ninja          572MB   233MB  -59%
out/soong/Android-hikey960.mk   15MB     9MB  -40%
out/build-hikey960.ninja       367MB   358MB   -2%

Ninja time in `m nothing`:
Before: 6.9s
After:  5.0s

Soong generation time:
Before: 11.6s
After:   6.6s

Test: m nothing
Test: wrote script that counted inputs, only duplicates were removed
Test: treehugger
Change-Id: I6b7c5ef5b1395014b7bf5fd0b8112d42bee127bf
2017-08-29 13:39:46 -07:00
dimitry
feda20b947 Support version_script for cc_binaries
Bug: http://b/65151367
Test: make
Change-Id: Ib9b2da45e3c748eeafa792dfd0447b756855f6ef
2017-08-29 15:00:01 +02:00
Jayant Chowdhary
ec5b3aa567 Merge "Allow apis from exported shared library headers as well, while dumping abi." 2017-08-25 16:50:32 +00:00
Isaac Chen
cd3d542187 Merge "Revert "Revert "Build support for 32-bit armv8-a""" 2017-08-25 01:55:56 +00:00
Jayant Chowdhary
af6eb71ad2 Allow apis from exported shared library headers as well, while dumping abi.
header-abi-diff has switched to recursive diffing of types and can
diff more accurately if types included in re-exported shared library
headers are included as well.

Bug: 62060883

Test: make -j64, android.hardware.light@2.0.so.lsdump contains structs
from libcutils as well (libcutils' headers are re-exported by
android.hardware.light@2.0)

Change-Id: I814819e4f7258b4b380350fe8ad0ccf8dbd5ce5c
2017-08-24 16:48:25 -07:00
Zach Riggle
06bbd89c16 Enhance coverage options to include those needed by Honggfuzz for coverage-driven fuzzing
Test: make m
Bug: 64903541
Change-Id: Id5f10b6d7c122444f875134883f7c0a95d71e12d
2017-08-24 19:25:05 +00:00
Treehugger Robot
2e78e5e37f Merge "Add dependency support for yasm" 2017-08-24 18:02:18 +00:00
Isaac Chen
a2a582413e Revert "Revert "Build support for 32-bit armv8-a""
This reverts commit 80b27e4e20.

Fixed CTS build issue by adding -march=armv7-a in cts/tests/tests/os/jni/Android.mk since the library built here needs/uses instruction (swp) obsolete in ARMv8.

Bug: 64964151
Test: lunch aosp_arm64-userdebug; make -j cts
      lunch aosp_x86-userdebug; make -j cts
      lunch aosp_sailfish-userdebug; make -j cts
      lunch aosp_bullhead-userdebug; make -j cts

Change-Id: I6ccafce043e101c769ad370a81ffa0eb62719b5e
2017-08-23 10:57:17 +00:00
Dan Willemsen
1d3e545a97 Add dependency support for yasm
Bug: 37719672
Test: lunch aosp_x86-eng; m native
Test: m out/soong/.intermediates/external/libvpx/libvpx/android_x86_static_core/obj/external/libvpx/libvpx/vp8/common/x86/copy_sse2.o
Test: NINJA_ARGS="-t deps out/soong/.intermediates/external/libvpx/libvpx/android_x87_static_core/obj/external/libvpx/libvpx/vp8/common/x86/copy_sse2.o" m
Change-Id: I01763b5870f994f7f0c6ac9d10f112f73addd7c7
2017-08-22 21:02:08 -07:00
Colin Cross
ef88ae2369 Make libdl.so be loaded after libc.so
Make sure that libdl is always after libc on the command line.
Simplifies the logic to always support system_shared_libs for
sdk and vndk builds.

For backwards compatibility without updating lots of Android.bp
files, allow libdl to be listed in shared_libs as long as it
is also in system_shared_libs or libc is not in system_shared_libs.

Remove all the places that libdl is added as a dependency, since
it will always be present unless explicitly removed now.

Bug: 62815515
Test: m -j checkbuild
Change-Id: I0233178ffea87a2f0b82190746022476304a68e2
2017-08-23 12:54:54 +09:00
Tobias Thierer
9dffe1d807 Merge "Revert "Build support for 32-bit armv8-a"" 2017-08-22 10:30:29 +00:00
Tobias Thierer
80b27e4e20 Revert "Build support for 32-bit armv8-a"
This reverts commit 9c02066b13.

Reason for revert: Broke the build for some targets (including marlin and angler).

$ make cts
build/core/combo/TARGET_linux-arm.mk:43: kryo is armv8-a.
build/core/combo/TARGET_linux-arm.mk:45: TARGET_2ND_ARCH_VARIANT, armv7-a-neon, ignored! Use armv8-a instead.
[...]
cts/tests/tests/os/jni/android_os_cts_CpuInstructions.cpp:88:20: error: instruction requires: armv7 or earlier
    asm volatile ( "swp r0, r0, [%0]" : "+r"(ptr) : : "r0" );
                   ^
<inline asm>:1:2: note: instantiated into assembly here
        swp r0, r0, [r1]
        ^

Change-Id: I3fa7ca74d88aedf6574855e988d35e341f6e5067
2017-08-21 15:03:26 +00:00
Isaac Chen
1c508b6c53 Merge "Build support for 32-bit armv8-a" 2017-08-19 06:10:56 +00:00
Isaac Chen
9c02066b13 Build support for 32-bit armv8-a
Add armv8-a as a valid/supported 32-bit arm architecture variant. If
some known armv8-a core, like cortex-a53, cortex-a73, etc. is specified
as TARGET(_2ND)_CPU_VARIANT, the associated TARGET(_2ND)_ARCH_VARIANT
will be treated as if armv8-a is specified.

Bug: 62895439
Test: "bionic-unit-tests-static --gtest_filter=*strlen*" on Nexus 4
      (armv7-krait), emulator (armv7), and sailfish (armv8-kryo).
      The test binary for the first 2 is built with armv7-a as its
      TARGET_ARCH_VARIANT; The test binary for the last is built with
      armv8-a as its TARGET_2ND_ARCH_VARIANT.
      TARGET(_2ND)_CPU_VARIANTs of both binaries are set to "generic".

Change-Id: I53bee2974346cf485b2da54cf7aad010b0425910
2017-08-18 19:46:38 +08:00
Treehugger Robot
fd697f4256 Merge "Expose the minimum supported SDK version to make." 2017-08-18 02:34:36 +00:00
Dan Albert
f5415d7cc6 Expose the minimum supported SDK version to make.
Right now this is hard coded in two places (here and in
core/binary.mk). Keep it in one place so it's easier to change.

Test: make checkbuild
Bug: None
Change-Id: I2a2c784d4c667b326f871e6144db92753c16c85f
2017-08-17 16:54:03 -07:00
Colin Cross
766efbc9e9 Keep vndk library lists sorted
soong_build was writing a different make_vars-*.mk on every run
because the lists of vndk libraries were not sorted, causing
kati to regenerate the ninja file.

Test: m -j nothing && rm out/soong/build.ninja && m -j nothing
Change-Id: If1ef51bad602d61a337ee6f62d4758d4123cb00d
2017-08-17 14:57:12 -07:00
Stephen Crane
f5b9b95f01 Work around LLVM bug where TLS not emulated in LTO mode
In LTO mode the backend constructs a target exclusively from command line flags,
without opportunity to accept code gen arguments from Clang. Clang does not
currently pass the -emulated-tls parameter for Android, even though it defaults
to emulated TLS for Android in non-LTO builds. Until this is fixed upstream, we
can explicitly specify that the LTO output for Android should use emulated TLS.

Test: build libandroid with LTO, verified that it uses __emutls_get_address
rather than __tls_get_addr.

Change-Id: I18acac41aac885fc6635fbd55f96ba7c845eb5e7
2017-08-15 13:18:11 -07:00
Stephen Crane
ba090d16c2 Add LTO support to soong
Enabling the lto property for a module builds that module and all static
dependencies with LTO.

LTO (link-time optimization) allows the compiler to optimize and
generate code for the entire module at link time, rather than
per-compilation unit. LTO is required for Clang CFI and other
whole-program optimization techniques. LTO also allows cross-compilation
unit optimizations that should result in faster and smaller code, at the
expense of additional compilation time.

Test: make -j12 libc with lto: true for libc

Change-Id: Ib8baefedf60e02701d44673a7c473e0845730101
2017-08-15 12:54:12 -07:00
Stephen Crane
b3c2154f2a Pass correct emulation string to gold
Gold recognizes a different set of emulation strings to specify targets
than the bfd linker accepts. Clang only passes bfd emulations to the
linker, so we need to override these with the versions accepted by gold
when using gold.

Gold normally picks up the correct target from the first ELF input file
if it cannot parse the emulation parameter. However when using LTO, all
objects may be bitcode files, which causes gold to rely on the passed
--oformat or -m parameter to determine the proper target. If gold cannot
parse the emulation string passed by clang, it fails to link.

Test: build LTO version of libc

Change-Id: I38e78bb912fd3cc5fb7b4a762284f50ddd4f3998
2017-08-15 12:54:12 -07:00
Jiyong Park
a622de8498 cflags for vendor variants
cflags that are only applied when building the vendor variant of a lib
is now supported. This will be particularily useful when existing macro
should be turned off for the vendor variant:

cflags: ["-DENABLE_FEATURE_X"],

target: {
    vendor: {
        cflags: ["-UENABLE_FEATURE_X"],
    },
},

Without this, the library author has to undef the macro inside the
source code using __ANDROID_VNDK__, which is not desired especially for
external projects.

Bug: 64514237
Test: BOARD_VNDK_VERSION=current m -j libsqlite libsqlite.vendor
Merged-In: Ib484b5b12e14ab776276a30ed2763dffadc9d642
Change-Id: Ib484b5b12e14ab776276a30ed2763dffadc9d642
(cherry picked from commit 1e7495d973)
2017-08-14 11:46:42 +09:00
Jiyong Park
7447228e64 a shared lib header is not exported to vendors if it is in exclude_shared_libs
Since a lib in exclude_shared_libs are not used for the vendor variant,
it should also be removed from the export_shared_lib_headers.

Bug: 62471389
Test: BOARD_VNDK_VERSION=current m -j libxml2.vendor successful
(libxml2 has libicuuc in both exported_shared_lib_headers and
exclude_shared_libs for the vendor variant)

Merged-In: Ic9ddbd7be3c76df563e428ba2409a03bd2e1e113
Change-Id: Ic9ddbd7be3c76df563e428ba2409a03bd2e1e113
2017-08-14 11:40:54 +09:00
Treehugger Robot
b8245ea839 Merge changes Id9717132,I3e3b7251,I021c7971,I8a117a86,Ia5196f1f, ...
* changes:
  Allow AndroidMkData.Custom handlers to extend normal values
  Remove error from AndroidMkDataProvider.AndroidMk
  Remove error from AndroidMkData.Custom
  Remove error from AndroidMkData.Extra
  Bring java support closer to current version of make
  Rename java_prebuilt_library to java_import
2017-08-12 01:11:59 +00:00
Colin Cross
0f86d186b1 Allow AndroidMkData.Custom handlers to extend normal values
Pass accumulated AndroidMkData to AndroidMkData.Custom handlers
and expose WriteAndroidMkData so that Custom handlers can write
out the normal make variables and then add their own.

Test: No change to out/soong/Android-aosp_sailfish.mk
Change-Id: Id9717132bbd6c5cf3af8596f3eaa9bbb05d98e40
2017-08-11 15:24:11 -07:00