Commit graph

1188 commits

Author SHA1 Message Date
Alex Light
bdfeb3e760 Mark the cortex-{a7,a53,a53.57} chips as supporting LPAE
Bug: 27340895
Bug: 27324856

Change-Id: Id3994c6d334c8bb673fc3849550f591136a8dd6a
2016-02-24 13:54:11 -08:00
Chih-Hung Hsieh
765c1ea6d7 Use newest clang static analyzers.
* When WITH_STATIC_ANALYZER is set and non-zero, and clang compiler is used,
  call new clang ccc-analyzer or c++-analyzer.
* Otherwise, if WITH_SYNTAX_CHECK is set and non-zero,
  call compiler with -fsyntax-only.
* Replace "--sysroot=path" with "--sysroot path", to work with ccc-analyzer.
* ccc-analyzer executes the original compilation command to generate
  object files before calling clang with --analyze to do static analysis.
* When clang is called with --analyze, macro __clang_analyzer__ is defined.

BUG: 13287788

Change-Id: I5edb25b52998d871385dd000778db2ce83224078
2016-02-11 16:43:51 -08:00
Neil Fuller
dcd446e1e9 Merge "Allow java targets to support 1.8 source / target" 2016-02-09 23:01:40 +00:00
Dan Willemsen
9ecbf83259 Add 64-bit windows cross-compiles
This is mostly the same as the existing 2ND_HOST / HOST_CROSS support.

The interesting thing I did here was make x86 the 'first' architecture,
and x86_64 the second. This way LOCAL_MULTILIB := first defaults to
32-bit windows modules.

  windows-x86/bin   <- defaults to 32-bit executables
  windows-x86/lib   <- 32-bit libraries, like before
  windows-x86/lib64 <- 64-bit libraries
  windows-x86/obj   <- 32-bit intermediates
  windows-x86/obj64 <- 64-bit intermediates

Then modules are registered with the names:

  host_cross_liblog    <- 32-bit, like before
  host_cross_liblog_64 <- 64-bit

Bug: 26957718
Change-Id: I9f119411acb43e973ec1e6bca3c1dc291c91556c
2016-02-05 16:33:18 -08:00
Neil Fuller
2428bfeb88 Allow java targets to support 1.8 source / target
This change enables build rules to specify:

LOCAL_JAVA_LANGUAGE_VERSION := 1.8

to enable -source 1.8 -target 1.8 for javac and
equivalent flags for Jack.

Bug: 26753820
(cherry-picked from commit cdfbe4a852)

Change-Id: I361c99dd599e7b4a041f02c9562e461da2b0502e
2016-02-03 17:08:39 +00:00
Stephen Hines
625e7159ff Switch to Vista instead of Win2K.
Bug: http://b/26524325
Bug: http://b/25282907

The latest Clang/LLVM requires Vista APIs in order to execute, so we
need to bump the minimum required Windows version for our host tools.

Change-Id: Ic1a760bc240060f5de39ce3a68484886021ff3d9
2016-01-12 17:56:47 -08:00
Elliott Hughes
03b7effb8d Merge "Enable -fstack-protector-strong for arm64." 2015-12-18 21:36:49 +00:00
Elliott Hughes
7fca8a373f Merge "Enable -fstack-protector-strong for arm." 2015-12-18 21:36:27 +00:00
Than McIntosh
2c3b926ab3 Re-enable gold linker for aarch64.
Turn back on ld.gold and W-l,--icf=safe for
aarch64, now that the prebuilt ld.gold has been updated
with support for reloc 311/312 (fixed upstream, see
https://sourceware.org/bugzilla/show_bug.cgi?id=19042)

Bug: 25642296
Bug: 26153840

Change-Id: Idceb357a48d9da4eec38ab8f2103245d500622ae
2015-12-15 09:27:19 -05:00
Elliott Hughes
09ba4c870d Turn on stack protector for mips64.
Go straight to -fstack-protector-strong, since it works to boot the emulator.

Change-Id: I2b65a0ab4426856ae05f66c1e294951e45bd72b6
2015-12-14 14:46:38 -08:00
Elliott Hughes
b9b89e9385 Turn on stack protector for mips.
Go straight to -fstack-protector-strong, since it works to boot the emulator.

Change-Id: Ie44abd869355d2163dec7d9e2635b26b45255df6
2015-12-14 14:15:12 -08:00
Elliott Hughes
02191c97ef Merge "Enable -fstack-protector-strong for x86-64." 2015-12-14 21:45:40 +00:00
Elliott Hughes
505e4ec646 Be smarter about stack-protector on the host.
Some projects are still built with our host GCC 4.8, which doesn't
support -fstack-protector-strong. The combo .mk files are used by
GCC and clang, so it's not safe to turn on -fstack-protector-strong
there. Instead, do it in the clang-specific .mk for now.

We can clean this up when elfutils (the last code built for the host
with GCC that I'm aware of) is built by clang. We'll be able to
remove the host GCC prebuilts too!

Change-Id: I314b9eab071c132a8e2cb8cc779a75ae8abb12e2
2015-12-14 13:20:59 -08:00
Elliott Hughes
7abad39b78 Merge "Enable -fstack-protector-strong for x86." 2015-12-14 21:05:21 +00:00
Elliott Hughes
2747fa8f87 Enable -fstack-protector-strong for arm64.
This results in nearly all functions with the possibility of stack
corruption getting stack canaries, because it applies to any function
taking a reference to the frame or with a local array rather than just
the functions with arrays larger than 8 bytes. It was developed for use
in Chrome (and Chrome OS) and has also been adopted by various other
distributions (Arch, Fedora, Ubuntu, etc).

The code size increase ranges from ~1.5% to ~2.5%, compared to ~0.3% to
~0.7% with the more conservative switch. The increase in the performance
loss is usually minimal. The overall size increase once everything other
than C and C++ code is taken into account is minimal, and it greatly
improves the mitigation of stack buffer overflow vulnerabilities.

https://lwn.net/Articles/584225/

Change-Id: I2fb7f0bfccbfa5d22ca8858309a133469edbc7b6
2015-12-14 11:18:24 -08:00
Elliott Hughes
c8cc919db5 Enable -fstack-protector-strong for arm.
This results in nearly all functions with the possibility of stack
corruption getting stack canaries, because it applies to any function
taking a reference to the frame or with a local array rather than just
the functions with arrays larger than 8 bytes. It was developed for use
in Chrome (and Chrome OS) and has also been adopted by various other
distributions (Arch, Fedora, Ubuntu, etc).

The code size increase ranges from ~1.5% to ~2.5%, compared to ~0.3% to
~0.7% with the more conservative switch. The increase in the performance
loss is usually minimal. The overall size increase once everything other
than C and C++ code is taken into account is minimal, and it greatly
improves the mitigation of stack buffer overflow vulnerabilities.

https://lwn.net/Articles/584225/

Change-Id: Iccc20852db8a5e4dd9792f9da6d5e325fc59b0a5
2015-12-14 11:17:08 -08:00
Elliott Hughes
5324c3c19f Enable -fstack-protector-strong for x86-64.
This results in nearly all functions with the possibility of stack
corruption getting stack canaries, because it applies to any function
taking a reference to the frame or with a local array rather than just
the functions with arrays larger than 8 bytes. It was developed for use
in Chrome (and Chrome OS) and has also been adopted by various other
distributions (Arch, Fedora, Ubuntu, etc).

The code size increase ranges from ~1.5% to ~2.5%, compared to ~0.3% to
~0.7% with the more conservative switch. The increase in the performance
loss is usually minimal. The overall size increase once everything other
than C and C++ code is taken into account is minimal, and it greatly
improves the mitigation of stack buffer overflow vulnerabilities.

https://lwn.net/Articles/584225/

Change-Id: I3ce7a73c5cf36eba5c74df37367f3d3475b0a4ed
2015-12-14 11:16:20 -08:00
Elliott Hughes
8ebc4d6aab Enable -fstack-protector-strong for x86.
This results in nearly all functions with the possibility of stack
corruption getting stack canaries, because it applies to any function
taking a reference to the frame or with a local array rather than just
the functions with arrays larger than 8 bytes. It was developed for use
in Chrome (and Chrome OS) and has also been adopted by various other
distributions (Arch, Fedora, Ubuntu, etc).

The code size increase ranges from ~1.5% to ~2.5%, compared to ~0.3% to
~0.7% with the more conservative switch. The increase in the performance
loss is usually minimal. The overall size increase once everything other
than C and C++ code is taken into account is minimal, and it greatly
improves the mitigation of stack buffer overflow vulnerabilities.

https://lwn.net/Articles/584225/

Change-Id: I55a9fdbf5777ccdeed9f2e9a23c73bb94ad7b646
2015-12-14 11:15:15 -08:00
Elliott Hughes
ae316d2d59 Enable -fstack-protector-strong for the host.
This results in nearly all functions with the possibility of stack
corruption getting stack canaries, because it applies to any function
taking a reference to the frame or with a local array rather than just
the functions with arrays larger than 8 bytes. It was developed for use
in Chrome (and Chrome OS) and has also been adopted by various other
distributions (Arch, Fedora, Ubuntu, etc).

The code size increase ranges from ~1.5% to ~2.5%, compared to ~0.3% to
~0.7% with the more conservative switch. The increase in the performance
loss is usually minimal. The overall size increase once everything other
than C and C++ code is taken into account is minimal, and it greatly
improves the mitigation of stack buffer overflow vulnerabilities.

https://lwn.net/Articles/584225/

Change-Id: I97a2187cebac64e3b9f22b691d4676b6da083ebd
2015-12-14 11:14:21 -08:00
Dan Willemsen
da9c00da5f Enforce linker version-scripts are valid
Currently, if a version script is passed to the linker (using
-Wl,--version-script,...), it is used to limit symbol visibility and
assign symbol versions. But if a symbol is listed in the version script
but is not present in the binary, no error or warning is given.

Pass -Wl,--no-undefined-version to the linker so that it verifies all
(non-wildcard, C) entries in the version script match symbols in the
binary.

Change-Id: I65878931ab61124ae75e2c738cc733adfb107afc
2015-12-02 19:19:04 -08:00
Elliott Hughes
cf1c15c975 Set WINVER as well as _WIN32_WINNT.
Change-Id: I6ace26d6c25549cf42755423340af07e96e05779
2015-11-12 13:33:20 -08:00
Chih-hung Hsieh
98c27a83da Merge "Revert "Enable gold linker for aarch64."" 2015-11-12 01:04:06 +00:00
Chih-hung Hsieh
65c7b5c6d6 Revert "Enable gold linker for aarch64."
This reverts commit a7f68ee9ea.

Change-Id: I8c15df8ce81859f1b950dbac0a47d7d24c0f4cc2
BUG: 25642296
2015-11-11 23:07:01 +00:00
Than McIntosh
838ad09b17 Merge "Enable gold linker for aarch64." 2015-11-05 11:49:56 +00:00
Than McIntosh
a7f68ee9ea Enable gold linker for aarch64.
[Second attempt, this time with updated mac prebuilt]

Switches default linker from -fuse-ld-bfd to
-fuse-ld=gold, and enables -Wl,--icf=safe. This
changes reduces /system/lib64/*.so text size
by about 2% for N9.

Change-Id: I587075aae9d70cb6b16e55dc9cd1052580ac2626
2015-11-04 19:34:50 -05:00
Shinichiro Hamaji
0e7587a9ea Use .KATI_RESTAT to reduce unnecessary rebuilds of binaries
When a shared object is rebuilt, all dependent libraries and
executables are rebuilt. Such rebuild is unnecessary when there
is no interface change. With this patch, .toc files will be
generated for all .so files. The rule which generates .toc files
has ninja's restat=1 and .toc files are not changed ninja won't
rebuild dependent targets.

Performance:

$ m && touch bionic/libc/stdio/stdio.c && time m
Before: 1m03s (2563 targets)
After: 21s (90 targets)

Bug: 24597504
Change-Id: Ia5dd950273d143f4e99eee8bef7478f1a94cd138
2015-11-04 15:23:59 +09:00
Dan Albert
e4256f5759 Revert "Enable gold linker for aarch64."
Causes build failures on Darwin.

prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/ld.gold: warning: cannot scan executable section 5 of out/target/product/flounder/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o for Cortex-A53 erratum because it has no mapping symbols.

prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/ld.gold: warning: cannot scan executable section 8 of out/target/product/flounder/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o for Cortex-A53 erratum because it has no mapping symbols.

prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/ld.gold: warning: cannot scan executable section 11 of out/target/product/flounder/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o for Cortex-A53 erratum because it has no mapping symbols.

prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/ld.gold: error: treating warnings as errors

This reverts commit 127d110172.

Change-Id: I1d3de90f5ae777b66a8f94fbcc9ccde8a9e3001c
2015-10-27 18:18:46 +00:00
Than McIntosh
127d110172 Enable gold linker for aarch64.
Switches default linker from -fuse-ld-bfd to
-fuse-ld=gold, and enables -Wl,--icf=safe. This
changes reduces /system/lib64/*.so text size
by about 2% for N9.

Change-Id: I0ef2483e1c47c34e63292dad6f6bf532359b733e
2015-10-22 09:44:48 -04:00
Ying Wang
16b1b0576c Allow to build against Mac OS X SDK 10.11.
Bug: 24739158
Change-Id: I7c57e141dd02a0d2de5a7a1ccbc72ffe422a8d6f
2015-10-13 18:00:45 -07:00
Colin Cross
d98fe91a75 am 6b02b76a: Merge "Fix gcc color diagnostics"
* commit '6b02b76ab9ebb5c21743abc5616379d19bc1c304':
  Fix gcc color diagnostics
2015-10-03 00:43:23 +00:00
Colin Cross
12adaf5cb9 Fix gcc color diagnostics
gcc color diagnostics stopped working when the flag was moved to
TARGET_GLOBAL_CFLAGS, as that gets overwritten by combo/select.mk.  Put
it back in COMMON_GLOBAL_CFLAGS, and then let the windows build filter
it out, similar to the way clang deals with unknown flags.

Change-Id: I2db221edb893d81f199494e7515d1b9282c12fae
2015-10-02 16:42:10 -07:00
Christopher Ferris
9937e7b2a3 am 76ec0c4c: Merge "Set mcpu targets based on cpu variant."
* commit '76ec0c4c53aab6fca7af1badab882518962a9755':
  Set mcpu targets based on cpu variant.
2015-09-25 16:35:56 +00:00
Christopher Ferris
76ec0c4c53 Merge "Set mcpu targets based on cpu variant." 2015-09-25 16:29:33 +00:00
Christopher Ferris
561b4c1995 Set mcpu targets based on cpu variant.
Make cortex-a53 and cortex-a53.a57 use cortex-a7.

Change-Id: I89d5b3f044c867ec99aae319eafc33f2edf1f9f2
2015-09-24 13:59:33 -07:00
Dan Willemsen
04df655192 am b6a3ede5: Merge "Remove trailing / for HOST_TOOLCHAIN_FOR_CLANG"
* commit 'b6a3ede5506bec89618519bf4a8adb635e570e89':
  Remove trailing / for HOST_TOOLCHAIN_FOR_CLANG
2015-09-24 02:20:38 +00:00
Dan Willemsen
c339398581 Remove trailing / for HOST_TOOLCHAIN_FOR_CLANG
The darwin version doesn't have a trailing slash. The common case is to
append a path to it:

  $(HOST_TOOLCHAIN_FOR_CLANG)/lib/...

Which means we end up with two slashes.

Change-Id: I74e88924ecfd092c5f7871e188ede0aab29cf65b
2015-09-23 23:46:44 +00:00
Christopher Ferris
2649e750b6 am 9bc462c1: Merge "Add the common directory back to kernel headers."
* commit '9bc462c12a5c4519b00e988b738c029c688c12d5':
  Add the common directory back to kernel headers.
2015-09-19 19:52:16 +00:00
Christopher Ferris
6a2f28514c Add the common directory back to kernel headers.
There will only be a very small set of non-uapi headers. This is
mostly being done for the scsi headers since the kernel has not
made uapi versions of all of them.

Change-Id: I44904b07ff96de918dc5fcab4e5f117a34cb2a87
2015-09-17 21:20:03 -07:00
Dan Willemsen
749e07c648 am c8db47a0: Merge "Don\'t build windows modules with clang, fix flags"
* commit 'c8db47a0213aa5c204c140cb9268389b4175ae06':
  Don't build windows modules with clang, fix flags
2015-09-09 23:25:11 +00:00
Dan Willemsen
7728817ab9 Don't build windows modules with clang, fix flags
shamu checkbuilds set USE_CLANG_PLATFORM_BUILD, which shouldn't apply to
modules built for windows. Also fix some flags that were being set
improperly.

Bug: 23566667
Change-Id: Id4c5b7cc59966328483d90f2b7be3f35e439ecee
2015-09-09 16:10:50 -07:00
Dan Willemsen
c98d9a9d0f am f1c09d7f: Merge "Add HOST_CROSS_OS"
* commit 'f1c09d7fbd92a08cc51950a7d35fb5f7fc564a20':
  Add HOST_CROSS_OS
2015-09-09 18:19:13 +00:00
Dan Willemsen
057aaea54a Add HOST_CROSS_OS
Instead of using recursive make to change the HOST_OS when building the
windows SDK under linux, add the concept of cross-building to another
host os.

Bug: 23566667
Change-Id: I6dc525b601b6251d458d197c30bf4660d7485502
2015-09-09 18:12:29 +00:00
Ying Wang
119cec9a4a am 4e2f1903: Merge "Clean up Javac a little bit."
* commit '4e2f190315759b4270ab414b9ff1e24a19521521':
  Clean up Javac a little bit.
2015-09-02 21:18:38 +00:00
Ying Wang
447d69678e Clean up Javac a little bit.
- Added GLOBAL_JAVAC_DEBUG_FLAGS and merge it to
  PRIVATE_JAVACFLAGS/PRIVATE_JACK_FLAGS to get rid of
  PRIVATE_JAVAC_DEBUG_FLAGS/PRIVATE_JACK_DEBUG_FLAGS.
- With Java rules out of base_rules.mk we can get rid
  of java_alternative_checked_module now.

Change-Id: I1a14716c785e3d49330a75044107662ce96a9307
2015-09-02 10:04:18 -07:00
Elliott Hughes
f04f391b5f am 4548e7f4: Merge "Remove AndroidConfig.h."
* commit '4548e7f49dbec05c8b8187b0ea9e746fc47ec5d3':
  Remove AndroidConfig.h.
2015-08-28 19:59:18 +00:00
Elliott Hughes
43146118aa Remove AndroidConfig.h.
This change leaves soong references.

Change-Id: Iee32b6b97ad9711f69e999c9d01f01d71562b63f
2015-08-28 10:31:28 -07:00
Elliott Hughes
dc289ce17c am 344c3394: am 6f534125: Merge "Fix Linux host checkbuilds."
* commit '344c33949b48ec5f3d27bff36f145f157156cf19':
  Fix Linux host checkbuilds.
2015-08-21 00:11:53 +00:00
Elliott Hughes
6f5341259c Merge "Fix Linux host checkbuilds." 2015-08-20 23:56:07 +00:00
Elliott Hughes
ac9eea9463 Fix Linux host checkbuilds.
Turns out that thanks to 9d59f41776 we actually
build *all* the host libraries both 32- and 64-bit. Rather than fix the
libraries (or fixing things so we don't build stuff we don't need) right now,
let's just put _FILE_OFFSET_BITS and _LARGEFILE_SOURCE back.

Change-Id: I6c2d6a6919d1518f775e0d6c050e2c774994c5bd
2015-08-20 16:52:47 -07:00
Elliott Hughes
158800c9ed am 30a18bca: am a3fa59b1: Merge "Kill host Linux AndroidConfig.h."
* commit '30a18bca6222065d15e1b18d71a29a8fb921d4a8':
  Kill host Linux AndroidConfig.h.
2015-08-20 23:20:21 +00:00