Skip to content

Instantly share code, notes, and snippets.

@ISTweak
Created June 22, 2013 15:46
Show Gist options
  • Save ISTweak/5841340 to your computer and use it in GitHub Desktop.
Save ISTweak/5841340 to your computer and use it in GitHub Desktop.
gcc4.7.4でも起動しない
diff --git a/Makefile b/Makefile
index 7108249..ce504d3 100644
--- a/Makefile
+++ b/Makefile
@@ -171,6 +171,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
-e s/sh[234].*/sh/ )
+SUBARCH := arm
# Cross compiling and selecting different set of gcc/bin-utils
# ---------------------------------------------------------------------------
#
@@ -191,8 +192,10 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
# "make" in the configured kernel build directory always uses that.
# Default value for CROSS_COMPILE is not to prefix executables
# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
+SUBARCH := arm
export KBUILD_BUILDHOST := $(SUBARCH)
-ARCH ?=arm
+ARCH ?= $(SUBARCH)
+CROSS_COMPILE ?= arm-eabi-
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
# Architecture as present in compile.h
@@ -245,8 +248,13 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
HOSTCC = gcc
HOSTCXX = g++
+ifdef CONFIG_CC_OPTIMIZE_ALOT
+HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O3 -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -fsingle-precision-constant -ftree-vectorize -fomit-frame-pointer
+HOSTCXXFLAGS = -O3 -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -fsingle-precision-constant -mtune=cortex-a8 -marm -march=armv7-a -mfpu=neon -ftree-vectorize -mvectorize-with-neon-double
+else
HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
HOSTCXXFLAGS = -O2
+endif
# Decide whether to build built-in, modular, or both.
# Normally, just do built-in.
@@ -344,18 +352,28 @@ DEPMOD = /sbin/depmod
KALLSYMS = scripts/kallsyms
PERL = perl
CHECK = sparse
+
# Use the wrapper for the compiler. This wrapper scans for new
# warnings and causes the build to stop upon encountering them.
CC = $(srctree)/scripts/gcc-wrapper.py $(REAL_CC)
-#CC = $(CROSS_COMPILE)gcc
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void $(CF)
-CFLAGS_MODULE =
-AFLAGS_MODULE =
-LDFLAGS_MODULE =
-CFLAGS_KERNEL =
-AFLAGS_KERNEL =
+ifdef CONFIG_CC_OPTIMIZE_ALOT
+MODFLAGS = -DMODULE -O2 -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -fsingle-precision-constant -mtune=cortex-a8 -marm -march=armv7-a -mfpu=neon -ftree-vectorize -mvectorize-with-neon-double
+else
+MODFLAGS =
+endif
+CFLAGS_MODULE = -fno-pic
+AFLAGS_MODULE = $(MODFLAGS)
+LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds
+ifdef CONFIG_CC_OPTIMIZE_ALOT
+CFLAGS_KERNEL = -O3 -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -fsingle-precision-constant -mtune=cortex-a8 -marm -march=armv7-a -mfpu=neon -ftree-vectorize -mvectorize-with-neon-double
+AFLAGS_KERNEL = -O3 -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -fsingle-precision-constant -mtune=cortex-a8 -marm -march=armv7-a -mfpu=neon -ftree-vectorize -mvectorize-with-neon-double
+else
+CFLAGS_KERNEL = -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -ffast-math -fsingle-precision-constant -mtune=cortex-a8 -march=armv7-a -mfpu=neon
+AFLAGS_KERNEL =
+endif
CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
@@ -366,32 +384,29 @@ LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-include include/generated/autoconf.h
+ifdef CONFIG_CC_OPTIMIZE_ALOT
+KBUILD_CPPFLAGS := -D__KERNEL__ -O3 -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -fsingle-precision-constant -mtune=cortex-a8 -marm -march=armv7-a -mfpu=neon -ftree-vectorize -mvectorize-with-neon-double
+else
KBUILD_CPPFLAGS := -D__KERNEL__
+endif
-KBUILD_CFLAGS := -Wall -Werror -Wundef -Wstrict-prototypes -Wno-trigraphs \
+KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common \
-Werror-implicit-function-declaration \
- -Wno-format-security -Wno-unused \
- -fno-delete-null-pointer-checks
-ifeq ($(USE_CFLAGS_OPTION),y)
-MODFLAGS = -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -ffast-math \
- -fsingle-precision-constant -mcpu=cortex-a9 -mtune=cortex-a9 -marm -mfpu=neon \
- -mfpu=neon-vfpv4
-endif
-KBUILD_AFLAGS_KERNEL :=
-ifeq ($(USE_CFLAGS_OPTION),y)
-KBUILD_CFLAGS_KERNEL := $(MODFLAGS)
+ -Wno-format-security \
+ -fno-delete-null-pointer-checks -Wno-unused-variable
+ifdef CONFIG_CC_OPTIMIZE_ALOT
+KBUILD_AFLAGS_KERNEL := -O3 -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -fsingle-precision-constant -mtune=cortex-a8 -marm -march=armv7-a -mfpu=neon -ftree-vectorize -mvectorize-with-neon-double
+KBUILD_CFLAGS_KERNEL := -O3 -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -fsingle-precision-constant -mtune=cortex-a8 -marm -march=armv7-a -mfpu=neon -ftree-vectorize -mvectorize-with-neon-double
else
+KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
endif
KBUILD_AFLAGS := -D__ASSEMBLY__
KBUILD_AFLAGS_MODULE := -DMODULE
-ifeq ($(USE_CFLAGS_OPTION),y)
-KBUILD_CFLAGS_MODULE := -DMODULE $(MODFLAGS)
-else
-KBUILD_CFLAGS_MODULE := -DMODULE
-endif
+KBUILD_CFLAGS_MODULE := -DMODULE -fgcse-lm -fgcse-sm -fsched-spec-load -fforce-addr -ffast-math -fsingle-precision-constant -mtune=cortex-a8 -march=armv7-a -mfpu=neon
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
+KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
@@ -575,15 +590,18 @@ endif # $(dot-config)
# Defaults to vmlinux, but the arch makefile usually adds further targets
all: vmlinux
-ifdef CONFIG_USA_MODEL_SGH_I757
-CC = $(CROSS_COMPILE)gcc
-endif
-
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
-else
+endif
+ifdef CONFIG_CC_OPTIMIZE_DEFAULT
KBUILD_CFLAGS += -O2
endif
+ifdef CONFIG_CC_OPTIMIZE_ALOT
+KBUILD_CFLAGS += -O3
+endif
+ifdef CONFIG_CC_OPTIMIZE_FAST
+KBUILD_CFLAGS += -Ofast
+endif
include $(srctree)/arch/$(SRCARCH)/Makefile
@@ -599,6 +617,11 @@ endif
# This warning generated too much noise in a regular build.
# Use make W=1 to enable this warning (see scripts/Makefile.build)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
+KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
+KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds)
+KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
+KBUILD_CFLAGS += $(call cc-disable-warning, sizeof-pointer-memaccess)
+KBUILD_CFLAGS += $(call cc-disable-warning, aggressive-loop-optimizations)
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index c60dd35..fefe05d 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -57,11 +57,7 @@ comma = ,
# Note that GCC does not numerically define an architecture version
# macro, but instead defines a whole series of macros which makes
# testing for a specific architecture or later rather impossible.
-ifeq ($(USE_CFLAGS_OPTION),y)
-arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-mcpu=cortex-a9,-march=armv5t -Wa$(comma)-march=armv7-a)
-else
arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
-endif
arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
# Only override the compiler option if ARMv6. The ARMv6K extensions are
# always available in ARMv7
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index e09febd..83b1c9d 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -127,6 +127,8 @@ endif
ccflags-y := -fpic -fno-builtin -I$(obj)
asflags-y := -Wa,-march=all
+# ccflags-y := -fpic -fno-builtin
+# asflags-y := -Wa,-march=armv7-a$(plus_sec)
# Supply kernel BSS size to the decompressor via a linker symbol.
SIZEBIN := $(if $(shell which $(CROSS_COMPILE)size),$(CROSS_COMPILE)size,size)
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 786f70d..8709001 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -83,6 +83,7 @@ target += smd_rpc_sym.c
$(obj)/smd_rpc_sym.c: $(src)/smd_rpc_sym $(src)/mkrpcsym.pl
$(call if_changed,mkrpcsym)
+CFLAGS_scm.o := $(call as-instr, .arch_extension sec, -DREQUIRES_SEC=1)
obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o
obj-$(CONFIG_MSM_SECURE_IO) += scm-io.o
obj-$(CONFIG_MSM_PIL) += peripheral-loader.o
diff --git a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile
index ee9f408..ec624f0 100644
--- a/arch/arm/vfp/Makefile
+++ b/arch/arm/vfp/Makefile
@@ -6,11 +6,8 @@
# ccflags-y := -DDEBUG
# asflags-y := -DDEBUG
-ifeq ($(USE_CFLAGS_OPTION),y)
-KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=neon-vfpv4 -mfloat-abi=soft)
-else
-KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp)
-endif
+
+KBUILD_AFLAGS :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=neon)
LDFLAGS +=--no-warn-mismatch
obj-y += vfp.o
diff --git a/scripts/gcc-wrapper.py b/scripts/gcc-wrapper.py
index 5abcf8d..f982c96 100755
--- a/scripts/gcc-wrapper.py
+++ b/scripts/gcc-wrapper.py
@@ -65,6 +65,12 @@ allowed_warnings = set([
"dma-mapping.c:238",
"dma-mapping.c:284",
"xt_log.h:50",
+ "adreno.c:702",
+ "adreno.c:716",
+ "adreno.c:779",
+ "adreno.c:946",
+ "cypress-touchkey.c:612",
+ "msm_fb.c:3229",
])
# Capture the name of the object file, can find it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment