Commit graph

1134 commits

Author SHA1 Message Date
Logan Chien
2f2b890a18 Cleanup createVndkSourceAbiDump()
This commit cleans up `createVndkSourceAbiDump()` and renames it to
`shouldcreateVndkSourceAbiDump()`.

Test: lunch aosp_walleye-userdebug && make
Change-Id: Iff4379e2812c4b5c5baff288b938eed5d92e024f
2018-07-10 15:03:44 +08:00
Jiyong Park
8d52f86baf Fix: recovery module is disabled on 32-bit targets
Fixed a bug that recovery variant of a module is not created on 32-bit
targets. The bug was happening because the creation of the recovery
variant relied on DevicePrefer32BitExecutables() which returns false
for 32-bit only targets.

Now, recovery variant is checked against the primary architecture of the
device that is returned by DevicePrimaryArchType().

Test: m -j adbd.recovery on aosp_arm and aosp_arm64
adbd is built under recovery/root/system/bin and it is ELF32 and ELF64,
respectively for the targets.
Test: m -j libc.recovery on aosp_arm, aosp_arm64, aosp_sailfish
and the x86+arm target in mater. Only one libc.so is installed
under recovery/root/system/lib (or lib64).

Change-Id: I83a248d81f2c71dcfb0e9d887a75b71338f27b4d
2018-07-08 09:43:10 +09:00
Steven Moreland
b468bca551 aidl: -ninja -> --ninja
Bug: 110967839
Test: AIDL's runtests.sh
Change-Id: I49c0a2526b6d4083c927104a3e66017080000847
2018-07-06 11:36:32 -07:00
Yi Kong
c415116333 Merge "Revert^6 "Move -Wno-enum-compare{,-switch} to external cflags"" 2018-06-30 00:03:55 +00:00
Pirama Arumuga Nainar
19fae4e803 Remove unsupported/unused No_pie property
Bug: http://b/111000882

Doesn't seem to be supported.

Test: AOSP build, TreeHugger
Change-Id: Idaab52caa876102b062b3c21acd42c37328bd328
2018-06-29 14:57:46 -07:00
Yi Kong
e1e83e4279 Revert^6 "Move -Wno-enum-compare{,-switch} to external cflags"
This reverts commit c729b508c3.

Reason for revert: New breakages fixed

Change-Id: I8b5e597fdb2af782d591ddcf5b4e7534273a2e7b
Merged-In: I8b5e597fdb2af782d591ddcf5b4e7534273a2e7b
2018-06-29 20:35:35 +00:00
Yi Kong
c729b508c3 Revert^5 "Move -Wno-enum-compare{,-switch} to external cflags"
This reverts commit e0050ebda1.

Reason for revert: Breaks build

Change-Id: I01bc218553ae6efb6140b66f035ccb129d3e5028
2018-06-29 08:19:46 +00:00
Yi Kong
e0050ebda1 Revert^4 "Move -Wno-enum-compare{,-switch} to external cflags"
This reverts commit 8ad44855e6.

Reason for revert: Breakage fixed, try again

Change-Id: Ia648b9513d2224a5e363b65f44f9b2f838db1d3d
2018-06-28 21:05:34 +00:00
Pirama Arumuga Nainar
204165320e Do not set entry-point for Windows
Bug: http://b/62424007

This breaks 64-bit Windows executables.  Probably due to the Clang
migration, the entry-point need not be set even for 32-bit executables.

Test: 32-bit and 64-bit aapt2_tests.exe and ziparchive-tests.exe can
start.  (There are some failed tests, though).

Change-Id: Id3a7d3d2802f6b671332afff4558840bdabddeb5
2018-06-27 11:27:06 -07:00
Pirama Arumuga Nainar
83d716c413 Do not enable sanitizers on Windows
Bug: http://b/69933068

Test: m native-host-cross SANITIZE_HOST=address
Change-Id: Ia9ff941fb569b0a2e9c4eef604fd165f94bca31a
2018-06-26 14:18:16 -07:00
Treehugger Robot
9d951a10f3 Merge changes from topic "mingw-clang"
* changes:
  Use clang for windows host modules
  Use -static-libgcc for Windows
2018-06-26 19:47:53 +00:00
Pirama Arumuga Nainar
8a852e7694 Use clang for windows host modules
Bug: http://b/69933068

- Remove GCC's intrinsic header path so Clang's headers get included.
- Add '-B' with GCC's binary directory so Clang detects the linker.
- Bug: http://b/109759970 - Pass '--allow-multiple-definition' linker
flag to deal with ld.bfd's inability to handle Clang-generated section
names is fixed.
- Bug: http://b/110800681 - lld cannot link Android's Windows modules
yet

Test: m native-host-cross and run adb_test.exe under wine.

Change-Id: I9be9cfc34a47cbeee04024438dea214305112eaa
2018-06-25 18:36:50 -07:00
Pirama Arumuga Nainar
abf1b31a20 Use -static-libgcc for Windows
Bug: http://b/69970955

With the MinGW prebuilts update (http://aosp/709402), executables get a
runtime dependency on libgcc_s_sjlj-1.dll with both gcc and Clang.
Passing -static-libgcc removes this dependency and is a better option
than having to package an extra dll with executables.

Test: Run gcc-built adb_test.exe under wine
Change-Id: I18e5fadb1b8ace510ae684e2d4cfa7fe7d007cff
2018-06-25 18:31:01 -07:00
Chih-Hung Hsieh
ad47a27d9c Define CLANG_TIDY_UNKNOWN_CFLAGS for build/make.
Bug: 110538415
Test: build with WITH_TIDY=1
Change-Id: I6c5b5a0cb3ad3c2756bbae5e7c0234a0dafe5991
2018-06-25 13:48:42 -07:00
Colin Cross
6b75360cbc Use WalkDeps instead of VisitDepsDepthFirst
VisitDepsDepthFirst is almost never correct, as it can't query
dependency tags of multiple dependencies between the same two modules.
Replace VisitDepsDepthFirst with WalkDeps in sanitize.go and
python.go.  Also verify the dependency tag before continuing to
recurse to ensure that they don't recurse through genrules and into
unrelated modules.

Test: m checkbuild
Change-Id: I2f7560126f56b51a40ec39dfbdcc18b5891489f7
2018-06-22 12:44:35 -07:00
Treehugger Robot
87e50a0d14 Merge "Recovery partition uses the first architecture only" 2018-06-20 01:11:10 +00:00
Kostya Kortchinsky
d18ae5ce98 Soong support for Scudo
Scudo is a hardened usermode allocator that is part of LLVM's compiler-rt
project (home of the Sanitizers). clang allows for -fsanitize=scudo as a
possible command line option to link the shared Scudo library to a binary.

This patch add Scudo as a potential sanitize option. Scudo is not compatible
with ASan and TSan and will be disabled if either is enabled.

Bug: 72112048
Test: aosp compiled with m -j
Test: local experiment with scudo: true to ensure that a test target
(tombstoned) could be linked with scudo.

Change-Id: I76bb6c60891d4782f6665a112c4c2bf7c31645da
2018-06-19 09:46:09 -07:00
Jiyong Park
413cc744b8 Recovery partition uses the first architecture only
To save space in the recovery partition, modules installed to the
partition are restricted to be built in the first architecure (i.e.,
32bit for 32bit-only device or when TARGET_PREFER_32_BIT is true, and
64bit otherwise).

Most notably, this change removes the 32-bit variant of the linker
(about 1MB). The linker was installed regardless of whether there is a
32-bit executable or not. Now, the unnecessary linker is not installed
and it is guaranteed that all modules in the partition are built with the
same architecture.

Bug: 79146551
Test: m -j
Test: out/target/product/<name>/recovery/root/system/bin/ has only one
variant of the linker.

Change-Id: I4070a43555bad4cfa8eff5253b09dcd004ea8251
2018-06-19 10:49:21 +09:00
Yi Kong
9c63363119 Remove workaround for cortex-a55/a75
Test: m checkbuild
Test: boot on a55/a75 device, pass bionic tests
Bug: 110235326
Change-Id: I5ab2102352a6efe1173b3097875e6e779d4a1a09
2018-06-15 23:15:54 +00:00
Yi Kong
8eb8704cf1 Merge "Update ToolingCFlags overrides to include other new architectures" 2018-06-15 05:08:53 +00:00
Yi Kong
72f9a0b2f5 Update ToolingCFlags overrides to include other new architectures
Bug: 110235326
Test: m checkbuild
Change-Id: I9d0ada05d95bb260500c1d694332a73363b0f299
2018-06-14 18:45:54 -07:00
Treehugger Robot
33ab6f6134 Merge changes from topic "sharedlib_in_recovery"
* changes:
  Recovery variants are built with -D__ANDROID_RECOVERY__
  Recovery partition has same layout as system
2018-06-13 23:14:29 +00:00
Logan Chien
ef1ff3de98 Fix VNDK-Ext ABI check regression
VNDK-Ext are modules with `vndk.enabled: true` but not having
`vendor_available: true`.  In addition, VNDK-Ext should be checked by
source ABI checker.  This change fixes the regression introduced in

Bug: 110142940
Test: Create libminijail_ext, break some ABIs, and see an error.
Change-Id: I8b47ac12d2e132f641129c9549ed22c3971d6c89
2018-06-13 22:32:16 +08:00
Martijn Coenen
8ad44855e6 Revert "Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags"""
This reverts commit cc4bbdccd3.

Reason for revert: breaks builds

Change-Id: Ia8908eb372ce46b23aea73283baf37add4477312
2018-06-13 07:36:05 +00:00
Yi Kong
cc4bbdccd3 Revert "Revert "Move -Wno-enum-compare{,-switch} to external cflags""
This reverts commit 2f71a6adcd.

Change-Id: I09abb194b25813b8b1e4470b22171121cc3f8c11
2018-06-12 22:59:16 +00:00
Treehugger Robot
04f0140479 Merge "Revert "Move -Wno-enum-compare{,-switch} to external cflags"" 2018-06-12 06:44:00 +00:00
Yi Kong
2f71a6adcd Revert "Move -Wno-enum-compare{,-switch} to external cflags"
This reverts commit 96d221f914.

Reason for revert: build breakage for sdk target

Change-Id: I933df62738c08b48d8ae4ea951b2cb4837616c78
2018-06-12 04:51:49 +00:00
Yi Kong
276e82ef2a Merge "Move -Wno-enum-compare{,-switch} to external cflags" 2018-06-12 02:58:15 +00:00
Treehugger Robot
d27a18ff2f Merge "Only write CMakeLists.txt for normal variants" 2018-06-12 01:36:13 +00:00
Treehugger Robot
01c66c199e Merge "Add lld --no-rosegment flag to work with unwinder." 2018-06-12 00:13:27 +00:00
Chih-Hung Hsieh
b18814e7a4 Add lld --no-rosegment flag to work with unwinder.
Bug: 109657296
Test: make checkbuild and boot
Change-Id: If8eda7ced31f5d4abb357935e9292b81936af6be
2018-06-11 15:07:34 -07:00
Yi Kong
96d221f914 Move -Wno-enum-compare{,-switch} to external cflags
Test: m checkbuild
Bug: 72330874
Change-Id: I8aaa020f5efafa8746b2c5ae29cea1a313a28045
2018-06-11 14:54:35 -07:00
Jayant Chowdhary
694b1c7c94 Merge "For llndk libraries add -consider-opaque-types-different to header-abi-diff invocation." 2018-06-11 20:16:21 +00:00
Jayant Chowdhary
c7434e28d3 For llndk libraries add -consider-opaque-types-different to header-abi-diff invocation.
Bug: 79576032

Test: Create abi reference for libmediandk; build libmediandk;
      header-abi-diff gets invoked with '-consider-opaque-types-different'

Change-Id: I132138e333cc944b54051243b44fa072af74aa83
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2018-06-11 10:51:43 -07:00
Jiyong Park
d54aee574d Recovery variants are built with -D__ANDROID_RECOVERY__
Recovery variant of a module is now by default built with
-D__ANDROID_RECOVERY__, thus eliminating the need to define a custom
macro to conditionally compile the module for the recovery mode.
(Of course, they can define their own macro if needed)

Bug: 63673171
Test: m -j
Change-Id: I1d1b990329793472b93c2f56080e72d690eef9ec
2018-06-09 02:03:45 +09:00
Jiyong Park
2e6743176a Recovery partition has same layout as system
Recovery partition has same layout as system. In other words,
executables are installed to <recovery_root>/system/bin and libs are
installed to ../system/lib.

This is made possible because the recovery partition is now
self-contained, i.e., shell, adbd, etc. are hosted in the recovery
partition and thus we no longer has to mount the real system.img
to /system. So /system is now available to executables built for
recovery mode.

Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: Select 'mount /system' in the recovery mode, then `adb shell`.
$ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
the /lib directory.

Change-Id: I6c4f903ad21fd3dd10a07c4588be85d3d678c099
2018-06-09 01:57:00 +09:00
Justin Yun
3e2323d202 Add binder32bit to vndk_prebuilt module
For a vndk_prebuilt module that was built with 32 bit binder, add
"binder32bit: true" to its Android.bp module.
This will add .binder32 suffix to the name.

Bug: 74362637
Bug: 80450527
Test: m -j vndk_snapshot_package
Change-Id: I81049adbf5e67fe5e63d5ea3a8b027aaf6eb355b
2018-06-08 15:56:40 +09:00
Chih-Hung Hsieh
30485c920c Use llvm-{objcopy,strip} when clang lld is used.
* Pass LLVM_{OBJCOPY,STRIP} to makefile rules.
* strip.sh is used only in soong-only mode.
  It will use llvm-strip and  and llvm-objcopy
  when --use-llvm-strip is given.
  Keep flags of strip.sh in alphabetic order.
* Tested build/soong/scripts/build-ndk-prebuilts.sh
  by adding "UseClangLld": true, to soong.variables file.

Bug: 80093681
Test: build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I612267304eea434c7a33cc086b27b577d5f64094
2018-06-07 16:04:14 -07:00
Colin Cross
dfe4752181 Only write CMakeLists.txt for normal variants
Modules may have multiple variants for each architecture, and
SOONG_GEN_CMAKEFILES=1 was generating CMakeLists.txt for all of
them, overwriting the first normal variant with the last (and
likely least normal) variant.

Keep a map of generated CMakeLists.txt files, and only generate
each one once.

Bug: 72283227
Test: m SOONG_GEN_CMAKEFILES=1
Change-Id: If31087264d2809088fe36965b9a0ff0f44089852
2018-06-07 21:34:03 +00:00
Yi Kong
cc80f8d64f Revert "Revert "Add external projects only CFlags option""
This reverts commit a9ccbb7b87.

Test: m
Change-Id: I92d7b7707f73ef3af5824d3e8cb6da0465b5e07d
2018-06-06 16:41:26 -07:00
Colin Cross
2d24c1b654 Remove references to SourceDepTag in module types
SourceDepTag is going to become a set of tags of the same type
instead of a single tag, remove references to it outside the
android module.

Bug: 80144045
Test: soong tests
Change-Id: I00b2ea5040e4fc95dfbfdd79e21579853c478fcb
2018-06-06 17:05:20 +00:00
Kevin Rocard
a9ccbb7b87 Revert "Add external projects only CFlags option"
This reverts commit 6a350878d8.

Reason for revert: Breakage of many AOSP targets

Change-Id: I917e6daa04ac02ecb98c7bb1816f9bdaf46429f5
2018-06-05 21:43:46 +00:00
Yi Kong
6a350878d8 Add external projects only CFlags option
Every time the toolchain adds a new warning, we had to suppress the
warning in every external projects that violates it, or disable it
globally -- which we end up doing most of the time since the first
option is way too time consuming.

Add a separate cflags option for external projects and move existing
-Wno-* flags there so that we can enforce better code quality for
internal projects.

TODO: Move more -Wno-* flags to ClangExtraExternalCflags

Test: m checkbuild
Change-Id: If3dee491616a1e7ba6223c2f522d100e10c5ee76
2018-06-05 19:32:02 +00:00
Treehugger Robot
85b1e39ffe Merge "Fix mac sdk build" 2018-06-05 00:47:16 +00:00
Treehugger Robot
1efd4a9c81 Merge "Add a preprocessed_ndk_headers module type." 2018-06-04 23:40:03 +00:00
Dan Willemsen
fdb20d05bc Fix mac sdk build
Use the host platform "strip", and also expose "nm" and "otool" used for
toc.

Test: `m PRODUCT-sdk-sdk` on Mac
Change-Id: I7a6d127f479d3e563385ead46bc3a4b49b99776b
2018-06-03 16:19:56 -07:00
Treehugger Robot
1d2318d6cd Merge "Allow more PATH tools, expose HOST_STRIP" 2018-06-01 23:58:15 +00:00
Chih-hung Hsieh
a4181126ee Merge "Handle pack_relocations in linker.cc" 2018-06-01 20:43:11 +00:00
Dan Willemsen
f6d300662e Allow more PATH tools, expose HOST_STRIP
atree was using the host's strip tool during sdk generation, so expose
the prebuilt for use instead.

`id` was used with a test running minijail0 during the build

`sha1sum` is used by development/build/tools/mk_sdk_repo_xml.sh

`rmdir` was being used to remove some tmp files

Test: m PRODUCT-sdk_arm64-sdk dist sdk_repo
Test: Run other builds through forrest
Change-Id: I49c756a3e9497c0bbd9030754e6aa193a2d989a4
2018-06-01 12:48:41 -07:00
Dan Albert
cb1b4b2d53 Add a preprocessed_ndk_headers module type.
Unlike the old version of this (which has been renamed to
verioned_ndk_headers), this module includes a property to specify the
preprocessor to be used.

This is going to be used for preprocessing ICU4C's unicode/uconfig.h
to alter a config value that needs to differ between the platform and
the NDK.

Test: make checkbuild
Bug: https://github.com/android-ndk/ndk/issues/548
Change-Id: If5c6f54f90cf5a4187693a941748d72f39b0d797
2018-06-01 11:02:38 -07:00