Commit graph

651 commits

Author SHA1 Message Date
Colin Cross
3277ba34ae Add java modules to soong_to_convert.txt
Test: examine soong_to_convert.txt
Change-Id: Ibb6db664238a4e98f5d8885dfb3ddc0f35d11ff6
2017-12-06 15:38:52 -08:00
Chih-Hung Hsieh
ab149cbda0 No need to dump modules added -Werror.
* This reduces size of output file wall_werror.txt.
* Stop collecting $(MODULES_ADDED_WERROR)

Bug: 66996870
Test: normal build
Change-Id: Id750cc7fe6489a7654b20740d503226ec6941bbb
2017-12-04 15:23:37 -08:00
Treehugger Robot
6e4e9f32ec Merge changes from topic "system-api"
* changes:
  Fix build error
  Add LOCAL_SDK_VERSION := system_$(VER)
2017-12-01 04:19:45 +00:00
Sundong Ahn
5a44d1f069 Add LOCAL_SDK_VERSION := system_$(VER)
The system_$(VER) can be set in LOCAL_SDK_VERSION, and the apk will use
android_system.jar at build time.
If LOCAL_SDK_VERSION is not defined and this module is installed in
vendor.img, LOCAL_SDK_VERSION is set to system_current.

Bug: 67724799
Test: 1. build && run on taimen
2. LOCAL_SDK_VERSION:=system_27 in ims.apk && build ims.apk && check
the vsdk_v27_intermediates.

Merged-In: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
Change-Id: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
(cherry picked from commit ef212cbe8d)
2017-12-01 00:39:07 +00:00
Dan Willemsen
c01ad7b384 Prepare for clang+mingw windows builds
Use $(prefix)CLANG_SUPPORTED from Soong to control whether to use clang
for host builds or not. It's fairly general, but I only expect it to be
used to so that Windows builds can be switched between GCC and Clang
with a single switch.

Also separate native-host-cross from native-host so that it's easier to
build all possible windows modules.

Bug: 69933068
Test: m native-host-cross
Test: switch clang on and off, grep w64.*g++ out/build-aosp_arm.ninja
Change-Id: I205c5bc6739b72a539ece935381107ec1dd5bd48
2017-11-29 21:05:48 -08:00
Treehugger Robot
061fcfc254 Merge "Use the .cfi variant of a static library where needed." 2017-11-22 00:05:30 +00:00
Vishwath Mohan
96a130bdaf Use the .cfi variant of a static library where needed.
This CL repoints static dependencies to their .cfi variants for CFI
enabled targets. It also disables CFI for host targets because the
version of ar intended for hosts does not have plugin support (which
CFI requires).

Bug: 67507323
Test: m -j40
Change-Id: Id11afd0c8765469858f406aace2a192afff6d042
2017-11-21 14:08:20 -08:00
Chih-Hung Hsieh
1876acdd53 Add default -Wall -Werror or -Wall.
* Skip Android.bp, prebuilt, and HEADER_LIBRARIES targets.
* If neither -Wno-error nor -Werror is used, add default -Wall -Werror.
  However, if the build target is in a project
  under one of ANDROID_WARNING_ALLOWED_PROJECTS, add only -Wall.
* Dump name of modules using -Wno-error or added -Wall -Werror
  into file $(PRODUCT_OUT)/wall_werror.txt.

Bug: 66996870
Test: normal build
Change-Id: Ief8cf776e8613ed073a64dd271534688845d5c2c
2017-11-17 14:06:35 -08:00
Ryan Campbell
a435aa5171 Use space-separated coverage paths.
Specify paths to instrument with coverage using space separated lists
instead of comma separated. This makes it easier to specify the lists in
a typical format in the device mk.

Test: add COVERAGE_PATHS to device-sailfish.mk, make -j60
Bug: 67998360
Change-Id: I26c67127d72bd7a153eb4a2c23eae4881a813d54
2017-10-22 19:10:09 +00:00
Jiyong Park
a3fb1588f4 Prevent vendor libs from depending on private VNDK libraries
For module installed to /vendor partition, direct linking to the libs
marked as `vendor_available: false` is not allowed. The

Bug: 64730695
Test: Add vendor_available: false to libft2 and
libcompiler_rt. Add the two libs into LOCAL_SHARED_LIBRARIES of a vendor
lib (e.g. libdrm). Build fails with the link_type check error message.

Change-Id: Iaf23574ceddb0c087111e1d95997e9ddd60cdf87
2017-10-10 19:38:06 +09:00
Treehugger Robot
5118763940 Merge "Add -lm to the default libs for Linux & Darwin" 2017-09-27 07:08:57 +00:00
Dan Willemsen
a3a06feeed Add -lm to the default libs for Linux & Darwin
libm is a default library for device builds, so default it for host
builds as well.

Also removes duplicate additions of -ldl, -lpthread, -lm and -lrt.

Test: m host
Change-Id: I6a07e12053090eb6997b79d4091c28ac9a9022de
2017-09-26 20:26:11 -07:00
Dan Willemsen
4dbb354514 Check available host libraries
Soong has a list of allowed host libraries. Check that list for make
modules as well.

Test: build/soong/build_test.bash (Linux&Darwin, aosp&internal)
Test: Add bad library in LOCAL_LDLIBS, ensure it errors
Change-Id: Icc48533487576998b049dc6c704c410172a91521
2017-09-26 00:14:01 -07:00
Colin Cross
0bd335f9b0 Make -ldl -lrt -lpthread implicit for host builds
Instead of requiring every host module to specify -ldl -lrt -lpthread
and then break the mac build because -lrt doesn't exist, make them
implicit to match the behavior of modules built for the device.

Test: m -j checkbuild
Change-Id: I7b5b5289a41cd8f6e7dc2da59400955d867ee783
2017-09-08 16:43:55 -07:00
Jiyong Park
a0f2b2a286 Merge "cxx_stl_setup is not executed for modules from soong"
am: 9b18ed094c

Change-Id: I08bfd781403ed0b7dd68de2e1045f1fa194bc8f5
2017-08-18 07:16:54 +00:00
Treehugger Robot
9b18ed094c Merge "cxx_stl_setup is not executed for modules from soong" 2017-08-18 07:11:41 +00:00
Jiyong Park
425d489cb9 cxx_stl_setup is not executed for modules from soong
cxx_stl_setup is adding libunwind_llvm to the dependency even for
modules from soong. However, since this dependency was already handled
in soong, those modules don't need to go through it again.

Bug: 64815735
Test: BOARD_VNDK_VERSION=current mma -j (under /hardware/libhardware)

Change-Id: Id6e2547c752ec831aa56a14c0bf4db0a55d51243
2017-08-18 13:46:04 +09:00
Dan Albert
21751a0a67 Merge "Use the min sdk version from soong."
am: 22b45d401a

Change-Id: I3baca77b2774eb93168f6b888f08e8f0e56a1a10
2017-08-18 02:44:33 +00:00
Dan Albert
105e4fe0a6 Use the min sdk version from soong.
Test: make checkbuild
Bug: None
Change-Id: I0306803cebf98748503b7e217db0f0f5959bf4f7
2017-08-17 16:37:49 -07:00
Yifan Hong
6dc0978c5f Merge "Vendor modules in make also have __ANDROID_VNDK__ defined."
am: 9bd6605abe

Change-Id: I7b6fc17cdd244ba6c6a266e0a0951b3a573119c5
2017-08-02 03:45:15 +00:00
Treehugger Robot
9bd6605abe Merge "Vendor modules in make also have __ANDROID_VNDK__ defined." 2017-08-02 03:39:33 +00:00
Yifan Hong
d7aa8417de Vendor modules in make also have __ANDROID_VNDK__ defined.
Bug: 64277220
Test: BOARD_VNDK_VERSION m -j
Change-Id: Ia9811ea526d0878b539c8c3da9e82e6bf33fe8e8
Merged-In: Ia9811ea526d0878b539c8c3da9e82e6bf33fe8e8
2017-08-01 18:54:10 -07:00
Jiyong Park
8f793af35c Merge "Don't add .vendor suffix for vendor-only modules"
am: 28989a9a22

Change-Id: I8f123f26ec3eb0c1d6607a21dfa7996284a68119
2017-07-27 00:24:42 +00:00
Jiyong Park
a9c4c71756 Don't add .vendor suffix for vendor-only modules
Soong now adds .vendor suffix only for modules having both core and
vendor variants. Furthermore, names listed in LOCAL_SHARED_LIBRARIES
are correct (= have .vendor suffix when the dependent lib has variants).
Therefore, make does not need to force add .vendor suffix when parsing
modules from soong.

Bug: 37480243
Test: BOARD_VNDK_VERSION=current m -j <name> is successful, where <name>
is one of the vendor-only libraries in Soong. (i.e.
android.hardware.renderscript@1.0-impl)
Test: m -j does not break anything

Change-Id: Id8d0d01313c63496a10de4cd3ddb9f75180efef6
2017-07-27 08:54:43 +09:00
Jiyong Park
9e89245a2c Merge "Don't allow JNI headers for vendors"
am: b253e8e854

Change-Id: I6e3de31f388150301db9f0d0dd1bee3b7e39f413
2017-07-14 03:39:49 +00:00
Treehugger Robot
b253e8e854 Merge "Don't allow JNI headers for vendors" 2017-07-14 03:34:50 +00:00
Jiyong Park
b43a52d79d Don't allow JNI headers for vendors
This is already blocked in Soong. Do the same for make.

Bug: 63553556
Test: BOARD_VNDK_VERSION=current m -j libSampleAuthJNI cannot be built
Change-Id: I04a89b3f9de903a6b0384f13d5a80886344c14b4
2017-07-13 15:51:07 +09:00
Jiyong Park
240f1d5ffe Merge "fix: device_kernel_headers can't be found in the make world"
am: 1aa29599c6

Change-Id: Ic588932665fe23e7bc50ec6a751aad3449a52018
2017-07-12 20:54:23 +00:00
Jiyong Park
cb8e636ed0 fix: device_kernel_headers can't be found in the make world
Since device_kernel_headers is marked as 'vendor:true', it is exported
to the make world as device_kernel_headers.vendor. Use the correct name
with the .vendor suffix.

Bug: none
Test: BOARD_VNDK_VERSION=current m -j does not complain about
device_kernel_headers.

Change-Id: If3eaa3c5832820c914ef427668d70fa8d8d0bf97
2017-07-12 18:29:17 +09:00
Jiyong Park
be8d64294c Merge "Device-specific kernel headers are accessbile again"
am: 6f594fc662

Change-Id: Icffe772cc97a39fceb21e0a22a3776313bbefa1f
2017-07-08 03:18:56 +00:00
Jiyong Park
0c59dab590 Device-specific kernel headers are accessbile again
Device-specific kernel headers (TARGET_PROJECT_SYSTEM_INCLUDES) have
been added to the global include paths. However, since global include
paths are no longer provided when a lib is built for vendors, the
device-specific kernel headers becomes inaccessible. To solve this
problem, a pseudo header library 'device_kernel_headers' is defined
and it is added to all Android.mk defined lib/bins.

Also, in order to give this info to the soong world,
TARGET_PROJECT_SYSTEM_INCLUDES is exported as a new product config
DeviceKernelHeaders.

Bug: 62939405
Test: choosecombo to aosp_sailfish (or any other Pixel/Nexus targets)
BOARD_VNDK_VERSION=current m -j gralloc.msm8996 (or any other vendor
libs using vendor-specific kernel headers)

Change-Id: I3f0a2b893cc9352d6c13f3151e8834477d15c07b
2017-07-08 10:16:23 +09:00
Jiyong Park
e51b222801 Merge "Give TARGET_OUT_HEADERS to vendor modules"
am: c86c8502ac

Change-Id: I2d9ca861cbac74b6e14ee843717e41ddc855bd91
2017-07-07 22:30:08 +00:00
Jiyong Park
7f8be9f695 Give TARGET_OUT_HEADERS to vendor modules
Many vendor modules are using headers that are copied to
$(TARGET_OUT_HEADERS)/some/path via LOCAL_COPY_HEADERS. In order to let
them use the headers via #include <some/path/header.h>,
$(TARGET_OUT_HEADERS) is again added to the system include path.

Bug: 63340459
Test: BOARD_VNDK_VERSION=current m -j gives less 'cannot find header'
errors.

Change-Id: I472e74533b437653c76dc416f7f4527c0e90750d
2017-07-06 09:45:26 +09:00
Dimitry Ivanov
cd00be0767 Merge "Add libdl.so to the list of system shared libs"
am: b519d002f3

Change-Id: I2d3d5daf26b7a78d68c02cf961bf43a71f19b0bf
2017-06-29 22:17:04 +00:00
Dimitry Ivanov
cdf3927ec4 Add libdl.so to the list of system shared libs
Note that libdl is already (always) implicitly loaded
because libc.so has a dependency on it.

Also make sure that libc.so always preceding libdl.so
in dt_needed list.

Bug: http://b/62815515
Test: make
Change-Id: I94c9d676b7fa98438b452d24f6c3bbf93166c6a9
2017-06-27 16:05:13 -07:00
George Burgess IV
37f6f8181f Merge "make: add __clang_analyzer__ to clang-tidy" am: 57273013cf am: c352502062
am: 9b802e745d

Change-Id: I8432d19ee7d65e2aa4ffb99ada989a57d8bb15c8
2017-05-10 04:59:02 +00:00
Treehugger Robot
57273013cf Merge "make: add __clang_analyzer__ to clang-tidy" 2017-05-10 04:34:42 +00:00
George Burgess IV
5ab07d4f14 make: add __clang_analyzer__ to clang-tidy
We have code that acts slightly differently when the static analyzer is
running, so that it can produce more accurate diagnostics (e.g. less
false positives). It uses __clang_analyzer__ to detect the static
analyzer.

When the static analyzer is run via clang-tidy, __clang_analyzer__
doesn't get defined.

Bug: None
Test: WITH_TIDY=1 m. clang-tidy now acts as expected in code made for
the static analyzer

Change-Id: Ib2a815c0bd67553af465b64207bb480fb52cfaf8
2017-05-03 18:10:47 -07:00
Dan Willemsen
2e68205f3e Merge "Exempt UBSAN runtime library from soong_to_convert" am: 94751070e8 am: 0d694416d2
am: 97018accea

Change-Id: I7d14fcfbf6b42611cdce83517328f50ad157885a
2017-05-03 01:28:40 +00:00
Dan Willemsen
0bf506f44a Exempt UBSAN runtime library from soong_to_convert
Soong already uses it, just not as a prebuilt module.

Test: Compare soong_to_convert.txt before/after
Change-Id: I6ffa0d967635d52b7b4f8b2b0465cd50254f22b9
2017-04-25 16:26:43 -07:00
Jiyong Park
073a53d177 Merge "make libprotobuf-cpp-* libs VNDK" am: cd46573189 am: e56c17d779
am: 2fc3e30205

Change-Id: Ie5614a40dc29bfc98db3c107e9f5f02af3712afe
2017-04-21 07:57:01 +00:00
Treehugger Robot
cd46573189 Merge "make libprotobuf-cpp-* libs VNDK" 2017-04-21 07:46:20 +00:00
Dan Willemsen
4e9e5d526c Merge "Rewrite link type checking" am: e4d92ef568 am: d76aaed983
am: e834d5f059

Change-Id: I02342b80077a7e1e36e61d1f9384d3b104a982c1
2017-04-20 15:15:19 +00:00
Jiyong Park
c8f57d92ff make libprotobuf-cpp-* libs VNDK
libprotobuf-cpp-* libs are VNDK, However, since the '.vendor' prefix is
added before libprotobuf-cpp-* libs are added to my-*-libraries by
LOCAL_PROTOC_OPTIMIZE_TYPE, the clients are still linked against to the
platform version of the protobuf libs. As a result, link type error
occurs.

In order to avoid this, '.vendor' prefix is appended after
my-*-*libraries are all updated.

Test: normal build successfull
Test: add vendor_provided:true to libprotobuf-cpp-* and build successful
with BOARD_VNDK_VERSION=true

Change-Id: I1ed7978f03e0db56b4cbee86e286c0787f7a3afc
2017-04-20 15:41:51 +09:00
Dan Willemsen
b47d4e9cf1 Rewrite link type checking
All the new features are turned off for now, since multiple branches and
products need to be verified before they can be turned on. So everything
should behave the same as today, except for no partition-based
warnings.

Instead of the current link type checks that happen during the build,
run as many as possible immediately after loading all the Android.mk
files. If we're allowing missing dependencies ('mm',
ALLOW_MISSING_DEPENDENCIES, tapas, etc), we'll defer the link type
checks to during the build. If we're not allowing missing dependencies,
we'll produce a better error message to the user about the missing
dependencies.

See core/main.mk for a description of the storage format.

This also remove the partition-based type checking. It hasn't worked all
that well, particularly with ASAN builds. The new VNDK checks will
handle the most pressing cases.

Test: Verify all link_type files and dependencies are the same:
  grep link_type: out/build-aosp_arm64.ninja | sed -E "s/ rule[0-9]+//" | sort
Change-Id: Id643658b9d9e84f99f5db0d526aad88c1f5d3417
2017-04-19 22:41:32 -07:00
Vishwath Mohan
f1760bde83 Merge "Make PIC/PIE levels compatible for LTO." am: 4be1d8823e am: dc8469e858
am: 648a3380e2

Change-Id: I0ddd3324811be38846da7076dceea77e43cc0fe7
2017-04-18 02:06:07 +00:00
Vishwath Mohan
c3b255622d Make PIC/PIE levels compatible for LTO.
The build system currently uses -fPIC for position independent
libraries, and -fpie for position independent executables. However,
these levels are incompatible and conflict when an executable includes
a static lib with the -fPIC flag - such as when building with
LTO. This CL changes the flag for executables to the compatible -fPIE
instead, which is equivalent for all architectures except PowerPC.

Bug: 30227045
Test: ENABLE_CFI=true m -j40 checkbuild # builds and boots
Change-Id: Ieb20bc2528300d88ff05e8787c5840ab6f03fb38
2017-04-17 16:16:33 -07:00
Dan Willemsen
bfdfb66954 Merge "Support split /system and /vendor modules from Soong" am: 4e789c2e57 am: 9fc091f756
am: 6ac7ce63e5

Change-Id: I66f86a4215010f0861ea77ee53a5db7fb3153c90
2017-04-12 00:21:59 +00:00
Dan Willemsen
9d2b3280e8 Support split /system and /vendor modules from Soong
Soong modules may be split into both /system and /vendor variants.
Ensure that Make libraries link against the correct version based on
whether LOCAL_USE_VNDK is set.

Bug: 36426473
Bug: 36079834
Test: build-aosp_arm64.ninja files are the same before/after
Test: attempt building with BOARD_VNDK_VERSION:=current
Change-Id: I229bc290373743406275f3ca16081eae04c27987
2017-04-10 15:54:50 -07:00
Dan Willemsen
864955d152 Merge "Add LLNDK support for the VNDK" am: 2d6e79d268 am: 67eb8bb766
am: 7bc488c0ec

Change-Id: I6717b28deac9e8fea5bcfe53885aeea90ca04732
2017-04-07 21:39:01 +00:00