They are now explicit in the Bionic blueprints, and brought in through
dependencies on libc (which in turn is usually implicit through the
default system_shared_libs value). Modules that may break are cc_object
which don't depend on system_shared_libs, and those that explicitly set
system_shared_libs:[] but still assumes libc headers. In either case
the fix should be to add header_libs:["libc_headers"].
Test: Build and boot
Test: m checkbuild (on aosp_taimen and aosp_x86_64)
Bug: 153590472
Change-Id: I3217d8f36e49a987f5377866c8647f9dcccc37ce
Removing XOM had the side effect of removing "-z separate-code", which
was needed to override a new default after a recent toolchain update.
This led to some performance regressions in some tests. For now, add
this flag to the global arm64 device flags to return to the previous
behavior.
Bug: 150506341
Test: m -j
Change-Id: I54787954141d133e245dfd259a37bf4c3c8e7caa
This enables using arch-dependent property values in modules defined in
android/.
Bug: 122332178
Test: Soong tests + TreeHugger
Change-Id: I89869e395fabf0e69f505b77eab8a4221384124e
Support Kryo 385 cpu variant which should be used for
Qualcomm Snapdragon 845.
Motivation:
kryo385 CPU *IS NOT* an Arm Cortex-A75.
Particular problem:
Cortex-A75 CPU must support optional ARMv8.2 dot product
feature; kryo385 CPU (Qualcomm Snapdragon 845) doesn't
support it.
Test: Builds when kryo385 is used as cpu variant.
Test: Pixel 3 boots to GUI with kryo385 as CPU variant
with this patch on AOSP 9.0.0 r16.
Bug: 119564566
Change-Id: I62ffb46b1977b48446c6c1ca1400b1b39f7a8457
This reverts commit 98d8580c3a.
Change no longer needed with the new LLVM toolchain update.
Bug: 112907825
Bug: 111759196
Change-Id: Ife3ce47a602dd850ac84bb51abc70c0ca157776e
This is achieved via the compiler flag -ffixed-x18 for non-LTO builds
and the linker flag -plugin-opt -mattr=+reserve-x18 for LTO builds.
This change should be reverted once we upgrade past LLVM r340889
which does this by default on Android.
Bug: 112907825
Bug: 111759196
Change-Id: I05473ddbb98319d87d442425b4d715647eae3a38
https://android-review.googlesource.com/c/platform/build/soong/+/689585
added, but was skipped going into pi-dev-plus-aosp, as the pi-dev
version (which did not have these lld bits) was already merged there.
When pi-dev-plus-aosp was pushed to aosp-master, this got lost.
Merged-In is a random git_master change, since this needs to go
into pi-dev-plus-aosp too, but no further.
Bug: 78133793
Test: git diff aosp-master..master -- cc/config/arm64_device.go
Change-Id: Iea69a2c040d11249e43a76a78859944274ce6a92
Merged-In: I7799feac522a1097ec4271bd7868cd6bfe147ad9
... and rename SanitizerRuntimeLibrary to LibclangRuntimeLibrary since
some of them are not sanitizers.
Bug: 29275768
Test: m
Change-Id: Id638adea42d22b02438fce26120aa155bea14d42
Bug: 78133793
Test: Built target with cortex-a53 and verified that the flag is still
Test: there.
Test: Build target with cortex-a55/cortex-a75 and verified that the flag
Test: is not there.
Test: Built and booted on a taimen, ran bionic unit tests.
Change-Id: Ibd7f497ecf46e5781cd0265463b0782babdf062a
Merged-In: Ibd7f497ecf46e5781cd0265463b0782babdf062a
(cherry picked from commit a98d721485)
Bug: 78133793
Test: Built target with cortex-a53 and verified that the flag is still
Test: there.
Test: Build target with cortex-a55/cortex-a75 and verified that the flag
Test: is not there.
Test: Built and booted on a taimen, ran bionic unit tests.
Change-Id: Ibd7f497ecf46e5781cd0265463b0782babdf062a
Bug: 78133793
Test: Builds when using cortex-a75 as a target.
Change-Id: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
(cherry picked from commit 0612597a41)
Bug: 78133793
Bug: 78242072
Test: Builds when using cortex-a75 as a target.
Change-Id: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
Merged-In: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
(cherry picked from commit 0612597a41)
* USE_CLANG_LLD is unedefined in current builds.
* When USE_CLANG_LLD is defined to 'true' or '1',
use clang's lld instead of ld or ld.gold.
* When lld is enabled:
* ld-only flags are not passed to 'lld'.
* location_packer is disabled.
* Use new lld's --pack-dyn-relocs=android.
* When lld does not work:
* In Android.mk files use LOCAL_USE_CLANG_LLD := false.
* In Android.bp files use use_clang_lld: false.
* Only arm, arm64, x86, and x86_64_devices have LLD flags;
all other hosts and targets do not call lld yet.
Bug: 73768157
Test: make checkbuild and boot
Change-Id: I06b8a1e868a600997a7e70fe05c299d751d23d5f
This reverts commit fa00dfda13.
Reason for revert: New Build Breakages in git_pi-dev-plus-aosp-without-vendor/aosp_walleye-userdebug and git_pi-dev-plus-aosp/aosp_crosshatch-userdebug
Change-Id: Iec9e695cccc3f206df67f0c01cfd4c2c3023dcec
Proposal for adding SHT_RELR sections in the generic-abi is at
https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg
Comparison with relocation_packer for aosp_marlin-userdebug:
$ du -B1 -s */out/target/product/marlin/system
996958208 base/out/target/product/marlin/system
1008340992 no_pack/out/target/product/marlin/system
997801984 sht_relr/out/target/product/marlin/system
base contains a build with current settings.
no_pack contains a build with relocation_packer disabled.
sht_relr contains a build with SHT_RELR sections enabled.
relocation_packer was saving 11,382,784 bytes (no_pack - base).
SHT_RELR sections are saving 10,539,008 bytes (no_pack - sht_relr).
Bug: None
Test: Built aosp_marlin-userdebug image, boots on device.
Test: Built aosp_x86_64-userdebug image, boots in emulator.
Change-Id: I448dc95baa4976b68ce2659b80498539426775f9
These flags were added for gcc, but are always stripped out when
compiling for clang. Since gcc is barely used, removed them.
Bug: 68855788
Bug: 68947919
Test: m checkbuild
Change-Id: Iae2bda9808dd9499848ce145ccdf71c4c490b80e
Move -fdata-sections and -fno-short-enums to global device flags.
-fdata-sections was not previously set on x86[_64], -fno-short-enums
was not previously set on mips[64].
Bug: 68855788
Test: m checkbuild
Change-Id: I68e64888d5414fc022366eb2b6c5cd92c28a5542
It was previously set on arm[64] and mips[64], this will cause it
to be set for x86[_64] too.
Bug: 68855788
Test: m checkbuild
Change-Id: I75af16e7d259963ad633cc664929144332bb435d
Move ldflags that are specified for all devices into
deviceGlobalLdflags, and add them to linker.go:
-Wl,-z,noexecstack
-Wl,-z,relro
-Wl,-z,now
-Wl,--build-id=md5
-Wl,--warn-shared-textrel
-Wl,--fatal-warnings
-Wl,--no-undefined-version
Bug: 68855788
Test: m checkbuild
Change-Id: I82561b4189287d7638006f9e298c5151f9930c5e
Move cflags that are set on all devices to deviceGlobalCflags:
-fno-canonical-system-headers
-ffunction-sections
-funwind-tables
-fstack-protector-strong
-Wa,--noexecstack
-D_FORTIFY_SOURCE=2
-Wstrict-aliasing=2
-Werror=format-security
Bug: 68855788
Test: m checkbuild
Change-Id: Iefec689fdd2749013d0cc003b3abec674a85fb74
Move all the flags that are used everywhere (or should be used
everywhere) into cc/config/global.go:
-no-canonical-prefixes
-fno-exceptions
-Wno-multichar
-O2
-g
-fno-strict-aliasing
Also remove flags that are already in noOverrideGlobalCflags:
-Werror=pointer-to-int-cast
-Werror=int-to-pointer-cast
x86 and x86_64 were specifying -fstrict-aliasing, but that was
being overriden later by -fno-strict-aliasing, so remove it.
ARM devices still override -fno-strict-aliasing to -fstrict-aliasing
when using ARM (vs. Thumb) instruction set.
Bug: 68855788
Test: m checkbuild
Change-Id: Ia2b5891bdefb60f974ad92b4b84a8548c2dcc7dc
Gold recognizes a different set of emulation strings to specify targets
than the bfd linker accepts. Clang only passes bfd emulations to the
linker, so we need to override these with the versions accepted by gold
when using gold.
Gold normally picks up the correct target from the first ELF input file
if it cannot parse the emulation parameter. However when using LTO, all
objects may be bitcode files, which causes gold to rely on the passed
--oformat or -m parameter to determine the proper target. If gold cannot
parse the emulation string passed by clang, it fails to link.
Test: build LTO version of libc
Change-Id: I38e78bb912fd3cc5fb7b4a762284f50ddd4f3998
Also, update flags for cortex-a53.
Bug: 37647380
Test: Built target with cortex-a73 for both 32 bit/64 bit.
Test: Built target with cortex-a53.cortex-a57 for both 32 bit/64 bit.
Test: Ran bionic unit tests, ran art target tests.
(cherry picked from commit 1d9aa26d44)
Change-Id: I3325f60add7f424f8cca53c22919fc481ef5e787
Clang supports specific CPU targeting and optimization
for Kryo.
This switches us to using the specific Kryo targeting
when Clang is used. For other compilers, we fallback
to cortex-a57 targeting.
Also, move the replaceFirst function to a shared location.
Bug: 36728278
Test: Built and booted sailfish, ran bionic unit tests and art tests.
Test: Disassembled libc.so before this change and after and looked at
Test: the differences. Mostly the results were the order of instructions
Test: changing.
Test: Verified with the clang person (srhines) that our clang has this support
Test: and that it appears to be mostly instruction scheduling changes.
Change-Id: I4ee73d8bcc1e4f5eccb162c18937811fe199b16f
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
* Use mcpu=cortex-a57, since it is the closest to Kryo.
* Clang doesn't support Kryo as a target yet.
Bug: 36728278
Test: Built and booted a sailfish using Kryo.
Change-Id: Ic0c9588d86fba41896e50e3f0cf0d2b310ffee93
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
and export the library name to make. Refactor the code a bit to avoid repeating the library name
multiple times.
Bug: 22033465
Test: Ran external/clang/build.py for aosp-llvm
Change-Id: I25eb3858eb92e1dd493b09524d559802551b2547