Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
Makefile: Fix device not booting with GCC 7.x and above
Browse files Browse the repository at this point in the history
@nathanchance: Filtered from the original commit (zanezam/boeffla-kernel-cm-n51x0@228cc26)

I tested all of the flags in the above commit and this is the only
one that prevented the phone from booting, with -Os, -O2, and -O3.

Without this, the phone will boot to the Google logo, hang for a
few seconds, then reboot, and repeat the process.

This flag can be read about below. This issue can also be resolved
(supposedly) with the -mstrict-align flag, leading me to believe it
is something with memory access. I believe this is a better solution
though given that ARM handles unaligned access perfectly fine.

https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fstore-merging
https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html#index-mstrict-align

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
  • Loading branch information
zanezam authored and nathanchance committed Jun 27, 2017
1 parent baa8a71 commit 406d54a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,9 @@ KBUILD_CFLAGS += $(call cc-disable-warning,unused-const-variable,)
# Disable format-truncation warnings
KBUILD_CFLAGS += $(call cc-disable-warning,format-truncation,)

# Needed to unbreak GCC 7.x and above
KBUILD_CFLAGS += $(call cc-option,-fno-store-merging,)

include $(srctree)/arch/$(SRCARCH)/Makefile

ifdef CONFIG_READABLE_ASM
Expand Down

0 comments on commit 406d54a

Please sign in to comment.