Commit graph

8480 commits

Author SHA1 Message Date
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
Stephen Hines
eca3206abb Merge "Revert "Change USE_CLANG_PLATFORM_BUILD default to true."" 2015-12-13 23:06:03 +00:00
Stephen Hines
7a0c88ec3e Revert "Change USE_CLANG_PLATFORM_BUILD default to true."
This reverts commit 3c8036da53.

Change-Id: I930bbebce8396d7c0abd847530640a696d3418e7
2015-12-13 22:58:22 +00:00
Dan Albert
445bc2fc2d Use lib64 for mips64 as well.
This was previously working because for some reason prebuilts/ndk had
a tangled mess of hand assembled symlinks that pointed lib -> lib64
for the multilib architectures.

Change-Id: I294d67f58f2008b1a53790cf676f5223df449cbc
2015-12-11 15:04:59 -08:00
Dan Willemsen
e223965f0c Merge "Enforce linker version-scripts are valid" 2015-12-11 20:58:03 +00:00
Alex Klyubin
7884a63731 Merge "Make signapk use Conscrypt." 2015-12-11 18:29:36 +00:00
Chih-hung Hsieh
eb486309d8 Merge "Change USE_CLANG_PLATFORM_BUILD default to true." 2015-12-11 16:54:13 +00:00
Alex Klyubin
9667b18f23 Make signapk use Conscrypt.
This makes the signapk tool use Conscrypt (where possible) instead of
the platform-default JCA providers and the Bouncy Castle JCA provider.
This speeds up (by 10-30%) APK and OTA update signing because
Conscrypt's crypto primitives are backed by BoringSSL.

Previously, the signapk tool consisted only of the signapk.jar.
Because Conscrypt is backed by native code, signapk now consists of
signapk.jar and crypto_openjdk_jni shared library. This requires that
users of the tool be updated to provide a suitable -Djava.library.path
argument to the Java runtime. This change updates all known users of
the tool inside the Android source tree to do so.

Bug: 26097626
Change-Id: I8411b37d7f771ed99269751a3007dff103083552
2015-12-11 08:36:42 -08:00
Chih-Hung Hsieh
3c8036da53 Change USE_CLANG_PLATFORM_BUILD default to true.
When USE_CLANG_PLATFORM_BUILD is not set, default will be clang/llvm.
USE_CLANG_PLATFORM_BUILD=false can be used to select gcc as default.

BUG: 23163853
BUG: 26102335

Change-Id: I00604c2aef4849e8c3505b2c4002eb1c46cd1fd1
2015-12-10 14:41:55 -08:00
Alex Deymo
6950168f1d Merge "Rename libext2 host libraries to standard suffix." 2015-12-10 22:18:34 +00:00
Alex Deymo
41ac44ed2b Rename libext2 host libraries to standard suffix.
libext2_uuid_host was renamed to libext2_uuid-host to match the
"-host" suffix used in most libraries.

Bug: 24619596
TEST=make dist

Change-Id: Ic5faccb4d5fdbbf3d3bba6f4a35cf99d4961bb54
2015-12-09 18:02:56 -08:00
Dan Albert
8dca15f287 Fix the mips build.
The linker can't do --hash-style=gnu for mips.

Change-Id: I66a77067f8be6fc92ca686d3e6e159beb72cf76b
2015-12-09 16:26:20 -08:00
Dan Albert
2ad9079305 Merge "Add support for LOCAL_NDK_STL_VARIANT := none." 2015-12-10 00:17:23 +00:00
Dan Albert
0e2e71dc2e Add support for LOCAL_NDK_STL_VARIANT := none.
Sometimes we don't want any STL.

Change-Id: I08b4389b7882702c0e483a1456f7775fe4da1c75
2015-12-09 15:59:17 -08:00
Dan Albert
30cb36ff5e Merge "Build NDK binaries with --hash-style=both." 2015-12-09 23:41:01 +00:00
Dan Albert
ee629c9ffb Build NDK binaries with --hash-style=both.
Change-Id: I1c3b7415c654b783c6bb7e38a40d4c279826400f
2015-12-09 14:52:25 -08:00
Ying Wang
914a568ba0 Merge "Set -bootclasspath to "" if LOCAL_NO_STANDARD_LIBRARIES"
am: 616b8a5370

* commit '616b8a5370e6ad5cb8519fbe2c00eaa6637da260':
  Set -bootclasspath to "" if LOCAL_NO_STANDARD_LIBRARIES
2015-12-08 17:59:55 +00:00
Ying Wang
616b8a5370 Merge "Set -bootclasspath to "" if LOCAL_NO_STANDARD_LIBRARIES" 2015-12-08 17:56:05 +00:00
Elliott Hughes
fff2841298 Merge "Revert "enable -fstack-protector-strong""
am: 27ab42654e

* commit '27ab42654ebd5ffdc55bb6b727723e6980649ef9':
  Revert "enable -fstack-protector-strong"
2015-12-07 18:58:25 -08:00
Alex Klyubin
fddfc2c604 Merge "Do not run zipalign when building APK (except prebuilts)."
am: b437f58006

* commit 'b437f58006af3d8b15eb3308ab5174da1a7c6c0d':
  Do not run zipalign when building APK (except prebuilts).
2015-12-07 18:58:19 -08:00
Ying Wang
4f0cb0307b Merge "Fix TARGET_ASAN build."
am: 9bbc67b55a

* commit '9bbc67b55ac6876920b3ca5a73673d0a10c3fb52':
  Fix TARGET_ASAN build.
2015-12-07 18:58:12 -08:00
Elliott Hughes
27ab42654e Merge "Revert "enable -fstack-protector-strong"" 2015-12-08 02:54:01 +00:00
Elliott Hughes
b8c4a6f1f8 Revert "enable -fstack-protector-strong"
This reverts commit 8765b1035f.

This prevents x86 from booting.

http://b/26046864

Change-Id: Ica3f7e7e639c99fd3158df3643acb49307197881
2015-12-08 02:53:51 +00:00
Ying Wang
4f2f19518e Set -bootclasspath to "" if LOCAL_NO_STANDARD_LIBRARIES
Without this if a Java libraryw with LOCAL_NO_STANDARD_LIBRARIES doesn't
have core-libart in its LOCAL_JAVA_LIBRARIES, it would use core-libart
as bootclasspath but without having dependency on it.

Change-Id: I611a5a5df2bf0ad59e0be50ed1ad1afe8b843e90
(cherry-pick from commit c6a301756c)
2015-12-07 18:50:34 -08:00
Alex Klyubin
b437f58006 Merge "Do not run zipalign when building APK (except prebuilts)." 2015-12-07 22:08:14 +00:00
Ying Wang
03b6e8b6c4 Fix TARGET_ASAN build.
Bug: 26044735
Change-Id: I9c6b3b16637ca2d0da4765e896a9f03c1d5dc51c
2015-12-07 10:45:19 -08:00
Nick Kralevich
c5c2e60707 Merge "enable -fstack-protector-strong"
am: 2a49aba35b

* commit '2a49aba35b9b9216df1da245f1af13c6faa5a850':
  enable -fstack-protector-strong
2015-12-05 14:23:57 -08:00
Nick Kralevich
2a49aba35b Merge "enable -fstack-protector-strong" 2015-12-05 22:20:46 +00:00
Daniel Micay
8765b1035f enable -fstack-protector-strong
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: Ie83d381e09d94deb34c5ff142a101ba3d14cf3ba
2015-12-05 01:52:45 -05:00
Ying Wang
fe27825ca5 Merge "Gmake doesn\'t like newline in macro expansion result."
am: c7d5e54dfe

* commit 'c7d5e54dfe71766dc60adcf06e6ec1a2b12cdda9':
  Gmake doesn't like newline in macro expansion result.
2015-12-05 00:53:25 +00:00
Ying Wang
427f8c43aa Gmake doesn't like newline in macro expansion result.
When $(call func) in the makefile text expansion includes newline, gmake
reports error "missing separator". But it's fine if the expansion includes
only spaces. That's a bit odd.
This change fixes the "missing separator".

Change-Id: I094e5ae1725699ebfa4ed66544eef037dd68714c
2015-12-04 16:44:03 -08:00
Dan Willemsen
a4769d2956 Merge "Sanity check LOCAL_SRC_FILES_EXCLUDE"
am: cc3b2a5854

* commit 'cc3b2a58548832ab7a6620d6b607d315f06dfc06':
  Sanity check LOCAL_SRC_FILES_EXCLUDE
2015-12-04 15:17:58 -08:00
Alex Klyubin
5b826ac609 Do not run zipalign when building APK (except prebuilts).
This changes the build system to no longer run zipalign except for
those prebuilts which do not need to re-signed.

Running zipalign is no longer needed because signapk takes care of
alignment. For those prebuilts which do not need to be re-signed
signapk is not invoked and thus zipalign is still needed because the
prebuilts may not have been aligned properly. This exemption will go
away once prebuilts are properly aligned.

Bug: 25794543
Change-Id: I31f10af80b9baa3c9481cb36f41e5e5046e852f9
2015-12-04 10:15:06 -08:00
Dan Willemsen
c29172c333 Sanity check LOCAL_SRC_FILES_EXCLUDE
Error out if there is a file listed in LOCAL_SRC_FILES_EXCLUDE but not in
LOCAL_SRC_FILES. This should catch typos or other mistakes that would
otherwise be missed.

Change-Id: Iaddf575a6ce35238998ac47b59591a7d05fbcd0d
2015-12-03 22:58:39 -08:00
Colin Cross
b275dd1623 Merge "Remove extra definition of AIDL"
am: 77f411e116

* commit '77f411e116981ae1de9f060b128e4df0b2facd57':
  Remove extra definition of AIDL
2015-12-03 21:56:25 +00:00
Colin Cross
a8b896856a Remove extra definition of AIDL
AIDL is defined in the sometimes-prebuilt tools section, remove the
extra definition that was overriding it.

Change-Id: I677bf46475fd5fd4a9258c77d91ecee806e5f205
2015-12-03 13:33:11 -08:00
Colin Cross
8581e58b3b Merge "Use prebuilt tools in place"
am: 50e0646dbe

* commit '50e0646dbe1fb52918b38c75aefc49d24bfd9a24':
  Use prebuilt tools in place
2015-12-03 20:18:38 +00: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
Colin Cross
4e7bf63314 Merge "Provide path to mainDexClasses"
am: 62e99632c6

* commit '62e99632c61ef74fb04cf2bf6e079844e5dd8ae1':
  Provide path to mainDexClasses
2015-12-03 01:13:57 +00:00
Colin Cross
fd08247bcf Use prebuilt tools in place
Don't install the prebuilt SDK tools for TARGET_BUILD_APPS builds, just
execute them in place.  Avoids issues with duplicate rules for the
prebuilts and source modules when building with TARGET_BUILD_APPS in a
full platform tree.

Change-Id: I3cdb4f1a8208e8750310a5cc6130657613b683d1
2015-12-02 17:12:38 -08:00
Colin Cross
f87e971606 Provide path to mainDexClasses
Set MAINDEXCLASSES to the path to mainDexClasses.

Change-Id: I82532e8ea8dc7349178347e080fa0c63078ca9f5
2015-12-02 16:25:49 -08:00
Ying Wang
79215cdeab Merge "make USER limited to 6 characters when generating BF_BUILD_NUMBER"
am: 88ca8aff3e

* commit '88ca8aff3e4c6f776444ca8267b044b314f6aa0f':
  make USER limited to 6 characters when generating BF_BUILD_NUMBER
2015-12-02 17:53:17 +00:00
wei qiao
6fa82b50f4 make USER limited to 6 characters when generating BF_BUILD_NUMBER
the value of USER is dependent from the compilation environment,so
when compiling one same device project, the BUILD_FINGERPRINT may
exceed 91 characters because ${USER} is long, but with short ${USER}
the compilation can pass.

Signed-off-by: wei qiao <qiaowei224@gmail.com>
Change-Id: Ia0f7dfa9cf7d605f1f2603f70dd0e6877482eb8a
2015-12-02 11:47:27 +08:00
Tao Bao
e82ea963e8 Merge "Stop packaging obsolete OTA tools."
am: b98fa19703

* commit 'b98fa19703ed0c7608f926007b1df257127ea777':
  Stop packaging obsolete OTA tools.
2015-12-01 02:28:19 +00:00
Tao Bao
b98fa19703 Merge "Stop packaging obsolete OTA tools." 2015-12-01 02:25:02 +00:00
Colin Cross
b16a63cbb0 Merge "Make export_includes a restat rule"
am: 615d66e2c2

* commit '615d66e2c21603552dc952db9493f43bbcc7f2b1':
  Make export_includes a restat rule
2015-12-01 01:45:58 +00:00
Colin Cross
615d66e2c2 Merge "Make export_includes a restat rule" 2015-12-01 01:42:26 +00:00
Colin Cross
6b9bddde6f Make export_includes a restat rule
There is currently an intentional incremental rebuild issue with
import_includes.  export_includes might get updated with an identical
version, but we don't want to force everything downstream of it to
rebuild.

When BUILDING_WITH_NINJA==true, only update export_includes if it
changes, and use .KATI_RESTAT to only run downstream rules if it
changes.  import_includes will only be updated if one of the
export_includes files is updated, so object files can have a normal
dependency on import_includes instead of an order-only dependency.
All downstream object files will now be recompiled if their imported
include paths change.

Bug: 25910568
Change-Id: I626f3b24ac02ac1309049cf1ce66cfe8ec816513
2015-11-30 17:33:26 -08:00
Colin Cross
bae8872294 Merge changes I1de10391,I4399ca26,Iec3b2b0b
am: bff3c9b4c1

* commit 'bff3c9b4c10dcb3ce3820d3a5e144e3df20313dc':
  Use libstdc++ for ijar
  Build ijar for apps build
  Use .KATI_RESTAT to reduce unnecessary rebuilds of .jar files
2015-12-01 00:03:27 +00:00
Tao Bao
a04fca31bf Stop packaging obsolete OTA tools.
applypatch, applypatch_static and sqlite3 are no longer needed.

Bug: 24621915
Change-Id: I6de5bc45bc8434b9c387e1d3d1b6c347c23a5290
2015-11-30 12:22:24 -08:00