Commit graph

25600 commits

Author SHA1 Message Date
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
a23a97e3bf Merge "Tag "tests" alone doesn't prevent including emma.jar" 2015-11-06 19:27:52 +00:00
Ying Wang
324ffb2785 Tag "tests" alone doesn't prevent including emma.jar
Only if an app has LOCAL_INSTRUMENTATION_FOR, it can get the emma
classes from the target app and we don't need to instrument the test app
itself.

Change-Id: If0fba50ddae757254fc58ca104d729d61603fd78
2015-11-06 11:22:28 -08:00
Steve Fung
53a6fd6498 Merge "Add the build type to META folder in target files.zip" 2015-11-06 03:18:35 +00:00
Steve Fung
4044b38f0a Add the build type to META folder in target files.zip
For AB builds, add the build type to META/build_type.txt so the
server can easily determine user, userdebug, and eng builds
from each other.

Bug: 25420005
Change-Id: I6e4de2ba36a6fd1208c65a434d4725bb93d2cee6
2015-11-05 15:04:11 -08:00
Dan Willemsen
1b2685137e Merge "Use explicitly sized types in zipalign/ziptime" 2015-11-05 20:28:20 +00:00
Than McIntosh
838ad09b17 Merge "Enable gold linker for aarch64." 2015-11-05 11:49:56 +00:00
Shinichiro Hamaji
457345e58c Merge "Allow missing SONAME in .toc files" 2015-11-05 04:02:37 +00:00
Shinichiro Hamaji
f0972f7966 Allow missing SONAME in .toc files
At least one shared object in internal repo doesn't have
SONAME entry in its dynamic segment because it is created by
objcopy instead of a linker.

Change-Id: If7106da022ff1e4e925191402f9072795dc3ddcb
2015-11-05 12:51:08 +09:00
Shinichiro Hamaji
2f8ffa61be Merge "Use .KATI_RESTAT to reduce unnecessary rebuilds of binaries" 2015-11-05 00:46:04 +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
Dan Willemsen
41bc424c32 Use explicitly sized types in zipalign/ziptime
getLongLE would return a 64-bit number with the upper 32-bits set when
decoding a 32-bit number with the top bit set. Per the zip file format,
it was only expected to return a 32-bit number. Use explicitly sized
types so that we use the proper sizes and don't do any implicit
extensions.

Change-Id: I5a4304dc99ce5f8f17284d4ca3094ae115207a1e
2015-11-04 23:52:52 +00:00
Jeffrey Vander Stoep
b18da85cb6 Merge "selinux: Grant all processes the domain_deprecated attribute" 2015-11-04 18:47:32 +00:00
Ying Wang
7f50cf7f50 Merge "Don't run ziptime on host zip files." 2015-11-04 18:13:03 +00:00
Ying Wang
5d88770f26 Don't run ziptime on host zip files.
ziptime fails on zip file larger than 2GB.
These zip files won't installed on device and we don't care that much
about their reprodudcibility across builds.

Change-Id: I47062928d075a59eda92dd5333e59502f490d1cb
2015-11-04 10:06:25 -08:00
Jeff Vander Stoep
7890fc4d2e selinux: Grant all processes the domain_deprecated attribute
Bug: 25433265
Change-Id: Iafad5abd6e75c5a46f844ef3e744adf1c904b362
2015-11-04 08:49:07 -08: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
Ying Wang
5dd68067a6 Merge "Sort out ANDROID_GOALS, KATI_GOALS and NINJA_GOALS." 2015-11-04 01:11:14 +00:00
Ying Wang
4a4a0bc38f Sort out ANDROID_GOALS, KATI_GOALS and NINJA_GOALS.
ANDROID_GOALS: any Android goals that need to be built.
KATI_GOALS: goals that we need to pass to Kati.
NINJA_GOALS: goals we need to pass to Ninja.

For modifier Android goals (dist, INTERNAL_MODIFIER_TARGETS),
we don't need to pass them to Ninja. See also commit
80e46c7c5c.
Restore the dist rule removed by the above commit.

Previously "droid" was never passed to Ninja. That's incorrect.
"make droid docs" should build both docs and droiod.
Fixed with this change.

Change-Id: I5c28061fe0ebe7848872ee349056d029b787ff71
2015-11-03 17:10:28 -08:00
Dan Willemsen
29a6675983 Merge "Don't use ziptime with unbundled builds" 2015-11-04 00:24:59 +00:00
Dan Willemsen
a25ddad7d6 Don't use ziptime with unbundled builds
Some of the trees are unable to compile native code with the normal
build rules, even though they can build kati.

Bug: 24201956
Change-Id: I2afc3468480b2c78407d62323e6b82979c8ee254
2015-11-03 16:18:41 -08:00
Clay Murphy
e47d8b99a2 Merge "Docs: Add Security tab to top" 2015-11-03 23:45:56 +00:00
Dan Willemsen
a0975edc16 Merge "Remove changing uids/timestamps from zip/jar files" 2015-11-03 21:38:45 +00:00
Ying Wang
fb89fd36b2 Merge "Don\'t check the host JDK tools when build/core/config.mk is called from envsetup.sh."
am: a63d379aab

* commit 'a63d379aab75fe3991320319f63faddd3b84b287':
  Don't check the host JDK tools when build/core/config.mk is called from envsetup.sh.
2015-11-03 00:40:38 +00:00
Ying Wang
a63d379aab Merge "Don't check the host JDK tools when build/core/config.mk is called from envsetup.sh." 2015-11-03 00:17:43 +00:00
Ying Wang
7fcd2f9086 Don't check the host JDK tools when build/core/config.mk is called from envsetup.sh.
Envsetup.sh (lunch) relies on config.mk to get build varaible values; while
config.mk may rely on envsetup.sh to set up JAVA_HOME/PATH.
Without this change config.mk may be checking the host JDK tools before
JAVA_HOME/PATH get set up.

Change-Id: I1e6b5e33147258832ce2f0a425f9526ef4782c43
2015-11-02 16:00:47 -08:00
Dan Willemsen
48a621c277 Remove changing uids/timestamps from zip/jar files
Pass -X to zip so that Unix UID/GID and extra timestamps aren't
saved into the zip files.

Add a new tool, ziptime, that uses a very stripped down copy of
zipalign. It no longer depends on libandroidfw, and now rewrites the
timestamps in place instead of making a copy of the zipfile. This should
improve speed and reduce disk requirements, especially with the large
packaging zip files.

Bug: 24201956
Change-Id: I50f68669f659da1b4393e964ad40b6aafb00c1e7
2015-11-02 14:51:54 -08:00
Gaurav Shah
af80a461d6 Merge "envsetup,product,ninja: enable symlink traversal"
am: f589c7b442

* commit 'f589c7b442feb02843bdf82305b599b686fc5204':
  envsetup,product,ninja: enable symlink traversal
2015-11-02 22:27:27 +00:00
Gaurav Shah
00b8cd9a15 Merge "Support build targets with no installable apps/packages"
am: aed6805380

* commit 'aed6805380810f51bb0d8b93fc5eac005a6de364':
  Support build targets with no installable apps/packages
2015-11-02 22:27:20 +00:00
Gaurav Shah
64ea350dd8 Merge "build: Add extra build customization for /product"
am: a80f1e3257

* commit 'a80f1e32575db5d66f4b4e6efdf79dd10dd2295e':
  build: Add extra build customization for /product
2015-11-02 22:27:14 +00:00
Gaurav Shah
881ec090c4 Merge "build: Add support for defining products in /product"
am: acb8a7c1f8

* commit 'acb8a7c1f8cacaf136edba1a25d64467d352a432':
  build: Add support for defining products in /product
2015-11-02 22:27:08 +00:00
Gaurav Shah
f589c7b442 Merge "envsetup,product,ninja: enable symlink traversal" 2015-11-02 22:22:50 +00:00
Gaurav Shah
aed6805380 Merge "Support build targets with no installable apps/packages" 2015-11-02 22:22:40 +00:00
Gaurav Shah
a80f1e3257 Merge "build: Add extra build customization for /product" 2015-11-02 22:22:32 +00:00
Gaurav Shah
acb8a7c1f8 Merge "build: Add support for defining products in /product" 2015-11-02 22:22:22 +00:00
Will Drewry
c13f9c952d envsetup,product,ninja: enable symlink traversal
When searching device, product, or hardware, allow
find to follow symlinks.

Add KATI_EMULATE_FIND=false to allow disabling the find
emulator which changes findleaves.py behavior wrt
symlinks.

BUG=24605247
TEST=works with CL:783781 (without the find wrapper in that CL)

Change-Id: Ia9d0e4add391a56f34828a09a6cec3f435ccc548
2015-11-02 14:18:45 -08:00
Gaurav Shah
67c2ed390f Support build targets with no installable apps/packages
Specifically, do not error out if no installable apps are found.

- When creating an archive of all the apps, and if no apps exist
for the target, generate an empty archive file.
- If building for a target with no installable jar(s) or apk(s),
generate an empty package stats file.

The former is just an output artifact. The latter is used
by the upload_pkg_stats.py script which correctly handles
an empty input file.

BUG: 23421592

Change-Id: I48db9f9e1f61914d8fd938130e09b41849685450
2015-11-02 14:18:30 -08:00
Lee Campbell
04ba31236e build: Add extra build customization for /product
This makes /product more consistent with /device & /vendor

BUG: 22030305

Change-Id: Ic65bfde7fb3e9fab8c8fb8d99af15404574abde0
2015-11-02 14:18:13 -08:00
Lee Campbell
455f6f458d build: Add support for defining products in /product
The build will now search for AndroidProducts.mk in /product

BUG: 22030305

Change-Id: I2d067d95d0c8dc1341a55167f9ac7f6926e04ce3
2015-11-02 14:17:47 -08:00
Ying Wang
cce30b6daa Merge "Add _asan suffix to ro.build.flavor for ASAN builds."
am: f0a8dd43b2

* commit 'f0a8dd43b26d49ad67e2c6c8c936e64a62df8582':
  Add _asan suffix to ro.build.flavor for ASAN builds.
2015-11-02 19:52:04 +00:00
Ying Wang
603e4ed594 Merge "Fix "make product-graph" and "make dump-products"."
am: 888f30aa44

* commit '888f30aa448370206a49ff7df940e134b8ff7017':
  Fix "make product-graph" and "make dump-products".
2015-11-02 19:51:57 +00:00
Ying Wang
f0a8dd43b2 Merge "Add _asan suffix to ro.build.flavor for ASAN builds." 2015-11-02 19:47:31 +00:00
Ying Wang
888f30aa44 Merge "Fix "make product-graph" and "make dump-products"." 2015-11-02 19:46:53 +00:00
Clay Murphy
2a0522b277 Docs: Add Security tab to top
Bug: 24908502
Change-Id: If3331bc4ba84a8694bc30cfa81d9dc080e93fa09
2015-10-29 15:19:06 -07:00
Dan Willemsen
d8d06da814 Merge "Revert "Remove changing uids/timestamps from zip/jar files""
am: 49d8c5196e

* commit '49d8c5196eb690fc987673c27cb61087c5886be4':
  Revert "Remove changing uids/timestamps from zip/jar files"
2015-10-29 21:33:39 +00:00
Dan Willemsen
49d8c5196e Merge "Revert "Remove changing uids/timestamps from zip/jar files"" 2015-10-29 21:28:17 +00:00
Dan Willemsen
b589ae4e26 Revert "Remove changing uids/timestamps from zip/jar files"
This reverts commit 3c2c064c87.

zipalign depends on libandroidfw, and some setups don't include frameworks/base.

Bug: 24201956
Change-Id: I48ee95808924f6b2221f0a49ab205c2565096b1f
2015-10-29 21:26:18 +00:00
Dan Willemsen
a51b1d532e Merge "Remove changing uids/timestamps from zip/jar files"
am: 9f25219371

* commit '9f252193714c82dbce702e8055ffaa7eec4afe66':
  Remove changing uids/timestamps from zip/jar files
2015-10-29 19:12:37 +00:00
Dan Willemsen
9f25219371 Merge "Remove changing uids/timestamps from zip/jar files" 2015-10-29 19:07:36 +00:00
Dan Willemsen
3c2c064c87 Remove changing uids/timestamps from zip/jar files
Pass -X to zip so that Unix UID/GID and extra timestamps aren't
saved into the zip files.

Add a new option to zipalign, -t, to replace all timestamps with static
timestamps (2008 Jan 1 00:00:00). Use this for all non-APK zip files.
APK zip timestamps are set based on the certificate date in SignApk.

Bug: 24201956
Change-Id: Ifb619fc499ba9d99fc624f2acd5f8de36d78ef8e
2015-10-29 11:57:16 -07:00