Skip to content

Commit d9baa77

Browse files
committed
Revert: '[Squashed] Hell lot of optimization with a hell lot of commits'
LPAE indicates better instructions can be used when atomicity guarantees are needed. However, LPAE's presence isn't advertised by clang/GCC. We fake an ARM feature to advertise its presence on architectures where it is. Also, add a TODO documenting that cortex-a15 is not the correct CPU variant for krait. Change-Id: I02a1248025c32d94eca0bc8a249dc524f1ac9c36 Signed-off-by: Chet Kener <[email protected]> Conflicts: core/combo/arch/arm/armv7-a-neon.mk OptiPop Optimizations V2 * A squash of al lof the optimizations added since November 2014. This the build setup I find works best for my Nexus 5 after hundreds of hours of testing. Options you can enable in bashrc using exports or BoardConfig.mk by just adding as follows: GRAPHITE_OPTS=true - Enables Graphite Optimizations STRICT_ALIASING=true - Enabled Strict Aliasing Optimizations USE_O3_OPTIMIZATIONS=true - Enables Clang and GCC -O3 Optimizations USE_HOST_4_8=true - Switches from default Host GCC 4.6 Toolchain to the latest Google GCC 4.8 Host Toolchain KRAIT_TUNINGS=true - Enables cortex-a15 tunings that work well with krait CPUs ENABLE_GCCONLY=true - Enables many extra GCC Flags for things built with GCC (and also avoids clang because these flags are not supported by clang) TARGET_USE_PIPE=true - Enable pipe flags which by my testing speed up the build by 5 minutes on regular hard drives (not really needed on SSD) FLOOP_NEST_OPTIMIZE=true - Very Aggressive Optimization which I enabled for ART/Bionic learn more here: http://en.wikipedia.org/wiki/Loop_nest_optimization Signed-off-by: Chet Kener <[email protected]> Add Toolchain Version to Lunch Menu Signed-off-by: Chet Kener <[email protected]> armv7-a: More Specific Tunings per CPU * Also add some substitutions and ignores for clang. Signed-off-by: Chet Kener <[email protected]> Conflicts: core/combo/arch/arm/armv7-a-neon.mk Disable Strict on Linker Signed-off-by: Chet Kener <[email protected]> Fix Graphite Compile Signed-off-by: Chet Kener <[email protected]> Restore Missing -fgraphite-identity * Somehow this went missing when copying grpahite flags from Kernel to ROM. Thanks to @ImTheReas0n for noticing so we can have the best optimization possible. Signed-off-by: Chet Kener <[email protected]> Fix Graphite Compile on GCC 4.9 Signed-off-by: Chet Kener <[email protected]> Update Floop Nest Optimize Module List Signed-off-by: Chet Kener <[email protected]> GCC 4.9 Fix Compile Signed-off-by: Chet Kener <[email protected]> Strict: Fix N6 Camera build Signed-off-by: Chet Kener <[email protected]> Fix The N6 Camera for Real! Signed-off-by: Chet Kener <[email protected]> optipop.mk:ffast-math:initial introduction clang: Introduce and guard LDFlags We have not been fully taking advantage of clang. Let's include some linker flags that work on clang similar to what we are doing with GCC stuff. Signed-off-by: Chet Kener <[email protected]> host: Allow more arch flexibility Prescott tuning may not always be the best option. Also be aware that allowing -march=native will not work correctly with anything that is not Linux. Mac and Windows users beware!!! Sources: https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html Signed-off-by: Chet Kener <[email protected]> arm: Update filter to 5.0 * Let's make sure we never have to worry about this Signed-off-by: Chet Kener <[email protected]> Remove "-g" globally * -g is pretty worthless if you ask me. Read here for more info https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html Signed-off-by: Chet Kener <[email protected]> Add krait as a CPU_VARIANT for arm flags....wtf CM Change-Id: Ic057eff15310c91dc7dc3aff32379b99266180a5 optipop.mk :add some restrictions for graphite Change-Id: I6c5de3c10eafbc228b7f9ea5735cf749cea747d0 optipop.mk :add some restrictions for strict Change-Id: Ica80d34278b988c51706779a3cef992781f3ab09 Add PThread Change-Id: I054a3e257b38fec411224953a606745a71276649 optipop:mk: remove libc_bionic and libc_dns from force disable strict Change-Id: Id8b157d1de021e0ebc5d246a4b7cf53676eb2d5c dumpvar:print all build optimizations Change-Id: Icc7a6d949d412afa96aac0cf5c8c6c182aefebff force arm-eabi-4.8 for kernel Disable strict aliasing for malloc Signed-off-by: CallMeAldy <[email protected]>
1 parent 6ea7336 commit d9baa77

17 files changed

+54
-733
lines changed

core/binary.mk

-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ else
9797
endif
9898
endif
9999

100-
include $(BUILD_SYSTEM)/optipop.mk
101-
102100
# The following LOCAL_ variables will be modified in this file.
103101
# Because the same LOCAL_ variables may be used to define modules for both 1st arch and 2nd arch,
104102
# we can't modify them in place.

core/clang/HOST_x86_common.mk

-42
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,14 @@ CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CFLAGS := \
1515
-no-integrated-as
1616

1717
ifneq ($(strip $($(clang_2nd_arch_prefix)HOST_IS_64_BIT)),)
18-
ifeq ($(USE_HOST_4_8),true)
1918
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS := \
2019
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
2120
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
2221
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8 \
2322
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8/x86_64-linux \
2423
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8/backward \
2524
-no-integrated-as
26-
else
27-
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS := \
28-
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
29-
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
30-
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6 \
31-
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/x86_64-linux \
32-
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/backward \
33-
-no-integrated-as
34-
endif
3525

36-
ifeq ($(USE_HOST_4_8),true)
3726
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \
3827
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
3928
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
@@ -43,35 +32,14 @@ CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \
4332
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/lib64/ \
4433
-no-integrated-as
4534
else
46-
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \
47-
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
48-
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
49-
-B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/bin \
50-
-B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6 \
51-
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6 \
52-
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/lib64/ \
53-
-no-integrated-as
54-
endif
55-
else
56-
ifeq ($(USE_HOST_4_8),true)
5735
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS := \
5836
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
5937
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
6038
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8 \
6139
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8/x86_64-linux/32 \
6240
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.8/backward \
6341
-no-integrated-as
64-
else
65-
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CPPFLAGS := \
66-
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
67-
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
68-
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6 \
69-
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/x86_64-linux/32 \
70-
-isystem $($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/include/c++/4.6/backward \
71-
-no-integrated-as
72-
endif
7342

74-
ifeq ($(USE_HOST_4_8),true)
7543
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \
7644
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
7745
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
@@ -80,16 +48,6 @@ CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \
8048
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.8/32 \
8149
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/lib32/ \
8250
-no-integrated-as
83-
else
84-
CLANG_CONFIG_x86_LINUX_HOST_EXTRA_LDFLAGS := \
85-
--gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
86-
--sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot \
87-
-B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/bin \
88-
-B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6/32 \
89-
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/lib/gcc/x86_64-linux/4.6/32 \
90-
-L$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/lib32/ \
91-
-no-integrated-as
92-
endif
9351
endif
9452
endif # Linux
9553

core/clang/arm.mk

+3-11
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,11 @@ CLANG_CONFIG_arm_UNKNOWN_CFLAGS := \
2222
-fno-builtin-sin \
2323
-fno-strict-volatile-bitfields \
2424
-fno-align-jumps \
25-
-Wa,--noexecstack \
26-
-Wno-unused-local-typedefs \
27-
-fpredictive-commoning \
28-
-ftree-loop-distribute-patterns \
29-
-fvect-cost-model \
30-
-ftree-partial-pre \
31-
-fipa-cp-clone \
32-
-mvectorize-with-neon-quad
25+
-Wa,--noexecstack
3326

3427
define subst-clang-incompatible-arm-flags
3528
$(subst -march=armv5te,-march=armv5t,\
3629
$(subst -march=armv5e,-march=armv5,\
37-
$(subst -mfpu=neon-vfpv3,-mfpu=neon,\
38-
$(subst -mfpu=neon-vfpv4,-mfpu=neon,\
39-
$(1)))))
30+
$(subst -mcpu=cortex-a15,-march=armv7-a,\
31+
$(1))))
4032
endef

core/clang/arm64.mk

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ CLANG_CONFIG_arm64_UNKNOWN_CFLAGS := \
2020

2121
# We don't have any arm64 flags to substitute yet.
2222
define subst-clang-incompatible-arm64-flags
23-
$(subst -mfpu=neon-vfpv4,-mfpu=neon,\
24-
$(1))
23+
$(1)
2524
endef

core/clang/config.mk

-6
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,9 @@ endif
3131

3232
# Clang flags for all host or target rules
3333
CLANG_CONFIG_EXTRA_ASFLAGS :=
34-
ifeq ($(USE_O3_OPTIMIZATIONS),true)
35-
CLANG_CONFIG_EXTRA_CFLAGS := -O3 -Qunused-arguments -Wno-unknown-warning-option
36-
CLANG_CONFIG_EXTRA_CPPFLAGS := -O3 -Qunused-arguments -Wno-unknown-warning-option -D__compiler_offsetof=__builtin_offsetof
37-
CLANG_CONFIG_EXTRA_LDFLAGS := -Wl,--sort-common
38-
else
3934
CLANG_CONFIG_EXTRA_CFLAGS :=
4035
CLANG_CONFIG_EXTRA_CPPFLAGS :=
4136
CLANG_CONFIG_EXTRA_LDFLAGS :=
42-
endif
4337

4438
CLANG_CONFIG_EXTRA_CFLAGS += \
4539
-D__compiler_offsetof=__builtin_offsetof

core/combo/HOST_linux-x86.mk

+3-11
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
# Included by combo/select.mk
1919

2020
ifeq ($(strip $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)),)
21-
ifeq ($(USE_HOST_4_8),true)
22-
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/bin/x86_64-linux-
23-
else
24-
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux-
25-
endif
21+
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/bin/x86_64-linux-
2622
endif
2723
# Don't do anything if the toolchain is not there
2824
ifneq (,$(strip $(wildcard $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc)))
@@ -32,14 +28,10 @@ $(combo_2nd_arch_prefix)HOST_AR := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PRE
3228
endif # $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc exists
3329

3430
# gcc location for clang; to be updated when clang is updated
35-
ifeq ($(USE_HOST_4_8),true)
36-
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/
37-
else
38-
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/
39-
endif
31+
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/
4032

4133
# We expect SSE3 floating point math.
42-
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mstackrealign -msse3 -mfpmath=sse -m32 -Wa,--noexecstack -march=native
34+
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mstackrealign -msse3 -mfpmath=sse -m32 -Wa,--noexecstack -march=prescott
4335
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -m32 -Wl,-z,noexecstack
4436

4537
ifneq ($(strip $(BUILD_HOST_static)),)

core/combo/HOST_linux-x86_64.mk

+3-11
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
# Included by combo/select.mk
1919

2020
ifeq ($(strip $(HOST_TOOLCHAIN_PREFIX)),)
21-
ifeq ($(USE_HOST_4_8),true)
22-
HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/bin/x86_64-linux-
23-
else
24-
HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux-
25-
endif
21+
HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/bin/x86_64-linux-
2622
endif
2723
# Don't do anything if the toolchain is not there
2824
ifneq (,$(strip $(wildcard $(HOST_TOOLCHAIN_PREFIX)gcc)))
@@ -32,13 +28,9 @@ HOST_AR := $(HOST_TOOLCHAIN_PREFIX)ar
3228
endif # $(HOST_TOOLCHAIN_PREFIX)gcc exists
3329

3430
# gcc location for clang; to be updated when clang is updated
35-
ifeq ($(USE_HOST_4_8),true)
36-
HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/
37-
else
38-
HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/
39-
endif
31+
HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/
4032

41-
HOST_GLOBAL_CFLAGS += -m64 -Wa,--noexecstack -march=native
33+
HOST_GLOBAL_CFLAGS += -m64 -Wa,--noexecstack
4234
HOST_GLOBAL_LDFLAGS += -m64 -Wl,-z,noexecstack
4335

4436
ifneq ($(strip $(BUILD_HOST_static)),)

core/combo/TARGET_linux-arm.mk

+23-18
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := armv5te
3535
endif
3636

3737
# Decouple NDK library selection with platform compiler version
38-
$(combo_2nd_arch_prefix)TARGET_NDK_GCC_VERSION := 4.9
38+
$(combo_2nd_arch_prefix)TARGET_NDK_GCC_VERSION := 4.8
3939

4040
ifeq ($(strip $(TARGET_GCC_VERSION_EXP)),)
41-
$(combo_2nd_arch_prefix)TARGET_GCC_VERSION := 4.9
41+
$(combo_2nd_arch_prefix)TARGET_GCC_VERSION := 4.8
4242
else
4343
$(combo_2nd_arch_prefix)TARGET_GCC_VERSION := $(TARGET_GCC_VERSION_EXP)
4444
endif
@@ -67,13 +67,16 @@ $(combo_2nd_arch_prefix)TARGET_STRIP := $($(combo_2nd_arch_prefix)TARGET_TOOLS_P
6767

6868
$(combo_2nd_arch_prefix)TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
6969

70-
ifeq ($(USE_O3_OPTIMIZATIONS),true)
71-
$(combo_2nd_arch_prefix)TARGET_arm_CFLAGS := -O3 -DNDEBUG -pipe -fomit-frame-pointer -funswitch-loops -fno-tree-vectorize -fno-inline-functions -fivopts -ffunction-sections -fdata-sections -frename-registers -fomit-frame-pointer -ftracer -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-maybe-uninitialized
72-
$(combo_2nd_arch_prefix)TARGET_thumb_CFLAGS := -mthumb -Os -DNDEBUG -pipe -fomit-frame-pointer -fstrict-aliasing -fno-tree-vectorize -fno-inline-functions -fno-unswitch-loops -fivopts -ffunction-sections -fdata-sections -ftracer -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-clobbered -Wno-strict-overflow
73-
else
74-
$(combo_2nd_arch_prefix)TARGET_arm_CFLAGS := -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops
75-
$(combo_2nd_arch_prefix)TARGET_thumb_CFLAGS := -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing
76-
endif
70+
$(combo_2nd_arch_prefix)TARGET_arm_CFLAGS := -O2 \
71+
-fomit-frame-pointer \
72+
-fstrict-aliasing \
73+
-funswitch-loops
74+
75+
# Modules can choose to compile some source as thumb.
76+
$(combo_2nd_arch_prefix)TARGET_thumb_CFLAGS := -mthumb \
77+
-Os \
78+
-fomit-frame-pointer \
79+
-fno-strict-aliasing
7780

7881
# Set FORCE_ARM_DEBUGGING to "true" in your buildspec.mk
7982
# or in your environment to force a full arm build, even for
@@ -85,14 +88,13 @@ endif
8588
# with -mlong-calls. When built at -O0, those libraries are
8689
# too big for a thumb "BL <label>" to go from one end to the other.
8790
ifeq ($(FORCE_ARM_DEBUGGING),true)
88-
$(combo_2nd_arch_prefix)TARGET_arm_CFLAGS += -fno-omit-frame-pointer
91+
$(combo_2nd_arch_prefix)TARGET_arm_CFLAGS += -fno-omit-frame-pointer -fno-strict-aliasing
8992
$(combo_2nd_arch_prefix)TARGET_thumb_CFLAGS += -marm -fno-omit-frame-pointer
9093
endif
9194

9295
android_config_h := $(call select-android-config-h,linux-arm)
9396

9497
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
95-
-pipe \
9698
-msoft-float \
9799
-ffunction-sections \
98100
-fdata-sections \
@@ -112,7 +114,7 @@ $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
112114
# "-Wall -Werror" due to a commom idiom "ALOGV(mesg)" where ALOGV is turned
113115
# into no-op in some builds while mesg is defined earlier. So we explicitly
114116
# disable "-Wunused-but-set-variable" here.
115-
ifneq ($(filter 4.6 4.6.% 4.7 4.7.% 4.8 4.8.% 4.9 4.9.% 5.0 5.0.%, $($(combo_2nd_arch_prefix)TARGET_GCC_VERSION)),)
117+
ifneq ($(filter 4.6 4.6.% 4.7 4.7.% 4.8, $($(combo_2nd_arch_prefix)TARGET_GCC_VERSION)),)
116118
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += -fno-builtin-sin \
117119
-fno-strict-volatile-bitfields
118120
endif
@@ -138,13 +140,16 @@ $(combo_2nd_arch_prefix)TARGET_GLOBAL_LDFLAGS += \
138140

139141
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += -mthumb-interwork
140142

141-
ifeq ($(USE_O3_OPTIMIZATIONS),true)
142-
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CPPFLAGS += -fvisibility-inlines-hidden -O3 -DNDEBUG -pipe -fivopts -ffunction-sections -fdata-sections -funswitch-loops -fomit-frame-pointer -ftracer -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-maybe-uninitialized
143-
$(combo_2nd_arch_prefix)TARGET_RELEASE_CFLAGS := -O3 -DNDEBUG -pipe -frerun-cse-after-loop -frename-registers -fstrict-aliasing -fivopts -ffunction-sections -fdata-sections -funswitch-loops -fomit-frame-pointer -ftracer -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-maybe-uninitialized
144-
else
145143
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CPPFLAGS += -fvisibility-inlines-hidden
146-
$(combo_2nd_arch_prefix)TARGET_RELEASE_CFLAGS := -DNDEBUG -Wstrict-aliasing=2 -fgcse-after-reload -frerun-cse-after-loop -frename-registers
147-
endif
144+
145+
# More flags/options can be added here
146+
$(combo_2nd_arch_prefix)TARGET_RELEASE_CFLAGS := \
147+
-DNDEBUG \
148+
-g \
149+
-Wstrict-aliasing=2 \
150+
-fgcse-after-reload \
151+
-frerun-cse-after-loop \
152+
-frename-registers
148153

149154
libc_root := bionic/libc
150155
libm_root := bionic/libm

core/combo/TARGET_linux-arm64.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ TARGET_GLOBAL_CPPFLAGS += -fvisibility-inlines-hidden
118118
# More flags/options can be added here
119119
TARGET_RELEASE_CFLAGS := \
120120
-DNDEBUG \
121-
-O2 \
121+
-O2 -g \
122122
-Wstrict-aliasing=2 \
123123
-fgcse-after-reload \
124124
-frerun-cse-after-loop \

core/combo/TARGET_linux-mips.mk

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ $(combo_2nd_arch_prefix)TARGET_GLOBAL_CPPFLAGS += -fvisibility-inlines-hidden
113113
# More flags/options can be added here
114114
$(combo_2nd_arch_prefix)TARGET_RELEASE_CFLAGS := \
115115
-DNDEBUG \
116+
-g \
116117
-Wstrict-aliasing=2 \
117118
-fgcse-after-reload \
118119
-frerun-cse-after-loop \

core/combo/TARGET_linux-mips64.mk

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ TARGET_GLOBAL_CPPFLAGS += -fvisibility-inlines-hidden
113113
# More flags/options can be added here
114114
TARGET_RELEASE_CFLAGS := \
115115
-DNDEBUG \
116+
-g \
116117
-Wstrict-aliasing=2 \
117118
-fgcse-after-reload \
118119
-frerun-cse-after-loop \

core/combo/arch/arm/armv7-a-neon.mk

+11-18
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,22 @@ ARCH_ARM_HAVE_VFP_D32 := true
77
ARCH_ARM_HAVE_NEON := true
88

99
ifneq (,$(filter cortex-a15 krait denver,$(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)))
10-
# TODO: krait is not a cortex-a15, we set the variant to cortex-a15 so that
11-
# hardware divide operations are generated. This should be removed and a
12-
# krait CPU variant added to GCC/clang.
13-
arch_variant_cflags := -mcpu=cortex-a15 -mfpu=neon-vfpv4 -mvectorize-with-neon-quad
14-
15-
# Fake ARM compiler flags as these processors support LPAE and VFP4 which GCC/clang
16-
# doesn't advertise.
17-
arch_variant_cflags += -D__ARM_FEATURE_LPAE=1 -D__ARM_FEATURE_VFP4=1
18-
else
19-
ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)),cortex-a9)
20-
arch_variant_cflags := -mcpu=cortex-a9 -mfpu=neon
10+
arch_variant_cflags := -mcpu=cortex-a15
2111
else
22-
ifneq (,$(filter cortex-a8 scorpion,$(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)))
23-
arch_variant_cflags := -mcpu=cortex-a8 -mfpu=neon
24-
arch_variant_ldflags := -Wl,--fix-cortex-a8
12+
ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)),cortex-a8)
13+
arch_variant_cflags := -mcpu=cortex-a8
2514
else
2615
ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)),cortex-a7)
27-
arch_variant_cflags := -mcpu=cortex-a7 -mfpu=neon
16+
arch_variant_cflags := -mcpu=cortex-a7
2817
else
29-
arch_variant_cflags := -march=armv7-a -mfpu=neon
30-
endif
18+
arch_variant_cflags := -march=armv7-a
3119
endif
3220
endif
3321
endif
22+
3423
arch_variant_cflags += \
35-
-mfloat-abi=softfp
24+
-mfloat-abi=softfp \
25+
-mfpu=neon
26+
27+
arch_variant_ldflags := \
28+
-Wl,--fix-cortex-a8

core/combo/select.mk

+2-8
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,11 @@ $(combo_var_prefix)HAVE_STRERROR_R_STRRET := 1
4848
$(combo_var_prefix)HAVE_STRLCPY := 0
4949
$(combo_var_prefix)HAVE_STRLCAT := 0
5050
$(combo_var_prefix)HAVE_KERNEL_MODULES := 0
51-
ifeq ($(USE_O3_OPTIMIZATIONS),true)
52-
$(combo_var_prefix)GLOBAL_CFLAGS := -O3 -DNDEBUG -pipe -fivopts -ffunction-sections -fdata-sections -funswitch-loops -fomit-frame-pointer -ftracer -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-exceptions -Wno-multichar
53-
$(combo_var_prefix)RELEASE_CFLAGS := -O3 -DNDEBUG -pipe -fivopts -ffunction-sections -fdata-sections -funswitch-loops -fomit-frame-pointer -ftracer -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-maybe-uninitialized
54-
$(combo_var_prefix)GLOBAL_CPPFLAGS := -O3 -DNDEBUG -pipe -fivopts -ffunction-sections -fdata-sections -funswitch-loops -fomit-frame-pointer -ftracer -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-maybe-uninitialized
55-
$(combo_var_prefix)GLOBAL_LDFLAGS := -Wl,-O1 -Wl,--as-needed -Wl,--relax -Wl,--sort-common -Wl,--gc-sections
56-
else
51+
5752
$(combo_var_prefix)GLOBAL_CFLAGS := -fno-exceptions -Wno-multichar
58-
$(combo_var_prefix)RELEASE_CFLAGS := -O2 -fno-strict-aliasing
53+
$(combo_var_prefix)RELEASE_CFLAGS := -O2 -g -fno-strict-aliasing
5954
$(combo_var_prefix)GLOBAL_CPPFLAGS :=
6055
$(combo_var_prefix)GLOBAL_LDFLAGS :=
61-
endif
6256
$(combo_var_prefix)GLOBAL_ARFLAGS := crsPD
6357
$(combo_var_prefix)GLOBAL_LD_DIRS :=
6458

0 commit comments

Comments
 (0)