Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reapplied clang patches onto your latest mko-v2 work #5

Open
wants to merge 127 commits into
base: mko-v2-clang
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
b7d2645
iommu: msm: Update from kerneltoast
stendro Jul 30, 2019
f006940
build: ak: Update AnyKernel
stendro Aug 3, 2019
90ec28d
BACKPORT: binder: Set end of SG buffer area properly.
Jul 9, 2019
5996f5d
UPSTREAM: include/linux/dcache.h: use unsigned chars in struct name_s…
sfrothwell Jul 12, 2017
240ac48
BACKPORT: Makefile: Fix detection of clang when cross-compiling
pcercuei Apr 17, 2015
844c30f
BACKPORT: kbuild: Fix clang detection
Aug 19, 2015
a94af42
UPSTREAM: kbuild: Add better clang cross build support
behanw Apr 21, 2017
899d6e3
UPSTREAM: kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS
calcodion Apr 25, 2017
e80d809
UPSTREAM: kbuild: merge bounds.h and asm-offsets.h rules
masahir0y Jan 5, 2015
31b1a29
UPSTREAM: kbuild: remove redundant line from bounds.h/asm-offsets.h
masahir0y Jan 5, 2015
954be76
UPSTREAM: kbuild: Don't reset timestamps in include/generated if not …
michal42 Mar 11, 2015
b21aa72
UPSTREAM: kbuild: do not add $(bounds-file) and $(offsets-file) to ta…
masahir0y Mar 26, 2015
93827bb
BACKPORT: kbuild: Consolidate header generation from ASM offset infor…
Apr 12, 2017
4091fec
UPSTREAM: kbuild: consolidate redundant sed script ASM offset generation
masahir0y Apr 21, 2017
36d1f1e
UPSTREAM: kbuild: fix asm-offset generation to work with clang
jhofstee Apr 21, 2017
6562ec9
BACKPORT: kbuild, LLVMLinux: Add -Werror to cc-option to support clang
Apr 5, 2017
76bcf8b
UPSTREAM: kbuild: drop -Wno-unknown-warning-option from clang options
masahir0y Apr 12, 2017
ea8b9d1
BACKPORT: kbuild: use -Oz instead of -Os when using clang
behanw Mar 28, 2017
54b01cb
BACKPORT: kbuild: Add support to generate LLVM assembly files
tinti Apr 24, 2017
6207a06
UPSTREAM: modules: mark __inittest/__exittest as __maybe_unused
arndb Feb 1, 2017
5ea5c24
UPSTREAM: Kbuild: provide a __UNIQUE_ID for clang
arndb Feb 8, 2016
24bcb2c
UPSTREAM: compiler, clang: suppress warning for unused static inline …
rientjes Jun 6, 2017
851f385
UPSTREAM: compiler, clang: properly override 'inline' for clang
torvalds Jun 11, 2017
23dddef
UPSTREAM: compiler, clang: always inline when CONFIG_OPTIMIZE_INLININ…
rientjes Jul 6, 2017
b4cd4ef
UPSTREAM: kbuild: clang: Disable 'address-of-packed-member' warning
Apr 21, 2017
4066ce9
UPSTREAM: crypto: sha256 - implement base layer for SHA-256
Apr 9, 2015
73602d2
UPSTREAM: crypto: sha512 - implement base layer for SHA-512
Apr 9, 2015
51f6c2c
UPSTREAM: crypto: sha1-generic - move to generic glue implementation
Apr 9, 2015
bab4aec
UPSTREAM: crypto: sha256-generic - move to generic glue implementation
Apr 9, 2015
a9097e3
UPSTREAM: crypto: sha512-generic - move to generic glue implementation
Apr 9, 2015
8c3eec3
UPSTREAM: crypto: arm64/sha1-ce - move SHA-1 ARMv8 implementation to …
Apr 9, 2015
4fe6951
UPSTREAM: crypto: arm64/sha1-ce - fix for big endian
Oct 11, 2016
09e6be1
UPSTREAM: crypto: arm64/sha2-ce - move SHA-224/256 ARMv8 implementati…
Apr 9, 2015
1e24f80
UPSTREAM: crypto: arm64/sha2-ce - fix for big endian
Oct 11, 2016
4f4d491
UPSTREAM: crypto: arm64/sha - avoid non-standard inline asm tricks
Apr 26, 2017
4d36751
BACKPORT: kbuild: fix linker feature test macros when cross compiling…
nickdesaulniers Nov 6, 2017
d8a8745
BACKPORT: kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
ccfries Nov 15, 2017
98e30c3
BACKPORT: crypto: arm64/aes - add scalar implementation
Jan 11, 2017
585c4af
UPSTREAM: arm64/crypto: use crypto instructions to generate AES key s…
Nov 3, 2014
5a17c29
UPSTREAM: crypto: arm64/aes-ce - fix for big endian
Oct 11, 2016
f2b263b
UPSTREAM: crypto: arm64/aes-ccm-ce: fix for big endian
Oct 11, 2016
bead803
UPSTREAM: crypto: arm64/aes-ce-cipher - match round key endianness wi…
Jul 24, 2017
98050bf
UPSTREAM: crypto: arm64/aes-ce-cipher: add non-SIMD generic fallback
Jul 24, 2017
0e98810
UPSTREAM: crypto: arm64/aes-ce-cipher - move assembler code to .S file
Nov 21, 2017
d3e0d57
CUSTOM: kbuild: clang: Disable the 'duplicate-decl-specifier' warning
Nov 21, 2017
92b9772
CUSTOM: arm64: Disable asm-operand-width warning for clang
Apr 21, 2017
bdd2a06
UPSTREAM: kbuild: disable clang's default use of -fmerge-all-constants
borkmann Mar 21, 2018
6b0d4c9
UPSTREAM: llist: clang: introduce member_address_is_nonnull()
ramosian-glider Jul 19, 2017
d568cb9
BACKPORT: kbuild: clang: disable unused variable warnings only when c…
Feb 6, 2018
896068e
BACKPORT: kbuild: clang: remove crufty HOSTCFLAGS
nickdesaulniers Oct 7, 2017
06223e0
ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple
greghackmann Oct 25, 2016
766cc82
ANDROID: kasan, LLVMLinux: add clang-specific CFLAGS_KASAN
greghackmann Dec 16, 2016
575a3f4
ANDROID: Kbuild, LLVMLinux: disable clang -Wpointer-bool-conversion
greghackmann Mar 7, 2017
432725d
LLVMLINUX: DO-NOT-UPSTREAM arm64, LLVMLinux: prfm
mcharleb Jul 30, 2014
f0edca2
drivers: soc: qcom: fix register names on ARM64
greghackmann Oct 21, 2016
9c28dda
drivers: media: msm: don't use nested functions
greghackmann Oct 21, 2016
29aeb47
msm: sde: fix unaligned memory read
samitolvanen Aug 17, 2017
1fdcdd8
BACKPORT: bug: split BUILD_BUG stuff out into <linux/build_bug.h>
ian-abbott Jul 31, 2017
977409b
BACKPORT: kernel.h: handle pointers to arrays better in container_of()
ian-abbott Jul 31, 2017
2c0ef1c
UPSTREAM: fs: compat: Remove warning from COMPATIBLE_IOCTL
mcharleb Apr 28, 2017
186a80d
BACKPORT: selinux: Remove redundant check for unknown labeling behavior
May 19, 2017
dba34a4
UPSTREAM: mm/zsmalloc.c: change stat type parameter to int
Sep 8, 2017
960aa67
UPSTREAM: mm/zsmalloc.c: fix -Wunneeded-internal-declaration warning
nickdesaulniers Jul 10, 2017
8defb91
UPSTREAM: lib: crc32: constify crc32 lookup table
Feb 13, 2015
19bb7f9
UPSTREAM: jiffies.h: declare jiffies and jiffies_64 with ____cachelin…
May 8, 2017
9e2a11d
UPSTREAM: frv: declare jiffies to be located in the .data section
Jun 2, 2017
2e20f08
BACKPORT: netfilter: ctnetlink: Make some parameters integer to avoid…
Apr 19, 2017
2d6b9f0
UPSTREAM: netfilter: nf_nat_h323: fix logical-not-parentheses warning
nickdesaulniers Aug 11, 2017
5bce13e
UPSTREAM: Input: mousedev - fix implicit conversion warning
nickdesaulniers Jun 25, 2017
0de4f48
UPSTREAM: dm ioctl: remove double parentheses
Apr 17, 2017
6fad76f
BACKPORT: PCI: Make PCI_ROM_ADDRESS_MASK a 32-bit constant
Apr 14, 2017
00e728e
clk: msm: Disable literal-conversion Clang warning
nathanchance May 10, 2018
212e9ac
crypto: msm: Disable frame-larger-than warning
nathanchance May 10, 2018
b9d9a22
nl80211: Disable enum-conversion warning
nathanchance May 10, 2018
8131d80
ASoC: msm: qdsp6v2: Disable non-literal-null-conversion warning
nathanchance May 10, 2018
aee6955
usb: bam: Disable enum-conversion warning
nathanchance May 10, 2018
02baf36
staging: android: ion: Disable enum-conversion warning
nathanchance May 10, 2018
8cd1ba6
thermal: tsens: Disable enum-conversion warning
nathanchance May 10, 2018
0baf9a6
kernel: locking: Disable gcc-compat warning
nathanchance May 11, 2018
24e7612
hwmon: qpnp-adc-voltage: Disable enum-conversion warning
nathanchance May 11, 2018
b573286
qseecom: Fix ignored attribute warnings
nathanchance May 10, 2018
422ba3f
scripts: dtc: Remove unnecessary parentheses
nathanchance May 10, 2018
c2d50b3
ASoC: wcd_cpe_services: Fix enum-conversion warnings
nathanchance May 10, 2018
216ad77
hwmon: qpnp-adc: Fix logical-not-parentheses warning
nathanchance Apr 8, 2018
177d84f
msm: camera: Remove unnecessary parentheses
nathanchance May 10, 2018
eb30579
msm: msm_bus: Remove unnecessary parentheses
nathanchance May 10, 2018
3e47c4b
msm: thermal: Remove unnecessary parentheses
nathanchance May 10, 2018
88b405f
msm: thermal: Fix third argument of strlcpy
nathanchance May 10, 2018
184f279
soc: qcom: glink: Fix third argument of strlcpy
nathanchance Apr 7, 2018
bca03fd
msm: mdss: Remove unnecessary parentheses
nathanchance May 10, 2018
ec39be4
USB: gadget: u_bam: Remove unnecessary parentheses
nathanchance May 10, 2018
ad368e8
ASoC: apr: Remove unnecessary parentheses
nathanchance May 10, 2018
22de51e
ion: system_secure_heap: fix constant logical comparison bug
nickdesaulniers May 25, 2017
26878ef
usb: gadget: f_mbim: Fix enum-conversion warning
nathanchance May 10, 2018
add72ad
soc: qcom: rpm_master_stat: Fix third argument of strlcpy
nathanchance Apr 7, 2018
740652f
soc: qcom: system_stats: Fix third argument of strlcpy
nathanchance Apr 7, 2018
5ec9638
mmc: card: Fix constant logical operand warning
nathanchance May 11, 2018
ba4edb6
mmc: sdio: Fix third argument of strlcpy
nathanchance May 11, 2018
34a1768
msm: msm_bus: Remove unnecessary self assignment
nathanchance May 11, 2018
a8ff9ad
coresight: Fix enum-conversion warning
nathanchance May 11, 2018
564e728
usb: gadget: f_uac2: Fix constant logical operand warning
nathanchance May 11, 2018
6426038
usb: gadget: f_uac2: Remove unused static variable
nathanchance May 11, 2018
8ed9c63
clk: msm: Fix literal-conversion warnings
YaroST12 May 5, 2018
8e4cc57
ASoC: msm: qdsp6v2: Fix non-literal-null-conversion warning
YaroST12 Mar 7, 2018
92781d9
ASoC: msm: qdsp6v2: Improve literal null conversion fix
nathanchance May 24, 2018
9e08b82
staging: ion: Fix enum conversion warnings
nathanchance May 20, 2018
aad6e00
msm-3.18: Remove some disable warnings
nathanchance May 24, 2018
ad96a36
UPSTREAM: kbuild: clang: fix build failures with sparse check
dtwlin Oct 20, 2017
14bf060
Add my own custom default config with options for my Chroot
Phoenix591 Feb 23, 2019
559d7aa
Drop modified mk2k LDFLAGS: Make is barfing with them on my sys
Phoenix591 Mar 31, 2019
53bf46e
fivopts not supported, drop it
Phoenix591 Aug 6, 2019
c38b734
drivers/block/zram: Fix strlcpy argument for clang
Phoenix591 Feb 19, 2019
8e807d0
drivers/brcm_v4l2: Make gcc-specific cflag condiitional
Phoenix591 Feb 19, 2019
d1b7470
drivers/input/touchscreen/lge/touch_hwif.c: Explictly cast lge_get_pa…
Phoenix591 Feb 19, 2019
e46e14a
drivers/input/touchscreen/lge/lgsic/touch_lg4945_watch.h fix ignored …
Phoenix591 Feb 23, 2019
34ba274
drivers/input/touchscreen/lge/lgsic/touch_sw49407_watch.h
Phoenix591 Feb 23, 2019
7aa7cac
drivers/input/touchscreen/lge/lgsic/touch_sw49407_prd.c:1755 -Wlogica…
Phoenix591 Feb 23, 2019
5184419
drivers/input/touchscreen/lge/lgsic/touch_sw49407_prd.c
Phoenix591 Feb 23, 2019
0f9334c
../drivers/media/platform/msm/camera_v2/sensor/ois/lgit_imx298_rohm_o…
Phoenix591 Feb 23, 2019
33aa85c
drivers/media/usb/uvc/uvc_queue.c explict cast enum
Phoenix591 Feb 23, 2019
ab12185
arch/arm64/include: Fix a lot of sometimes unitialized variables
Phoenix591 Feb 23, 2019
185b0b2
drivers/net/wireless/bcmdhd/src/shared/bcmutils.c format string is no…
Phoenix591 Feb 23, 2019
27f5636
drivers/net/wireless/bcmdhd/src/wl/sys/wl_android.c:2682:13: error: e…
Phoenix591 Feb 23, 2019
e71c0f2
drivers/net/wireless/bcmdhd/src/wl/sys/wl_cfg80211.c explictly cast
Phoenix591 Feb 23, 2019
b72e8c9
drivers/power/qpnp-smbcharger.c explictly convert
Phoenix591 Feb 23, 2019
09b59db
drivers/soc/qcom/lge/devices_lge.c:587 fix logical not
Phoenix591 Feb 23, 2019
0cd6eef
Fix new warning that appeared in Clang-8
Phoenix591 Mar 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*.lzo
*.patch
*.gcno
*.ll
modules.builtin
Module.symvers
*.dwo
Expand Down
55 changes: 5 additions & 50 deletions Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,15 @@
bounds-file := include/generated/bounds.h

always := $(bounds-file)
targets := $(bounds-file) kernel/bounds.s

quiet_cmd_bounds = GEN $@
define cmd_bounds
(set -e; \
echo "#ifndef __LINUX_BOUNDS_H__"; \
echo "#define __LINUX_BOUNDS_H__"; \
echo "/*"; \
echo " * DO NOT MODIFY."; \
echo " *"; \
echo " * This file was generated by Kbuild"; \
echo " *"; \
echo " */"; \
echo ""; \
sed -ne $(sed-y) $<; \
echo ""; \
echo "#endif" ) > $@
endef
targets := kernel/bounds.s

# We use internal kbuild rules to avoid the "is up to date" message from make
kernel/bounds.s: kernel/bounds.c FORCE
$(Q)mkdir -p $(dir $@)
$(call if_changed_dep,cc_s_c)

$(obj)/$(bounds-file): kernel/bounds.s Kbuild
$(Q)mkdir -p $(dir $@)
$(call cmd,bounds)
$(obj)/$(bounds-file): kernel/bounds.s FORCE
$(call filechk,offsets,__LINUX_BOUNDS_H__)

#####
# 2) Generate timeconst.h
Expand Down Expand Up @@ -66,43 +48,16 @@ $(obj)/$(timeconst-file): kernel/time/timeconst.bc FORCE
offsets-file := include/generated/asm-offsets.h

always += $(offsets-file)
targets += $(offsets-file)
targets += arch/$(SRCARCH)/kernel/asm-offsets.s


# Default sed regexp - multiline due to syntax constraints
define sed-y
"/^->/{s:->#\(.*\):/* \1 */:; \
s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
s:->::; p;}"
endef

quiet_cmd_offsets = GEN $@
define cmd_offsets
(set -e; \
echo "#ifndef __ASM_OFFSETS_H__"; \
echo "#define __ASM_OFFSETS_H__"; \
echo "/*"; \
echo " * DO NOT MODIFY."; \
echo " *"; \
echo " * This file was generated by Kbuild"; \
echo " *"; \
echo " */"; \
echo ""; \
sed -ne $(sed-y) $<; \
echo ""; \
echo "#endif" ) > $@
endef

# We use internal kbuild rules to avoid the "is up to date" message from make
arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \
$(obj)/$(timeconst-file) $(obj)/$(bounds-file) FORCE
$(Q)mkdir -p $(dir $@)
$(call if_changed_dep,cc_s_c)

$(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild
$(call cmd,offsets)
$(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
$(call filechk,offsets,__ASM_OFFSETS_H__)

#####
# 4) Check for missing system calls
Expand Down
105 changes: 57 additions & 48 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,13 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)

XTRAHFLAGS = -fivopts -fmodulo-sched -fmodulo-sched-allow-regmoves
XTRAHFLAGS = -fmodulo-sched -fmodulo-sched-allow-regmoves

HOSTCC = gcc
HOSTCXX = g++
HOSTCFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 -pipe $(XTRAHFLAGS)
HOSTCXXFLAGS = -O2 $(XTRAHFLAGS)

ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
-Wno-missing-field-initializers -fno-delete-null-pointer-checks
endif

# Decide whether to build built-in, modular, or both.
# Normally, just do built-in.

Expand Down Expand Up @@ -338,15 +333,6 @@ endif
export KBUILD_MODULES KBUILD_BUILTIN
export KBUILD_CHECKSRC KBUILD_SRC KBUILD_EXTMOD

ifneq ($(CC),)
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
COMPILER := clang
else
COMPILER := gcc
endif
export COMPILER
endif

# Look for make include files relative to root of kernel src
MAKEFLAGS += --include-dir=$(srctree)

Expand Down Expand Up @@ -384,10 +370,10 @@ CFLAGS_KCOV = -fsanitize-coverage=trace-pc

# fall back to -march=armv8-a+crc+crypto in case the compiler isn't
# compatible with -mcpu
ARM_ARCH_OPT := -mcpu=cortex-a57+crc+crypto
#ARM_ARCH_OPT := -mcpu=cortex-a57+crc+crypto
GEN_OPT_FLAGS := $(call cc-option,$(ARM_ARCH_OPT),-march=armv8-a+crc+crypto) \
-g0 -DNDEBUG -fivopts \
-ftree-vectorize $(MK_FLAGS)
-g0 -DNDEBUG \
-ftree-vectorize -mcpu=kryo -mno-fix-cortex-a53-835769 $(MK_FLAGS)

# Use USERINCLUDE when you must reference the UAPI directories only.
USERINCLUDE := \
Expand Down Expand Up @@ -428,14 +414,10 @@ KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds

# Snapdragon 820 doesn't need 835769/843419 erratum fixes
# some toolchain enables those fixes automatically, so opt-out
KBUILD_CFLAGS += $(call cc-option, -mno-fix-cortex-a53-835769)
KBUILD_CFLAGS += $(call cc-option, -mno-fix-cortex-a53-843419)
LDFLAGS_vmlinux += $(call ld-option, --no-fix-cortex-a53-835769)
LDFLAGS_vmlinux += $(call ld-option, --no-fix-cortex-a53-843419)
LDFLAGS_MODULE += $(call ld-option, --no-fix-cortex-a53-835769)
LDFLAGS_MODULE += $(call ld-option, --no-fix-cortex-a53-843419)
LDFLAGS += $(call ld-option, --no-fix-cortex-a53-835769)
LDFLAGS += $(call ld-option, --no-fix-cortex-a53-843419)
#KBUILD_CFLAGS += $(call cc-option, -mno-fix-cortex-a53-835769)
#LDFLAGS_vmlinux += $(call ld-option, --no-fix-cortex-a53-843419)
#LDFLAGS_MODULE += $(call ld-option, --no-fix-cortex-a53-835769)
#LDFLAGS += $(call ld-option, --no-fix-cortex-a53-835769)

# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
Expand Down Expand Up @@ -633,6 +615,40 @@ endif # $(dot-config)
# Defaults to vmlinux, but the arch makefile usually adds further targets
all: vmlinux

ifeq ($(cc-name),clang)
ifneq ($(CROSS_COMPILE),)
CLANG_TRIPLE ?= $(CROSS_COMPILE)
CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
GCC_TOOLCHAIN := $(realpath $(dir $(shell which $(LD)))/..)
endif
ifneq ($(GCC_TOOLCHAIN),)
CLANG_GCC_TC := --gcc-toolchain=$(GCC_TOOLCHAIN)
endif
KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC)
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
KBUILD_CFLAGS += $(call cc-disable-warning, duplicate-decl-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-bool-conversion)
# Quiet clang warning: comparison of unsigned expression < 0 is always false
KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
# source of a reference will be _MergedGlobals and not on of the whitelisted names.
# See modpost pattern 2
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
KBUILD_CFLAGS += $(call cc-option, -no-integrated-as)
KBUILD_AFLAGS += $(call cc-option, -no-integrated-as)
else

# These warnings generated too much noise in a regular build.
# Use make W=1 to enable them (see scripts/Makefile.build)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
endif
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)

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

KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
Expand All @@ -647,7 +663,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
KBUILD_AFLAGS += $(call cc-option,-fno-PIE)

ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os
KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) $(call cc-disable-warning,maybe-uninitialized,)
else
KBUILD_CFLAGS += -O2
endif
Expand Down Expand Up @@ -718,27 +734,6 @@ ifdef CONFIG_KCOV
endif
endif

ifeq ($(COMPILER),clang)
KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
KBUILD_CPPFLAGS += $(call cc-option,-Wno-unknown-warning-option,)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable)
KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
# Quiet clang warning: comparison of unsigned expression < 0 is always false
KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
# source of a reference will be _MergedGlobals and not on of the whitelisted names.
# See modpost pattern 2
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
else

# These warnings generated too much noise in a regular build.
# Use make W=1 to enable them (see scripts/Makefile.build)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
endif

ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
Expand Down Expand Up @@ -811,6 +806,15 @@ KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
# disable invalid "can't wrap" optimizations for signed / pointers
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)

# clang sets -fmerge-all-constants by default as optimization, but this
# is non-conforming behavior for C and in fact breaks the kernel, so we
# need to disable it here generally.
KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants)

# for gcc -fno-merge-all-constants disables everything, but it is fine
# to have actual conforming behavior enabled.
KBUILD_CFLAGS += $(call cc-option,-fmerge-constants)

# Make sure -fstack-check isn't enabled (like gentoo apparently did)
KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,)

Expand Down Expand Up @@ -1325,6 +1329,8 @@ help:
@echo ' (default: $$(INSTALL_MOD_PATH)/lib/firmware)'
@echo ' dir/ - Build all files in dir and below'
@echo ' dir/file.[oisS] - Build specified target only'
@echo ' dir/file.ll - Build the LLVM assembly file'
@echo ' (requires compiler support for LLVM assembly generation)'
@echo ' dir/file.lst - Build specified mixed source/assembly target only'
@echo ' (requires a recent binutils and recent build (System.map))'
@echo ' dir/file.ko - Build module including final link'
Expand Down Expand Up @@ -1498,6 +1504,7 @@ clean: $(clean-dirs)
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
-o -name '*.symtypes' -o -name 'modules.order' \
-o -name modules.builtin -o -name '.tmp_*.o.*' \
-o -name '*.ll' \
-o -name '*.gcno' \) -type f -print | xargs rm -f

# Generate tags for editors
Expand Down Expand Up @@ -1601,6 +1608,8 @@ endif
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.symtypes: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.ll: %.c prepare scripts FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)

# Modules
/: prepare scripts FORCE
Expand Down
24 changes: 14 additions & 10 deletions arch/arm64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
KBUILD_CPPFLAGS += -mbig-endian
AS += -EB
LD += -EB
ifeq ($(MK_LINKER),ld.gold)
LDFLAGS += -maarch64_elf64_be_vec
else
LDFLAGS += -maarch64linuxb
endif
#ifeq ($(MK_LINKER),ld.gold)
#LDFLAGS += -maarch64_elf64_be_vec
#else
#LDFLAGS += -maarch64linuxb
#endif
else
KBUILD_CPPFLAGS += -mlittle-endian
AS += -EL
LD += -EL
ifeq ($(MK_LINKER),ld.gold)
LDFLAGS += -maarch64_elf64_le_vec
else
LDFLAGS += -maarch64linux
endif
#ifeq ($(MK_LINKER),ld.gold)
#LDFLAGS += -maarch64_elf64_le_vec
#else
#LDFLAGS += -maarch64linux
#endif
endif

CHECKFLAGS += -D__aarch64__
Expand All @@ -89,6 +89,10 @@ else
TEXT_OFFSET := 0x00080000
endif

ifeq ($(cc-name),clang)
KBUILD_CFLAGS += $(call cc-disable-warning, asm-operand-widths)
endif

# KASAN_SHADOW_OFFSET = VA_START + (1 << (VA_BITS - 3)) - (1 << 61)
# in 32-bit arithmetic
KASAN_SHADOW_OFFSET := $(shell printf "0x%08x00000000\n" $$(( \
Expand Down
24 changes: 24 additions & 0 deletions arch/arm64/configs/phx_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
include elsa_tmo_us-perf_defconfig

CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
# CONFIG_NFS_V4_1 is not set
# CONFIG_ROOT_NFS is not set
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFSD is not set
CONFIG_NFS_COMMON=y

# Gentoo Stuff
CONFIG_CGROUPS=y
CONFIG_NAMESPACES=y
CONFIG_SYSVIPC=y
CONFIG_IPC_NS=y
CONFIG_NET_NS=y
CONFIG_PID_NS=y
#we want devpts with gid=5 not the android gid
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
10 changes: 7 additions & 3 deletions arch/arm64/crypto/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,28 @@ config CRYPTO_CRC32_ARM64_CE
depends on CRC32
select CRYPTO_HASH

config CRYPTO_AES_ARM64
tristate "AES core cipher using scalar instructions"
select CRYPTO_AES

config CRYPTO_AES_ARM64_CE
tristate "AES core cipher using ARMv8 Crypto Extensions"
depends on ARM64 && KERNEL_MODE_NEON
select CRYPTO_ALGAPI
select CRYPTO_AES
select CRYPTO_AES_ARM64

config CRYPTO_AES_ARM64_CE_CCM
tristate "AES in CCM mode using ARMv8 Crypto Extensions"
depends on ARM64 && KERNEL_MODE_NEON
select CRYPTO_ALGAPI
select CRYPTO_AES
select CRYPTO_AES_ARM64_CE
select CRYPTO_AEAD

config CRYPTO_AES_ARM64_CE_BLK
tristate "AES in ECB/CBC/CTR/XTS modes using ARMv8 Crypto Extensions"
depends on ARM64 && KERNEL_MODE_NEON
select CRYPTO_BLKCIPHER
select CRYPTO_AES
select CRYPTO_AES_ARM64_CE
select CRYPTO_ABLK_HELPER

config CRYPTO_AES_ARM64_NEON_BLK
Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/crypto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ obj-$(CONFIG_CRYPTO_CRC32_ARM64_CE) += crc32-ce.o
crc32-ce-y:= crc32-ce-core.o crc32-ce-glue.o

obj-$(CONFIG_CRYPTO_AES_ARM64_CE) += aes-ce-cipher.o
aes-ce-cipher-y := aes-ce-core.o aes-ce-glue.o

obj-$(CONFIG_CRYPTO_AES_ARM64_CE_CCM) += aes-ce-ccm.o
aes-ce-ccm-y := aes-ce-ccm-glue.o aes-ce-ccm-core.o
Expand All @@ -34,6 +35,9 @@ aes-ce-blk-y := aes-glue-ce.o aes-ce.o
obj-$(CONFIG_CRYPTO_AES_ARM64_NEON_BLK) += aes-neon-blk.o
aes-neon-blk-y := aes-glue-neon.o aes-neon.o

obj-$(CONFIG_CRYPTO_AES_ARM64) += aes-arm64.o
aes-arm64-y := aes-cipher-core.o aes-cipher-glue.o

AFLAGS_aes-ce.o := -DINTERLEAVE=4
AFLAGS_aes-neon.o := -DINTERLEAVE=4

Expand Down
Loading