Skip to content

Commit 5eb5ea6

Browse files
committed
arm: compile all thumb with -mthumb-interwork and cleanup -O3
To enable this option use ENABLE_ARM_THUMB_INTERWORK := true This may slightly increase binary size but will include more arm instructions for increased performance. https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html Change-Id: I0ba0a2d34b84e34309c20ce0cbb85ea3ee6dda15 Signed-off-by: Paul Beeler <[email protected]>
1 parent 37fb144 commit 5eb5ea6

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

core/binary.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ endif
114114

115115
# Include custom gcc flags. Seperate them so they can be easily managed.
116116

117+
# arm thumb
118+
ifeq ($(strip $(ENABLE_ARM_THUMB_INTERWORK)),true)
119+
ifneq ($(strip $(LOCAL_IS_HOST_MODULE)),true)
120+
include $(BUILD_SYSTEM)/thumb_interwork.mk
121+
endif
122+
endif
123+
117124
# O3
118125
ifeq ($(strip $(O3_OPTIMIZATIONS)),true)
119126
include $(BUILD_SYSTEM)/O3.mk

core/thumb_interwork.mk

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (C) 2014-2015 The SaberMod Project
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
# Copyright (C) 2014-2015 The SaberMod Project
17+
#
18+
# Licensed under the Apache License, Version 2.0 (the "License");
19+
# you may not use this file except in compliance with the License.
20+
# You may obtain a copy of the License at
21+
#
22+
# http://www.apache.org/licenses/LICENSE-2.0
23+
#
24+
# Unless required by applicable law or agreed to in writing, software
25+
# distributed under the License is distributed on an "AS IS" BASIS,
26+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27+
# See the License for the specific language governing permissions and
28+
# limitations under the License.
29+
#
30+
31+
ifeq ($(strip (TARGET_ARCH)),arm)
32+
ifneq (1,$(words $(filter $(LOCAL_DISABLE_THUMB_INTERWORK),$(LOCAL_MODULE))))
33+
ifdef LOCAL_CFLAGS
34+
LOCAL_CFLAGS += \
35+
-mthumb-interwork
36+
else
37+
LOCAL_CFLAGS := \
38+
-mthumb-interwork
39+
endif
40+
endif
41+
endif

0 commit comments

Comments
 (0)