Commit graph

26 commits

Author SHA1 Message Date
Colin Cross
b37620f870 Remove gcc-specific optimizations
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
2017-11-14 17:43:33 +00:00
Colin Cross
ea3141d06d Move some flags to affect all devices
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
2017-11-14 17:43:24 +00:00
Colin Cross
26f14509d1 Move -fvisibility-inlines-hidden to global device cppflags
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
2017-11-13 15:18:19 -08:00
Isaac Chen
2bce8edf34 Generic 32-bit armv8 built as generic armv7 fix
When the following lines are specified in the BoardConfig.mk

TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_CPU_VARIANT := generic

The resulted binaries won't be built using 32-bit armv8-a integer
division instructions. Instead, division routines are used because
the build system will set a compiler option "-march=armv7-a", and
hence overwiting the previous "-march=armv8-a", when
TARGET_2ND_CPU_VARIANT is set to generic (or unset).

Bug: 67446726
Test: lunch aosp_arm64; make -j; emulator # boot to home screen
      Also verify -march=armv7-a is not specified in the compiler
      command line and the resulted binary actually uses integer
      division instructions.

Change-Id: I430687aa5a658d2ec9f325a66d849b4c8898c7d5
2017-11-08 04:17:35 +00:00
Colin Cross
0f1f679f5e Move -fomit-frame-pointer to armCflags
-fomit-frame-pointer was specified twice, once for arm and once for
thumb.  Move it to the shared cflags.

Bug: 68855788
Test: m checkbuild
Change-Id: Iab1299c247808f1a2542b468084600b7c32996e8
2017-11-03 22:28:12 -07:00
Colin Cross
324a457440 Consolidate ldflags that are used on all devices
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
2017-11-03 22:28:03 -07:00
Colin Cross
133dbe7bb0 Consolidate cflags that are set on all devices
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
2017-11-03 11:34:45 -07:00
Colin Cross
7278afc5a8 Consolidate global cflags
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
2017-11-03 11:34:45 -07:00
Elliott Hughes
de28deb460 Unified sysroot: arch-X/include directories are gone.
Bug: N/A
Test: builds
Change-Id: I98fc6a1a3c0be1c90b1deb35b54f36ab16a202ac
2017-10-12 09:07:53 -07:00
Isaac Chen
a2a582413e Revert "Revert "Build support for 32-bit armv8-a""
This reverts commit 80b27e4e20.

Fixed CTS build issue by adding -march=armv7-a in cts/tests/tests/os/jni/Android.mk since the library built here needs/uses instruction (swp) obsolete in ARMv8.

Bug: 64964151
Test: lunch aosp_arm64-userdebug; make -j cts
      lunch aosp_x86-userdebug; make -j cts
      lunch aosp_sailfish-userdebug; make -j cts
      lunch aosp_bullhead-userdebug; make -j cts

Change-Id: I6ccafce043e101c769ad370a81ffa0eb62719b5e
2017-08-23 10:57:17 +00:00
Tobias Thierer
80b27e4e20 Revert "Build support for 32-bit armv8-a"
This reverts commit 9c02066b13.

Reason for revert: Broke the build for some targets (including marlin and angler).

$ make cts
build/core/combo/TARGET_linux-arm.mk:43: kryo is armv8-a.
build/core/combo/TARGET_linux-arm.mk:45: TARGET_2ND_ARCH_VARIANT, armv7-a-neon, ignored! Use armv8-a instead.
[...]
cts/tests/tests/os/jni/android_os_cts_CpuInstructions.cpp:88:20: error: instruction requires: armv7 or earlier
    asm volatile ( "swp r0, r0, [%0]" : "+r"(ptr) : : "r0" );
                   ^
<inline asm>:1:2: note: instantiated into assembly here
        swp r0, r0, [r1]
        ^

Change-Id: I3fa7ca74d88aedf6574855e988d35e341f6e5067
2017-08-21 15:03:26 +00:00
Isaac Chen
9c02066b13 Build support for 32-bit armv8-a
Add armv8-a as a valid/supported 32-bit arm architecture variant. If
some known armv8-a core, like cortex-a53, cortex-a73, etc. is specified
as TARGET(_2ND)_CPU_VARIANT, the associated TARGET(_2ND)_ARCH_VARIANT
will be treated as if armv8-a is specified.

Bug: 62895439
Test: "bionic-unit-tests-static --gtest_filter=*strlen*" on Nexus 4
      (armv7-krait), emulator (armv7), and sailfish (armv8-kryo).
      The test binary for the first 2 is built with armv7-a as its
      TARGET_ARCH_VARIANT; The test binary for the last is built with
      armv8-a as its TARGET_2ND_ARCH_VARIANT.
      TARGET(_2ND)_CPU_VARIANTs of both binaries are set to "generic".

Change-Id: I53bee2974346cf485b2da54cf7aad010b0425910
2017-08-18 19:46:38 +08:00
Stephen Crane
b3c2154f2a Pass correct emulation string to gold
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
2017-08-15 12:54:12 -07:00
Junmo Park
8ea4959279 Add support for Exynos-M1
Change-Id: Ie57507a5d0ea9101db603ff3538c51853083a314
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
2017-07-24 07:14:55 +09:00
Junmo Park
d86c902470 Add support for Exynos-M2.
Change-Id: I646f303b460556a9b36a44574f25dd992d42906c
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
2017-07-22 09:16:31 +09:00
Jake Weinstein
5916657a96 soong: use optimal FPU on Cortex-A15
* Cortex-A15 supports VFPv4 instructions

Test: make otapackage
Test: Built angler with 32 bit variant set to cortex-a15.
Test: Boot this version of the angler, ran bionic unit tests.
Change-Id: I94f00c9486ece201aa2c230308b9f90b0209dc4a
2017-05-17 14:11:33 -07:00
Christopher Ferris
6df46f5d93 Add cortex-a73 support.
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
2017-05-15 12:44:58 -07:00
Colin Cross
0906f17f7e Add arm neon and mips dspr2 arch features
Current modules must use armv7_a_neon to specify source files that
compile only with neon.  If a future arch variant also supports neon,
all these modules will fall back to non-neon.  Support a neon arch
feature that modules can use instead.  Similarly, support dspr2 for
mips.

arm_device.go was also mixing armv7-a-neon with armv7_a_neon.  Use
armv7-a-neon consistently, and fix the - to _ when creating the
property structs.

Test: m -j checkbuild
Change-Id: I24d3764280ab3bcbb9a73c0934edc9b99fc7f6a0
2017-04-27 12:21:24 -07:00
Jake Weinstein
5cfd709529 soong: use optimal FPU for Cortex-A7
* Cortex-A7 supports VFPv4 instructions

Test: make otapackage
Change-Id: I709811980cda398994ba8c6e791a8625a3422455
2017-04-11 14:37:04 -07:00
Jake Weinstein
fff256f817 soong: always use -mfpu=neon-vfpv4 for Krait targets
* GCC and Clang both support this, so we may as well simplify
  the logic.

Test: make otapackage
Test: verified that the options are exactly the same, just slightly different order.

Change-Id: I8c2e9f3875cb662db708c799c9ce54f9fdd55981
2017-04-10 21:32:09 +00:00
Jake Weinstein
1783a2f3e8 soong: use optimal FPU on Kryo targets
* -mfpu=neon-fp-armv8 enables the ARMv8 floating-point and
  Advanced SIMD extensions.

Test: Marlin builds successfully

Change-Id: Ibdf71dae61b966372e3bcb946aa18d1a6cd0f8e6
2017-04-07 14:25:28 -04:00
Alex Naidis
5df73d02ce Make use of specific Kryo targeting in Clang
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>
2017-04-06 14:35:44 -07:00
Alex Naidis
ae4fc18406 Add support for an armv7 variant for Kryo
* Kryo is closer to Krait than to cortex-a53, so choose Krait defaults.

* Made together with Jake Weinstein (xboxfanj)

Bug: 36728278

Test: Built and boot sailfish set up as kryo.

Change-Id: I04fa0a1dca6f97ae19202d28ee3ce8a59bf169b5
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2017-04-04 19:09:36 +00:00
Dan Willemsen
b1957a5021 Dynamically generate arch struct
Now we don't need to hardcode the list of OS/Arch/Variant/Features in
android/arch.go.

Change-Id: I0f9cc35d55baa31f036825fdf5b9dd30d076e56e
2016-09-08 13:50:36 -07:00
Evgenii Stepanov
af36db1178 Add ubsan_standalone library name to the toolchain.
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
2016-08-15 17:05:04 -07:00
Colin Cross
b98c8b0595 Move toolchain and global variables into separate package
Move all of the configuration into a cc/config package

Change-Id: If56fc7242062ed1ce3cb297f78a1e0ef7537373c
2016-08-01 13:37:01 -07:00
Renamed from cc/arm_device.go (Browse further)