Commit Graph

36 Commits

Author SHA1 Message Date
Ryan Prichard 663b98bbab Stop linking against libatomic
The __atomic_* library functions are now part of the compiler-rt
builtins library:

https://android-review.googlesource.com/c/toolchain/llvm_android/+/1625025

Bug: http://b/153025717
Test: treehugger
Change-Id: Iebd5eaf17f8559696b6d6e2e0dd782f77b6bcab5
2021-04-02 21:05:48 -07:00
Dan Albert f9f035de19 Use the soong-built NDK CRT objects.
Test: treehugger
Bug: http://b/159925977
Change-Id: I9f0109ccd6c5ccd8c4ff0eaf6b34e5004db86161
2020-07-17 15:23:57 -07:00
Peter Collingbourne 86cdf9c2f4 Update make build system for dynamic unwinder.
Change the unwinder linking logic to match soong.

Bug: 144430859
Change-Id: I739980e479d14707b7a3afd6e9d2c817c9b43f81
2020-01-10 11:09:52 -08:00
Treehugger Robot 491ae5b2d1 Merge changes I2183ac9f,I2c76701c,Ibbe4e11a,I0706faa2,Ic5b7c4fb, ...
* changes:
  Fix dependency on BOARD_AVB_SYSTEM_KEY_PATH
  Fix some java library dependencies
  Depend on NDK libraries
  Call clean-path in more places
  Add missing dependecy on SOONG_ZIP
  Add dependencies on the toolchain (clang, etc)
2019-06-13 17:13:22 +00:00
Dan Willemsen c5b7c4fbef Add dependencies on the toolchain (clang, etc)
Historically, we've relied on the path to the clang compiler changing in
order to trigger rebuilds instead of direct dependencies on the compiler
itself. That's somewhat more reliable, since the actual $(CLANG) file is
often a script that doesn't actually change during every update.

In Soong, we've added the dependency anyway, so do it here as well. This
makes it easier for my RBE experiments to identify when we intend to use
clang and to send the entire compiler.

Test: treehugger
Test: build a system image with RBE, find that every command that needed
the compiler gets it.
Change-Id: I3838b5d77884394a8c0f7a1ba133142102602084
2019-06-12 21:34:52 +00:00
Oliver Nguyen e91ab2397f Package coverage files as a zip.
Test: make NATIVE_COVERAGE=true COVERAGE_PATHS="*"
Change-Id: I7ee9253ef47a502a9d29f7e15a4402cbb90e34ae
2019-06-10 15:27:31 -07:00
Yi Kong 2b7e980cbd Allow projects to exclude from libcrt_builtins
Some projects can't be built with libcrt_builtins yet.

Bug: 29275768
Test: m checkbuild
Change-Id: I52805f5dece6395024683d07809c4b8905dab631
Merged-In: I52805f5dece6395024683d07809c4b8905dab631
(cherry picked from commit 2a401bea9e)
2018-11-08 13:41:05 -08:00
Yi Kong 95fd9d171d Move libgcc to libcrt.builtins
libgcc is kept behind libcrt.builtins to provide unwinder symbols and
any other missing symbols.

Bug: 29275768
Bug: 119007754
Test: m checkbuild
Change-Id: Ifb16ed87afc3391f8830d771971315515f929235
Merged-In: Ifb16ed87afc3391f8830d771971315515f929235
(cherry picked from commit b9d8932279)
2018-11-08 13:40:34 -08:00
Dan Willemsen 8cf6b65445 Remove *_OUT_INTERMEDIATE_LIBRARIES
Always use the exact libraries like Soong does instead.

Test: m
Change-Id: Ifd48020073dd045247f76f84627c497e94562286
2018-09-15 10:52:13 -07:00
Dan Willemsen 893bebc44b Clean up some kati warnings
Kati has a `--warn` option that adds some extra Kati-specific warnings
-- like using undefined make functions, undefined user functions, likely
bad variable lookups, etc. Some of these are bugs, others are fine doing
nothing. This fixes up all of them in the core build system.

It also complains about $(eval) usage in a recipe not being recommended.
Those aren't handled as part of this change.

Bug: 72661763
Test: build-aosp_arm.ninja is identical before and after
Change-Id: I8e00af142a7745236d3ad4efc9e91ec3ce71a511
2018-01-29 16:23:37 -08:00
Ryan Campbell 14827f2a98 Support gcno packaging for executables.
Adapt the gcno packaging logic from shared_library_internal.mk for the
case of executable binaries so that gcov artifacts are properly
packaged.

Test: lunch walleye_coverage-userdebug && make -j60
Bug: 67998360
Change-Id: I4994fc21521c91d4c18bdf326be079beda1914a4
2017-11-07 09:52:27 -08: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 bab0fa6928 Add basic VNDK support in Make
Add BOARD_VNDK_VERSION and LOCAL_USE_VNDK to specify the version of the
VNDK that will be used globally, and whether to use the VNDK on a module
basis.

If the board is using the VNDK:

* LOCAL_COPY_HEADERS may only be used by modules defining LOCAL_USE_VNDK
* LOCAL_USE_VNDK modules will compile against the NDK headers and stub
  libraries, but continue to use the platform libc++.
* LOCAL_USE_VNDK modules will not have the global includes like
  system/core/include, but it will use device-specific kernel headers.

This change does not attempt to enforce any linking constraints, that
will come in a later patch.

Test: out/build-aosp_arm.ninja is identical before/after
Change-Id: Icce65d4974f085093d500b5b2516983788fe2905
2016-11-28 13:46:17 -08:00
Dan Willemsen e5836c4bb0 Remove GLOBAL_LD_DIRS
The last user of this was the NDK, which has been using full paths in
binary.mk. So remove it.

Test: lunch aosp_arm-eng; m -j native
Change-Id: Ida2523a2d19131ee3ef005edb3e5bcf830710b11
2016-11-28 13:46:17 -08:00
Colin Cross 067d781530 Remove global linker search paths
Remove the global linker search path, as it can cause spurious build
failures.  If a library with the same name as a system library is in the
process of being written to the directory in the global search path, and
the linker may try to read the partially-written built one instead of the
system one.  We already use full paths to libraries for target builds,
do the same for host builds.  Also remove the normalize library
functions, they are no longer necessary.

Test: m -j checkbuild
Bug: 31393456
Change-Id: If9fc631e111f568c700fd73e103445c30d7e9d11
2016-09-09 11:01:15 -07:00
Dan Willemsen 056609ccfe Remove unnecessary variables
These are all either recently unused due to the removal of CFLAGS/etc,
or have been exported by Soong and are no longer necessary.

Change-Id: I5930d43fda21acc8202b3d8ea010fbefb6ae4cf1
2016-05-25 21:23:20 -07:00
Dan Willemsen db16dd2384 Remove TARGET_LIBGCC/LIBATOMIC/LIBGCOV
Instead, use the libgcc/libatomic/libgcov from the static libraries dir,
which is provided by Soong. Copy the libraries using the Soong script if
Soong is disabled - this can be removed once USE_SOONG is removed.

Change-Id: Iad2ad20ad5c3cfc48bf1e46e594a482609098d7a
2016-05-16 17:26:54 -07:00
Yabin Cui 273e9109c1 Enable LOCAL_POST_LINK_CMD for non-static executables.
It is needed to insert testdata section into simpleperf cts test.

Bug: 27387280
Change-Id: I58cea106d135f535626d8624a016bd2aaceeb8ea
2016-03-02 17:04:11 -08:00
Dan Albert 7fbbc5d205 Use libgcov OR libclang_rt.profile, not both.
Using both can cause duplicate symbol errors.

Change-Id: Id8ee13a81d32e3248ff1cdc468f49a26ecde6b57
2015-10-08 14:16:39 -07:00
Ying Wang 491fca9809 Simplify LOCAL_NO_CRT.
Change-Id: If2486e4861071df6b225fe7f387530a38f554484
2015-07-02 15:58:34 -07:00
Ying Wang 75011b2003 Add LOCAL_NO_LIBGCC.
This can be used to compile independent libraries without the need for
libgcc.a.

Change-Id: I924200995569d9a978ddbaa6ec321d80734f1374
2015-07-02 11:05:27 -07:00
Dan Albert 343ed674e3 Use prebuilt libclang_rt.profile.
Bug: 17574078
Change-Id: I4838cd5d125a0b2bf76aad2fdaef1ee3122687e8
2015-04-01 19:03:22 -07:00
Dan Albert 7655a97984 resolved conflicts for merge of 326f9450 to lmp-dev-plus-aosp
Change-Id: I66360da623a6e7ac04610c3252f24ed69f7e4b1e
2014-09-24 09:42:39 -07:00
Dan Albert 4bbc6c790b Add option for generating coverage info.
To enable building with coverage, the environment variable
NATIVE_COVERAGE must be set to true.

Set `LOCAL_NATIVE_COVERAGE := true` to generate coverage information for
a given component.

This is currently not supported for clang (b/17574078, b/17583330).

If static library A is included in a binary B (dynamic or static
executable, or shared library), and A is built with coverage
information, B is required to link with libgcov.a. Since the make does
not offer a good way to track this dependency, link libgcov.a even if
LOCAL_NATIVE_COVERAGE is not set (but still guarded by NATIVE_COVERAGE).
This ensures that all of the libgcov dependencies will always be
resolved, and causes no change in the resulting binary if coverage is
not used.

Bug: 10134489
Change-Id: Id5a19f2c215e4be80e6eae27ecc19b582f2f6813
2014-09-23 15:19:02 -07:00
Ying Wang 781da04001 am b9add847: am 53e95027: Merge "Add LOCAL_POST_LINK_CMD."
* commit 'b9add847ee1eade4ff517655decfc1790bb77d60':
  Add LOCAL_POST_LINK_CMD.
2014-09-05 23:54:29 +00:00
Ying Wang 8b3476986a Add LOCAL_POST_LINK_CMD.
For now we support LOCAL_POST_LINK_CMD only for static executables.
This fixed the hack of building linker which need to insert additional
step after link.

Bug: 17403674
Change-Id: Iefdfe1e3fab3a30c5d4ad701d46f931481eab572
2014-09-05 15:47:59 -07:00
Dmitriy Ivanov c15103fa72 Add compile time check for statically linked libc
Bug: 17047392

(cherry picked from commit 655d6851f3)

Change-Id: Ia824137e690b9bca1688a7603254273a737ddcbb
2014-08-15 15:02:09 -07:00
Dmitriy Ivanov 655d6851f3 Add compile time check for statically linked libc
Bug: 17047392
Change-Id: I2718422e1832ec5df7f362812ae2728dfd939076
2014-08-15 14:52:42 -07:00
Dehao Chen 5f5c48f0f1 Update the FDO support:
* Explicitly check BUILD_FDO_INSTRUMENT and BUILD_FDO_OPTIMIZE with true
* Remove unnecessary target_libgcov
* Update the profile collection path on device so that most app can have write access

Change-Id: I5c1915a12ea37b2cb3c76a27e7104e47ad636928
2014-07-30 16:54:55 -07:00
Andrew Hsieh 4c952d72b7 Add -latomic to all target builds
Projects using stdatomic.h needs libatomic.a in case compiler can't
expand all __atomic* intrinsics. eg, __atomic_is_lock_free in
armeabi/mips.

Adding libatomic.a globally makes more sense than adding
"LOCAL_LDLIB += -latomic " in each project including <stdatomic.h>.
Projects don't need atomic operations won't get redundant DT_NEEDED
entry because libatomic.a is not a shared library.

Change-Id: I81dbf524544c848e667e18ab5eeabff75b5063ef
2014-05-29 11:40:46 -07:00
Andrew Hsieh 140761af09 Rename my_ndk_version_root to my_ndk_sysroot; and _include and _lib
prebuilts/ndk/current/platforms/android-19/arch-x86_64/usr/lib
is renamed to usr/lib64 to be more consistent with rest of
lib paths in x86_64 toolchain, which is multilib

See https://android-review.googlesource.com/#/c/92441/

Change-Id: I4e59245505d0fa87ae3608e81e715ccfcecc5ec8
2014-04-25 23:47:10 -07:00
Dmitriy Ivanov 00479a9fe0 Remove redundant my_target_global_ldflags
* Fix: my_target_global_ldflags is defined in binary.mk
    so they effectivelly override previous definition

Change-Id: I9c7d9bde82c3a6d25a94ae109fa71ecaa33640b0
2014-04-01 16:36:21 -07:00
Ying Wang 58f462fccf Fix prebuilt library dependency for multilib build
Also we don't need to include module_arch_supported.mk again, if we are
currently substituting the source build with LOCAL_PREBUILT_MODULE_FILE.

Change-Id: I444b0397d74c3153b398a050b762e49418062a86
2014-02-25 18:32:27 -08:00
Ying Wang 9fb3526648 Make -rpath-link work with multilib.
Change-Id: If69ea6ed6cdbb657ed4005f8217d653e29626783
2014-02-21 16:20:20 -08:00
Ying Wang 1f9828387d Refactor llvm_config.mk and support the 2nd arch
1. Following the setup of gcc in build/core/combo/,
we added the [HOST|TARGET]_<arch>.mk clang config files,
and load only the configs needed by the current product.
2. Added support for the 2nd arch.

Change-Id: I2a383418a9688a050b39492f8e489d40eeeb5f2d
2014-02-07 09:11:22 -08:00
Ying Wang dd814bf8c2 Support to build executables for TARGET_2ND_ARCH
By default, an executable is built for TARGET_ARCH.
To build it for TARGET_2ND_ARCH in a 64bit product, use:
LOCAL_32BIT_ONLY := true
To skip a module for TARGET_2ND_ARCH, use:
LOCAL_NO_2ND_ARCH := true

Bug: 11654773
Change-Id: Ieb293d25b21024bfe1b554044df338e064ac7b46
2014-01-24 13:36:30 -08:00