Commit graph

56 commits

Author SHA1 Message Date
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
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
Stephen Hines
4442c2f98e Switch to clang-3859424.
Bug: http://b/36442361
Test: Build and run multiple devices/targets.
Change-Id: Ib2ba71acdc5ae5100122bb498c5a51db74953d42
2017-03-28 22:10:38 -07:00
Treehugger Robot
9e3f627ea7 Merge "Export TSAN_RUNTIME_LIBRARY make variable" 2017-03-29 00:45:35 +00:00
Colin Cross
32b692240f Merge changes If05b0f5f,I8cd1ef21
* changes:
  Add support for test_suites property on cc_test modules
  Remove -Wl,--allow-shlib-undefined from arm64
2017-03-28 21:25:54 +00:00
Dan Willemsen
253cab89ee Fix absolute paths in clang debug output
As of the latest clang python wrapper, clang is being executed with an
absolute path. That means that clang-provided headers are written with
absolute paths in the debug info, making the builds non-reproducible
(especially with ccache).

So keep our current PWD=/proc/self/pwd -fdebug-prefix-map=/proc/self/cwd=,
but add a new -fdebug-prefix-map=$PWD/= to rewrite these absolute paths.

Bug: 36463318
Test: m -j libc adb; grep for path names
Test: spot check objdump -W before/after, see only expected diffs.
Change-Id: Ic2cdfca051d3c38b753fd5c1fcbeaca8bafc29ae
2017-03-27 16:58:43 -07:00
Pirama Arumuga Nainar
16b626b827 Export TSAN_RUNTIME_LIBRARY make variable
TSAN_RUNTIME_LIBRARY is used by external/clang/Android.mk to get the
name of the per-arch TSAN runtime.  This CL also factors-out common code
out of functions that construct names of the sanitizer libraries.

Test: python external/clang/build.py with all CLs in this topic

Change-Id: Ie5fac242c0d5a9296ab8936db927a4c934061aa4
2017-03-27 11:29:52 -07:00
Colin Cross
dc03a8407e Remove -Wl,--allow-shlib-undefined from arm64
Hopefully this isn't needed any more.

Test: m -j checkbuild
Change-Id: I8cd1ef21c37bb85a322674532b3cd6816280da67
2017-03-22 17:10:29 -07:00
Dan Willemsen
615609854f Revert "install *.so in different paths for their types"
This reverts commit 4c48f724e1. It's
causing test failures, warnings and complaints, so backing it out and
we'll resolve those before putting it back in.

Bug: 33681361
Test: m -j
2017-03-16 19:48:32 -07:00
Dan Willemsen
01a405a481 Add LinuxBionic toolchain and switch
This adds a toolchain definition for LinuxBionic that only supports
Clang/64-bit. It pulls pieces from the x86_linux_host and x86_64_device
configs, and uses the android clang triple, with some manual overrides.

To enable building this, set your soong.config file to:

 {"Host_bionic": true}

Bug: 31559095
Test: out/soong/{Android,make-vars}-aosp_arm64.mk the same with or
      without host bionic turned on
Test: No change to out/soong/build.ninja before/after this change
Change-Id: Id97dda8bd9aa670c32aed31fbe6aaa8175e70b59
2017-03-15 14:18:42 -07:00
Dan Willemsen
7752bca25d Enable large-address-aware for 32-bit windows
Bug: 36046324
Test: m -j winsdk-tools
Change-Id: I232d7dac9a6708542e70392801259141bec297c6
2017-03-14 13:37:26 -07:00
Jiyong Park
4c48f724e1 install *.so in different paths for their types
Shared libraries are now installed to different directories depending on
their types.

* NDK libraries: /system/lib/ndk
* VNDK libraries: /system/lib/vndk
* VNDK-ext libraries: /system/lib/vndk-ext
* Framework-only libraries: /system/lib
* Vendor-only libraries: /vendor/lib
* Same-process HALs: /vendor/lib/sameprocess

In addition, a new module type vndk_ext_library is added. It is almost
identical to cc_shared_library but it introduces another attribute
'extends'. This is use to reference the vndk library that this vndk-ext
library is extending.

For example, in order to extend a vndk library libFoo:

cc_library {
  name: "libFoo",
  srcs: [...]
}
---------------------
vndk_ext_library {
  name: "libFoo-extended",
  srcs: [...]
  extends: "libFoo"
}

Then, libFoo will be installed as /system/lib/vndk/libFoo.so and
libFoo-extended will be installed as /system/lib/vndk-ext/libFoo.so.
Note that file name of the latter is libFoo.so, not libFoo-extended.so:
file name of an extending module is automatically set to that of the
extended module.

Bug: 33681361
Test: build & run. Libraries must be in the correct directories.
Change-Id: Ia1eb3940605d582a252c78da0f3a5b36fdab062b
2017-03-14 09:13:44 +09:00
Dan Willemsen
300151ba19 Always use the standard OSX SDK tools
Instead of whatever happens to be in PATH.

Test: port install gcc5; attempt to build host binaries
Change-Id: If4af32596edd6fd3e459c3d574ab0ff495f236ff
2017-03-13 12:40:30 -07:00
Jayant Chowdhary
e622d20659 Add RenderScript toolchain information to soong.
Test: make -j64 from top of tree.

Change-Id: I9e853e64924f26719c0cd7ae8de4958fe97ca04e
2017-02-07 12:15:45 -08:00
Dan Albert
043833ca81 Add c_std and cpp_std properties.
Test: Checked showcommands ouput for each setting.
Bug: None
Change-Id: Ibe02352f19ca2777b9a419136270e5c4390f1149
2017-02-03 16:45:38 -08:00
Stephen Hines
d19f58a162 Switch to clang-3688880.
Bug: http://b/31532493
Test: Manual validation.
Change-Id: I386c7fc06bd4ca092535365bccbed0a898eb69da
2017-01-31 12:13:37 -08:00
Stephen Hines
73431cb86e Revert "Switch to clang-3625443."
This reverts commit 1d7513decd.

Reason for revert: <INSERT REASONING HERE>

Change-Id: Ida39c91bfc70ba60b2a3113544ec43c566b6c494
2017-01-26 07:59:16 +00:00
Stephen Hines
1d7513decd Switch to clang-3625443.
Bug: http://b/31532493
Test: Manual validation.
Change-Id: I9891e817342e45f16afa4acb57d2d136e16161a6
2017-01-23 15:05:27 -08:00
Colin Cross
35e3972068 Remove frameworks/base/include from the global include path
It is empty now.

Bug: 33630870
Test: m -j native
Change-Id: I8f41b56594241aced0f874af2fa73207b51ff8d6
2016-12-16 08:42:35 -08:00
Colin Cross
14e8dd73d0 Move frameworks/native/opengl/include from -isystem to -I
-isystem hides all warnings.  The warnings in
frameworks/native/opengl/include have been fixed, move it from
-isystem to -I.

Test: m -j native
Bug: 31751828

Change-Id: If182ab5664e22f0cfd5be8cb1d0309d07dc85ceb
2016-12-14 11:13:16 -08:00
Colin Cross
91e9004086 Support .asm files for assembly
Test: mmma -j external/libjpeg-turbo
Change-Id: Id192dae5d74ecbf500fc668931c37f9b91d25ca4
2016-12-02 21:12:30 -08:00
Dan Willemsen
d2ede879b5 Add basic VNDK support in Soong
Export a list of libraries in the VNDK, which is currently empty.

Take in Make's global BOARD_VNDK_VERSION, and use that as the SDK
version for modules that specify use_vndk: true.

Modules that use the vndk have some configuration as if they were
building against the NDK (the absence of globally defined headers), but
in other cases look like platform modules (using the platform libc++,
for now).

This change does not attempt to enforce any linking constraints, that
will come in a later patch.

Test: out/soong/build.ninja doesn't change
Change-Id: I3be206b67015ac5177b7eef4a451c579e3dc903f
2016-11-28 13:45:24 -08:00
Stephen Hines
9dfd48b9bc Merge "Add proper use of LLVM_RELEASE_VERSION for locating libraries." 2016-11-23 02:23:46 +00:00
Colin Cross
124fd9afbd Add more whitelisted host libraries
Add AppKit, Foundation and Security to darwin for libchrome.

Add -lm and -lversion to windows for llvm.

Test: m -j libLLVMObject
Change-Id: Ie5c922d3fbb41fba1de5f1ce9e530683bf411c5a
2016-11-22 15:41:04 -08:00
Stephen Hines
e55a4cc594 Add proper use of LLVM_RELEASE_VERSION for locating libraries.
Bug: http://b/31532493

As I have been updating to LLVM ~4.0, there are numerous locations where
3.8 is hard-coded, and unable to be overridden. This change adds a new
function for getting the ClangShortVersion(), which can look at
environment variables that override this value (particularly useful for
two-stage compilation, where version numbers change between builds).

Change-Id: Iaec19908cf47b3b2317844d6e1329f7bcd81f022
2016-11-18 17:12:38 -08:00
Dan Willemsen
2e47b34435 Add Toolchain.Bionic()
Move some cc ctx.Host() / ctx.Device() checks over to using
ctx.toolchain().Bionic(). There will be more changes, these are just the
obvious ones dealing with host_ldlibs / crt / system libraries.

Bug: 31559095
Test: out/soong/build.ninja is identical
Change-Id: Ibba60483b4ab0e01f6996eb7d883120e4acc1830
2016-11-17 01:50:43 -08:00
Colin Cross
328f04e778 Move more includes from -isystem to -I
-isystem hides all warnings.  There were no warnings in
hardware/libhardware_legacy/include, hardware/ril/include, or
libnativehelper/include, move them from -isystem to -I.

Test: m -j native
Bug: 31751828
Change-Id: I64cf08b6f6a7f2cfbb19f7d3cc2d2cc9f0157a38
2016-11-03 15:49:36 -07:00
Dan Willemsen
318af8be27 Allow overriding tidy configs using environment variables
This matches what Make did.

Bug: 32244182
Test: WITH_TIDY=1 m -j
Test: WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=* m -j
Test: WITH_TIDY=1 DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS=* m -j
Change-Id: I12ee413829d35e20f21f8ca49bb315ea831a6506
2016-11-02 15:47:20 -07:00
Dan Willemsen
a03cf6d322 Add clang-tidy support
For every file which we can run clang-tidy (C/C++ clang-built), we add a
new build node that depends on the object file (since clang-tidy does
not export a depfile), and is depended on by the link step. This is
better than how we're doing it in make, since calling tidy can be turned
on or off without needing to rebuild the object files.

This does not attempt to port WITH_TIDY_ONLY from Make, since the way
that it works is broken (due to the lack of a depfile).

Bug: 32244182
Test: WITH_TIDY=true mmma -j bionic/libc
Test: ./soong (Setting ClangTidy: true)
Change-Id: I40bbb5bb00d292d72bf1c293b93080b5f9f6d8ea
2016-10-31 16:21:01 -07:00
Dan Willemsen
85e3d0110f Remove support for building with OSX 10.8/9 SDKs
Our minimum build version listed on source.android.com is 10.10. Change
the minimum used SDK to 10.10, but keep the deployed version at 10.8 so
that our distributed tools still work on older versions.

CoreBluetooth/CoreBluetooth.h isn't available directly in older SDKs,
but we need to include it in the 10.12 SDK.

Test: `m -j` with 10.11, 10.12 SDKs.
Test: Verified the builders all have at least 10.10 sdk available.
Change-Id: I82321875b8b3a4099ea829ce2d75e1af29cb38c6
2016-10-28 13:57:34 -07:00
Treehugger Robot
0cca777715 Merge "Support MacOS SDK version 10.12" 2016-10-26 22:54:03 +00:00
Eyal Lezmy
94d7543b14 Support MacOS SDK version 10.12
This adds the new macOS SDK version to the supported version list.
Surprisingly it simply works like this.
Test: make adb aapt

Change-Id: Ic72cee7345b5f49b6a743c70bd266866a06bc459
2016-10-19 00:59:05 +02:00
Colin Cross
6f6a428760 Consolidate -std flags
Define the default -std values in global.go, export them in makevars.go,
and use them in compiler.go.

Test: builds
Change-Id: Ia2ae01f63e182d0ad7f371e6d32184bff35a8897
2016-10-18 12:40:51 -07:00
Elliott Hughes
5a0401ab9c Consistently use -std=gnu99 for gcc as well as clang.
This matters for C files that are also built for Windows. Previously they'd
be compiled with -std=gnu99 for the host but [effectively] -std=gnu89 for
Windows.

Bug: http://b/32019064
Test: builds, and can build libcrypto_utils without a manual -std= line
Change-Id: I9c5cc7832220b5c3d6a007ff10d076e26fd8c75d
2016-10-13 14:41:31 +00:00
Treehugger Robot
3f9bde87fb Merge "Move hardware/libhardware/include from -isystem to -I" 2016-10-09 01:05:31 +00:00
Treehugger Robot
44266e97f8 Merge "Move system/media/audio/include from -isystem to -I" 2016-10-07 20:40:54 +00:00
Colin Cross
2d44c2c716 Move hardware/libhardware/include from -isystem to -I
-isystem hides all warnings.  The warnings in hardware/libhardware/include
have been cleaned up, so move it from -isystem to -I.

Test: m -j
Bug: 32018017
Change-Id: I9a602d5e1bd021638d3a92d93af3d2a18ab4caa7
2016-10-07 11:40:04 -07:00
Colin Cross
1928093246 Move system/media/audio/include from -isystem to -I
-isystem hides all warnings.  The warnings in system/media/audio/include
have been cleaned up, so move it from -isystem to -I.

Test: m -j
Bug: 31997134
Change-Id: I1c0b68935d643992dd9fc7f76583bed286e49325
2016-10-07 11:39:58 -07:00
Josh Gao
15d523b933 Merge "Allow -lobjc and -framework IOKit in darwin host_ldlibs." 2016-10-06 23:59:58 +00:00
Colin Cross
315a6ffc99 Move frameworks/native/include from -isystem to -I
-isystem hides all warnings.  The warnings in frameworks/native/include
have been cleaned up, so move it from -isystem to -I.

Test: m -j checkbuild
Bug: 31752268
Change-Id: Ie3656348b5b2a1828dec790aa047635ac0fe6d86
2016-10-05 12:58:29 -07:00
Josh Gao
3923e84a49 Allow -lobjc and -framework IOKit in darwin host_ldlibs.
Bug: http://b/31321337
Test: mma of external/libusb on darwin
Change-Id: I1023a2a7ff1fdf809ac47104bca7b4171861abef
2016-09-29 14:47:47 -07:00
Stephen Hines
fdab996f64 Switch to using clang-3289846.
Bug: http://b/30252254
Test: Built/boot platform using latest prebuilts.
Change-Id: I47c5e8255f84b6f41d1d3e1f3c986e8699ac573a
2016-09-28 08:52:48 -07:00
Colin Cross
81b4ca6817 Revert "Revert "Move system/core/include from -isystem to -I""
This reverts commit 763a26cef5.

Bug: 31492149
Change-Id: I322f5e31da306951ac13131f5113730e945dedd5
2016-09-23 19:20:54 +00:00
Colin Cross
763a26cef5 Revert "Move system/core/include from -isystem to -I"
This reverts commit e4bba1e835.

Bug: 31492149
Change-Id: If46d240274f1a59ac36579157c575b54f2ffd58f
2016-09-23 15:50:14 +00:00
Colin Cross
e4bba1e835 Move system/core/include from -isystem to -I
-isystem hides all warnings.  The warnings in system/core/include have
been cleaned up, so move it from -isystem to -I.

Test: lunch aosp_angler-eng && m -j
Test: lunch aosp_bullhead-eng && m -j
Test: lunch aosp_flounder-eng && m -j
Test: lunch aosp_fugu-eng && m -j
Test: lunch aosp_shamu-eng && m -j
Bug: 31492149
Change-Id: I29967428c2c45f753dabe21b65913fb08fdcabc4
2016-09-22 15:29:50 -07:00
Kenny Root
b912349c03 Add pthread to Windows allowed ldlibs
The MinGW update now includes pthread.

Test: update BoringSSL to use pthreads on Windows and compile
Change-Id: Id85d9fd3e03a310e07e0093ca80cefaf10fe8930
2016-09-20 14:49:33 -07:00
Colin Cross
1cfd89aca3 Split CommonGlobalIncludes for system includes
Split CommonGlobalSystemIncludes out of CommonGlobalIncludes in
preparation for moving global includes from -isystem to -I.

Bug: 31492149
Change-Id: Ib935ea038cdbf9515dc2ab68d7fff924c370906a
2016-09-15 09:33:57 -07:00
Dan Willemsen
b1957a5021 Dynamically generate arch struct
Now we don't need to hardcode the list of OS/Arch/Variant/Features in
android/arch.go.

Change-Id: I0f9cc35d55baa31f036825fdf5b9dd30d076e56e
2016-09-08 13:50:36 -07:00
Treehugger Robot
ca06cc331d Merge "[mips] Disable compact branch generation" 2016-09-06 22:30:59 +00:00