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

Apollo Clang support #2

Merged
merged 143 commits into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
b26f939
mm/zsmalloc.c: change stat type parameter to int
Sep 8, 2017
416604d
mm/zsmalloc.c: fix -Wunneeded-internal-declaration warning
nickdesaulniers Jul 10, 2017
24ed9fa
phonet: fix building with clang
arndb Feb 19, 2019
ce224df
arm64: percpu: Initialize ret in the default case
nathanchance Sep 25, 2018
a5a91a0
fs: ecryptfs: fix parentheses-equality warning
YaroST12 Jun 22, 2018
d51e32b
ufshcd: fix parentheses-equality warning
YaroST12 Jun 22, 2018
6d5c79b
decon_core: fix parentheses-equality warning
YaroST12 Jun 22, 2018
5c3fef1
drivers: vfs8xxx: silence enum-conversion warning
mainey Jun 3, 2019
e17635c
drivers: modem_v1: silence enum-conversion warnings
mainey Jun 3, 2019
05beabb
drivers: fimc-is2: silence enum-conversion warnings
mainey Jun 3, 2019
905446f
drivers: thermal: silence enum-conversion warnings
mainey Jun 3, 2019
35f6171
decon: merge all into decon_data_path
mainey Jun 3, 2019
fe43b36
cal-if: disable sizeof-pointer-div warnings
mainey Apr 25, 2019
184ba9f
mptcp: disable incompatible-pointer-types warnings
mainey Mar 26, 2019
7d93659
dpu: Update aux interval function
THEBOSS619 Apr 11, 2020
b2f7173
soc: samsung: cal-if: add volatile keyword to prevent optimization by…
mainey Jun 8, 2019
befdd3f
ANDROID: xt_qtaguid: Remove unnecessary null checks to device's name
nathanchance Apr 1, 2018
6e1f659
mfc: silence enum conversion warning
mainey Aug 31, 2019
0f507d8
decon_reg: silence literal conversion warning
mainey Sep 11, 2019
135411e
crypto: Remove -fno-merge-constants
erfanoabdi Apr 11, 2020
8b233bb
battery_v2: silence enum conversion warning
mainey Aug 31, 2019
facc66f
ccic: silence enum conversion warning
farovitus Apr 11, 2020
f09049a
crypto: fmp: silence unknown attribute optimize warning
farovitus Apr 11, 2020
8f45c4f
gpu: exynos: g2d: Fix typo in header guard
farovitus Apr 11, 2020
eddf520
codecs: max98512: Drop always true pointer if
erfanoabdi Apr 11, 2020
5901650
[cpu/gpu]_cooling: move get_static_t declaration in thermal.h
YaroST12 Jun 22, 2018
63ead8c
sec_ts_fn: fix logical-not-parentheses warning
YaroST12 Jun 22, 2018
4e1f9de
[COMMON] fimc-is2: fix a typo (SYNNY -> SUNNY)
jtpark-sec Mar 26, 2018
737b022
fimc-is2: introduce DMA_INPUT_ORDER_NO order
farovitus Apr 11, 2020
92ac9f7
gator: Fix macro definitions
erfanoabdi Apr 11, 2020
cdf84ba
gator: Use global_node_page_state for NR_FILE_PAGES
erfanoabdi Apr 11, 2020
e32cc72
sensorhub: bbdpl: Drop redefinition of types
farovitus Apr 11, 2020
1d2607d
scsi: sd: Drop pointer check from if
farovitus Apr 11, 2020
b6b4f29
ufs-exynos: don't use boolean statement in switch-case
YaroST12 Jun 22, 2018
a964d6c
sec_debug: silence null-dereference warnings
mainey Jun 3, 2019
599b9b5
trace: exynos-ss: Drop redefinition of ess_initcall_t
erfanoabdi Apr 11, 2020
edffc06
ion: exynos: Suppress logical with constant operand warn
erfanoabdi Apr 11, 2020
1f3377c
usb: dwc3: Use psy_do_property
farovitus Apr 11, 2020
7868a3c
vision: iva: Drop redefinition of rt_iva_table
farovitus Apr 11, 2020
68dc041
sti: abc: Fix null conversion warn
Stricted Apr 11, 2020
e42b3cf
decon_core: fix parentheses-equality warning
YaroST12 Jun 22, 2018
71e1359
decon: merge all into decon_data_path
mainey Jun 3, 2019
e183336
decon_reg: silence literal conversion warning
mainey Sep 11, 2019
9d68eb0
drivers: usb: silence enum-conversion warnings
mainey Jun 3, 2019
3373d7a
cal-if: Short casting for PLL_RATE_MPSK
erfanoabdi Apr 11, 2020
2d5a271
bcmdhd_100_15: Suppress unused variable warnings
erfanoabdi Apr 11, 2020
fdf4306
media: fimc-is-sysfs: Silence an instance of -Wsizeof-array-div in Ss…
nathanchance Apr 11, 2020
b38e168
net: wl_android: fix clang overlap-compare warning
nathanchance Apr 11, 2020
63ec32d
net: dhd_common: fix comparing a pointer to a null character
erfanoabdi Apr 11, 2020
ec1604e
sec_ts_fn: y771: fix logical-not-parentheses warning
YaroST12 Jun 22, 2018
a1452a6
kbuild: allow to use GCC toolchain not in Clang search path
agners Sep 18, 2018
c186c92
kbuild: clang: choose GCC_TOOLCHAIN_DIR not on LD
nickdesaulniers Feb 11, 2019
c1f3e7e
FROMLIST: [PATCH v3 1/3] arm64: compat: Split the sigreturn trampolin…
kevin-brodsky-arm Nov 23, 2016
052479c
FROMLIST: [PATCH v3 2/3] arm64: compat: Split the sigreturn trampolin…
kevin-brodsky-arm Nov 23, 2016
3ba2c83
FROMLIST: [PATCH v3 3/3] arm64: compat: Add CONFIG_KUSER_HELPERS
kevin-brodsky-arm Nov 23, 2016
eed18e0
FROMLIST: [PATCH v5 01/12] arm: vdso: rename vdso_datapage variables
Aug 17, 2017
b096a2d
FROMLIST: [PATCH v5 02/12] arm: vdso: add include file defining __get…
Aug 17, 2017
a94986d
FROMLIST: [PATCH v5 03/12] arm: vdso: inline assembler operations to …
Aug 17, 2017
3119391
FROMLIST: [PATCH v5 04/12] arm: vdso: do calculations outside reader …
Aug 17, 2017
66bc258
FROMLIST: [PATCH v6 05/12] arm: vdso: Add support for CLOCK_MONOTONIC…
Aug 17, 2017
45bd7ee
FROMLIST: [PATCH v5 06/12] arm: vdso: add support for clock_getres
Aug 17, 2017
a908715
FROMLIST: [PATCH v5 07/12] arm: vdso: disable profiling
Oct 12, 2017
3b1f0d5
FROMLIST: [PATCH v5 08/12] arm: vdso: Add ARCH_CLOCK_FIXED_MASK
Aug 17, 2017
10c9e05
FROMLIST: [PATCH v5 09/12] arm: vdso: move vgettimeofday.c to lib/vdso/
Oct 12, 2017
a32d59b
FROMLIST: [PATCH v5 10/12] arm64: vdso: replace gettimeofday.S with g…
Aug 4, 2017
125ed46
FROMLIST: [PATCH v5 11/12] lib: vdso: Add support for CLOCK_BOOTTIME
Aug 24, 2017
bd30a5f
FROMLIST: [PATCH v5 12/12] lib: vdso: do not expose gettimeofday, if …
Oct 27, 2017
fa54cf5
FROMLIST: [PATCH] arm64: compat: Expose offset to registers in sigframes
kevin-brodsky-arm May 10, 2016
33510b8
FROMLIST: lib: vdso: add support for time
Oct 27, 2017
b56a551
FROMLIST: [PATCH 1/6] arm64: compat: Use vDSO sigreturn trampolines i…
kevin-brodsky-arm May 12, 2016
1cf6b48
FROMLIST: [PATCH 2/6] arm64: elf: Set AT_SYSINFO_EHDR in compat proce…
kevin-brodsky-arm May 12, 2016
e31d2ba
FROMLIST: BACKPORT: [PATCH 3/6] arm64: Refactor vDSO init/setup
kevin-brodsky-arm May 10, 2016
85e4e59
FROMLIST: [PATCH 4/6] arm64: compat: Add a 32-bit vDSO
kevin-brodsky-arm May 11, 2016
29c944e
FROMLIST: [PATCH 5/6] arm64: compat: 32-bit vDSO setup
kevin-brodsky-arm Sep 8, 2016
741a782
FROMLIST: BACKPORT: [PATCH 6/6] arm64: Wire up and expose the new com…
kevin-brodsky-arm May 13, 2016
5c8793a
ANDROID: CROSS_COMPILE_ARM32 must work if CONFIG_COMPAT_VDSO
Mar 28, 2017
48ec962
ANDROID: clock_gettime(CLOCK_BOOTTIME,) slows down >20x
Jan 24, 2018
4fceee1
FROMLIST: arm64: vdso32: Use full path to Clang instead of relying on…
nathanchance May 22, 2018
84f3db7
ANDROID: turn on VCT access from 32-bit applications
Jan 25, 2018
da36cfc
vdso32: Invoke clang with correct path to GCC toolchain
danielmentzgoogle Feb 21, 2019
b28927f
FROMLIST: arm64: Build vDSO with -ffixed-x18
pcc Nov 7, 2018
c5d5bf5
configs: exynos9810: turn on VDSO
khusika Jun 25, 2024
fd8b041
drivers: cpufreq: cpufreq_governor.c needs the LATENCY_MULTIPLIER define
ianmacd Jun 13, 2018
17bab00
drivers: bts: use cal_bts9810 definitions instead of cal_bts8895
THEBOSS619 Jun 12, 2020
c91043a
ANDROID: overlayfs: override_creds=off option bypass creator_cred
Feb 21, 2019
026ccca
ANDROID: regression introduced override_creds=off
Sep 13, 2019
ef251f8
ovl: initialize error in ovl_copy_xattr
yshui May 27, 2020
c5c649b
arm64: add 32-bit sigcontext definition to uapi signcontext.h
boedhack Dec 21, 2014
4825af3
configs: exynos9810: regen
ananjaser1211 Jun 25, 2024
c8cdd8a
kernel: sched: fix build when CONFIG_SCHED_DEBUG is disabled
ianmacd Nov 16, 2018
969b7a3
configs: exynos9810: disable CONFIG_SCHED_DEBUG
ananjaser1211 Jun 25, 2024
85093e3
configs: exynos9810: disable CONFIG_PGTABLE_MAPPING
ananjaser1211 Jun 25, 2024
d31df98
gcc-9: silence 'address-of-packed-member' warning
torvalds May 1, 2019
6946e91
kasan: don't emit builtin calls when sanitization is off
xairy Feb 6, 2018
2fa52a3
Kbuild: use -fshort-wchar globally
arndb Jul 26, 2017
3e25842
kbuild: Set KBUILD_CFLAGS before incl. arch Makefile
ccfries Jun 25, 2024
fcdf2ba
kbuild: allow to use GCC toolchain not in Clang search path
agners Dec 6, 2018
460d3ce
kbuild: move cc-option and cc-disable-warning after incl. arch Makefile
krazey Jun 25, 2024
034e825
kbuild: clang: fix build failures with sparse check
dtwlin Oct 20, 2017
3f44e49
kbuild: clang: remove crufty HOSTCFLAGS
nickdesaulniers Oct 7, 2017
69dac01
kbuild: clang: disable unused variable warnings only when constant
Jun 25, 2024
7eef186
kbuild: set no-integrated-as before incl. arch Makefile
agners Mar 19, 2018
c6b13ca
kbuild: add -no-integrated-as Clang option unconditionally
masahir0y Nov 6, 2018
f0f0ace
kbuild: consolidate Clang compiler flags
masahir0y Nov 6, 2018
b7b0212
ANDROID: resolving conflict with kbuild: GCC toolchain / clang
krazey Jan 15, 2021
0037738
ANDROID: Makefile: Properly resolve 4.9.169 merge
nathanchance Apr 17, 2019
d4e0d4a
kbuild: Add -Werror=unknown-warning-option to CLANG_FLAGS
nathanchance Jun 11, 2019
10b5382
kbuild: initialize CLANG_FLAGS correctly in the top Makefile
masahir0y Jul 29, 2019
047ff7d
Kbuild: make designated_init attribute fatal
kees Mar 21, 2017
893964d
kbuild: use -fmacro-prefix-map to make __FILE__ a relative path
masahir0y Mar 30, 2018
7b0c081
kbuild: add -fcf-protection=none when using retpoline flags
Jul 17, 2019
f9795da
Makefile: drop clang-android.sh
synt4x93 Jan 25, 2021
57a12fa
kbuild: fix single target build for external module
masahir0y Nov 21, 2018
b7ba97d
Makefile: Sync with N770F_13
ananjaser1211 Jun 25, 2024
4814b67
arm64: remove no-op -p linker flag
greghackmann Nov 27, 2018
fcc091d
arm64: makefile fix build of .i file in external module case
Oct 30, 2018
6b2a2b9
vdso32: Fix compilation errors with Android clang
GhostMaster69-dev Jun 25, 2024
8e244b5
arch: fix merge issues
ananjaser1211 Jun 25, 2024
6078691
drivers: sensorhub: fix misleading indentation
ananjaser1211 Jun 25, 2024
8b9054c
include: fix implicit declarations
ananjaser1211 Jun 25, 2024
1f016f8
scsi: scsi_devinfo: fixup string compare
hreinecke Oct 2, 2017
ed19bd5
scsi: scsi_devinfo: handle non-terminated strings
mwilck Nov 27, 2017
1db196a
lib/string.c: implement a basic bcmp
nickdesaulniers Apr 6, 2019
a885dce
scripts: merge from N770F_13
ananjaser1211 Jun 25, 2024
c8f9e4b
drivers: sec_debug: fix linking error for simulate_WRITE_RO()
evdenis Jun 25, 2024
f2978df
drivers: remove old flag fixes
ananjaser1211 Jun 25, 2024
801a785
configs: exynos9810: disable CRYPTO_FIPS
ananjaser1211 Jun 25, 2024
dedd0fa
Makefile: readelf FMP_FIPS
ananjaser1211 Jun 25, 2024
1f785b2
Apollo: update clang flags
ananjaser1211 Jun 25, 2024
041625d
drivers: dpu: fix GCC compiling
ananjaser1211 Jun 25, 2024
f6f929a
Makefile: update
ananjaser1211 Jul 23, 2024
7dd6975
lib/string.c: implement stpcpy
nickdesaulniers Sep 26, 2020
1e8e00b
drivers: soc: cal-if: Prevent optimization of structs on fvmap_copy_f…
TenSeventy7 Aug 5, 2021
50cc688
configs: exynos9810: disable VDSO
ananjaser1211 Jul 26, 2024
9a6ce8a
gpu: mali: r38p1: fix strict-prototypes errors with clang-18
ananjaser1211 Jul 27, 2024
1c3995f
gpu: mali: r38p1: fix more strict-prototypes errors with clang-18
ananjaser1211 Jul 26, 2024
2790fdb
gpu: mali: r38p1: fix implicit-int
ananjaser1211 Jul 26, 2024
9138971
security: sdp: fix strict-prototypes error
ananjaser1211 Jul 26, 2024
43da6e4
media: tdmb: fix strict-prototypes error
ananjaser1211 Jul 26, 2024
d36fc71
net: wireless: bcmdhd_101_16: fix strict-prototypes errors with clang-18
ananjaser1211 Jul 26, 2024
6c06b5e
soc: samsung: exynos-hdcp: fix strict-prototypes errors with clang-18
ananjaser1211 Jul 26, 2024
9670ed9
fs: f2fs: fix F2FS_NAME_LEN Wint-conversion
ananjaser1211 Jul 27, 2024
536bb5a
apollo: update and add new compilers
ananjaser1211 Jul 27, 2024
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
23 changes: 23 additions & 0 deletions Documentation/filesystems/overlayfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,29 @@ Only the lists of names from directories are merged. Other content
such as metadata and extended attributes are reported for the upper
directory only. These attributes of the lower directory are hidden.

credentials
-----------

By default, all access to the upper, lower and work directories is the
recorded mounter's MAC and DAC credentials. The incoming accesses are
checked against the caller's credentials.

In the case where caller MAC or DAC credentials do not overlap, a
use case available in older versions of the driver, the
override_creds mount flag can be turned off and help when the use
pattern has caller with legitimate credentials where the mounter
does not. Several unintended side effects will occur though. The
caller without certain key capabilities or lower privilege will not
always be able to delete files or directories, create nodes, or
search some restricted directories. The ability to search and read
a directory entry is spotty as a result of the cache mechanism not
retesting the credentials because of the assumption, a privileged
caller can fill cache, then a lower privilege can read the directory
cache. The uneven security model where cache, upperdir and workdir
are opened at privilege, but accessed without creating a form of
privilege escalation, should only be used with strict understanding
of the side effects and of the security policies.

whiteouts and opaque directories
--------------------------------

Expand Down
96 changes: 56 additions & 40 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,8 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
# "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
#ARCH ?= $(SUBARCH)
#CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
ARCH ?= arm64
#CROSS_COMPILE ?= ../PLATFORM/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
CROSS_COMPILE ?= $(srctree)/toolchain/gcc-cfp/gcc-ibv-jopp/aarch64-linux-android-4.9/bin/aarch64-linux-android-

# Architecture as present in compile.h
UTS_MACHINE := $(ARCH)
Expand Down Expand Up @@ -306,14 +303,13 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else if [ -x /bin/bash ]; then echo /bin/bash; \
else echo sh; fi ; fi)

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

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
ifeq ($(CONFIG_EXYNOS_FMP_FIPS),)
READELF = $(CROSS_COMPILE)readelf
export READELF
endif

# Decide whether to build built-in, modular, or both.
Expand Down Expand Up @@ -351,16 +347,16 @@ scripts/Kbuild.include: ;
include scripts/Kbuild.include

# Make variables (CC, etc...)
AS = $(CCACHE) $(CROSS_COMPILE)as
LD = $(CCACHE) $(CROSS_COMPILE)ld
LDGOLD = $(CCACHE) $(CROSS_COMPILE)ld.gold
CC = $(CCACHE) $(CROSS_COMPILE)gcc
CPP = $(CCACHE) $(CC) -E
AR = $(CCACHE) $(CROSS_COMPILE)ar
NM = $(CCACHE) $(CROSS_COMPILE)nm
STRIP = $(CCACHE) $(CROSS_COMPILE)strip
OBJCOPY = $(CCACHE) $(CROSS_COMPILE)objcopy
OBJDUMP = $(CCACHE) $(CROSS_COMPILE)objdump
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
LDGOLD = $(CROSS_COMPILE)ld.gold
CC = $(CROSS_COMPILE)gcc
CPP = $(CC) -E
AR = $(CROSS_COMPILE)ar
NM = $(CROSS_COMPILE)nm
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
AWK = awk
GENKSYMS = scripts/genksyms/genksyms
INSTALLKERNEL := installkernel
Expand Down Expand Up @@ -403,7 +399,7 @@ LINUXINCLUDE += $(filter-out $(LINUXINCLUDE),$(USERINCLUDE))

KBUILD_AFLAGS := -D__ASSEMBLY__
KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common \
-fno-strict-aliasing -fno-common -fshort-wchar \
-Werror-implicit-function-declaration \
-Wno-format-security \
-std=gnu89
Expand All @@ -414,6 +410,7 @@ KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
GCC_PLUGINS_CFLAGS :=
CLANG_FLAGS :=

# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
Expand All @@ -426,7 +423,8 @@ export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS

export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_KASAN CFLAGS_UBSAN
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE CFLAGS_UBSAN
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
Expand Down Expand Up @@ -532,6 +530,25 @@ ifneq ($(filter install,$(MAKECMDGOALS)),)
endif
endif

ifeq ($(cc-name),clang)
ifneq ($(CROSS_COMPILE),)
CLANG_TRIPLE ?= $(CROSS_COMPILE)
CLANG_FLAGS += --target=$(notdir $(CLANG_TRIPLE:%-=%))
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
endif
ifneq ($(GCC_TOOLCHAIN),)
CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
endif
KBUILD_CFLAGS += -Wno-sizeof-pointer-div
CLANG_FLAGS += -no-integrated-as
CLANG_FLAGS += -Werror=unknown-warning-option
KBUILD_CFLAGS += $(CLANG_FLAGS)
KBUILD_AFLAGS += $(CLANG_FLAGS)
endif


ifeq ($(mixed-targets),1)
# ===========================================================================
# We're called with mixed targets (*config and build targets).
Expand Down Expand Up @@ -673,6 +690,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context)
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias)

ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
Expand Down Expand Up @@ -780,21 +798,9 @@ endif
KBUILD_CFLAGS += $(stackp-flag)

ifeq ($(cc-name),clang)
ifneq ($(CROSS_COMPILE),)
CLANG_TRIPLE ?= $(CROSS_COMPILE)
CLANG_TARGET := --target=$(notdir $(CLANG_TRIPLE:%-=%))
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, unused-variable)
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)
# Quiet clang warning: comparison of unsigned expression < 0 is always false
KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
Expand All @@ -803,14 +809,11 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
# 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)
# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias)
KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
Expand All @@ -823,6 +826,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, unused-function)
KBUILD_CFLAGS += $(call cc-disable-warning, implicit-function-declaration)
endif

KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
Expand Down Expand Up @@ -851,10 +855,10 @@ KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,)
endif

ifdef CONFIG_RKP_CFP_JOPP
# Don't use jump tables for switch statements, since this generates indirect jump (br)
# Don't use jump tables for switch statements, since this generates indirect jump (br)
# instructions, which are very dangerous for kernel control flow integrity.
KBUILD_CFLAGS += -fno-jump-tables
endif
endif

ifdef CONFIG_DEBUG_INFO_REDUCED
KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \
Expand Down Expand Up @@ -927,6 +931,18 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=date-time)
# enforce correct pointer usage
KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)

# Require designated initializers for all marked structures
KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)

# change __FILE__ to the relative path from the srctree
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)

# ensure -fcf-protection is disabled when using retpoline as it is
# incompatible with -mindirect-branch=thunk-extern
ifdef CONFIG_RETPOLINE
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
endif

# use the deterministic mode of AR if available
KBUILD_ARFLAGS := $(call ar-option,D)

Expand Down
64 changes: 50 additions & 14 deletions apollo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ CR_GCC4=~/Android/Toolchains/aarch64-linux-android-4.9/bin/aarch64-linux-android
CR_GCC9=~/Android/Toolchains/aarch64-linux-gnu-9.x/bin/aarch64-linux-gnu-
CR_GCC12=~/Android/Toolchains/aarch64-linux-gnu-12.x/bin/aarch64-linux-gnu-
CR_GCC13=~/Android/Toolchains/aarch64-linux-gnu-13.x/bin/aarch64-linux-gnu-
CR_CLANG=~/Android/Toolchains/clang-r353983c/bin
CR_CLANG_11=~/Android/Toolchains/clang-r383902-jopp
CR_CLANG_12=~/Android/Toolchains/clang-r416183b
CR_CLANG_14=~/Android/Toolchains/clang-r450784d
CR_CLANG_EXP=~/Android/Toolchains/clang-r522817
#####################################################

# Compiler Selection
Expand All @@ -102,12 +105,42 @@ export CROSS_COMPILE=$CR_GCC13
compile="make"
CR_COMPILER="$CR_GCC13"
fi
if [ $CR_COMPILER = "5" ]; then
export CLANG_PATH=$CR_CLANG
export CROSS_COMPILE=$CR_GCC4
export CLANG_TRIPLE=aarch64-linux-gnu-
compile="make CC=clang ARCH=arm64"
export PATH=${CLANG_PATH}:${PATH}
if [ $CR_COMPILER = "5" ] || [ $CR_COMPILER = "6" ] || [ $CR_COMPILER = "7" ] || [ $CR_COMPILER = "8" ]; then
if [ $CR_COMPILER = "5" ]; then
CR_CLANG=$CR_CLANG_11
elif [ $CR_COMPILER = "6" ]; then
CR_CLANG=$CR_CLANG_12
elif [ $CR_COMPILER = "7" ]; then
CR_CLANG=$CR_CLANG_14
elif [ $CR_COMPILER = "8" ]; then
CR_CLANG=$CR_CLANG_EXP
fi

# Check packages
for pkg in gcc-arm-linux-gnueabi gcc-aarch64-linux-gnu; do
if ! dpkg-query -W -f='${Status}' $pkg | grep "ok installed"; then
echo " $pkg is missing, please install with sudo apt-get install $pkg"
exit 0;
fi
done

export PATH=$CR_CLANG/bin:$CR_CLANG/lib:${PATH}
export CLANG_TRIPLE=$CR_GCC9
export CROSS_COMPILE=$CR_GCC9
export CROSS_COMPILE_ARM32=arm-linux-gnueabi-
export CC=$CR_CLANG/bin/clang
export REAL_CC=$CR_CLANG/bin/clang
export LD=$CR_CLANG/bin/ld.lld
export AR=$CR_CLANG/bin/llvm-ar
export NM=$CR_CLANG/bin/llvm-nm
export OBJCOPY=$CR_CLANG/bin/llvm-objcopy
export OBJDUMP=$CR_CLANG/bin/llvm-objdump
export READELF=$CR_CLANG/bin/llvm-readelf
export STRIP=$CR_CLANG/bin/llvm-strip
export LLVM=1
export LLVM_IAS=1
export ARCH=arm64 && export SUBARCH=arm64
compile="make ARCH=arm64 CC=clang"
CR_COMPILER="$CR_CLANG"
fi
}
Expand Down Expand Up @@ -279,7 +312,7 @@ PACK_BOOT_IMG()
echo " Abort "
fi
# Remove red warning at boot
echo -n "SEANDROIDENFORCE" $CR_AIK/image-new.img
echo -n "SEANDROIDENFORCE" >> $CR_AIK/image-new.img
# Copy boot.img to Production folder
if [ ! -e $CR_PRODUCT ]; then
mkdir $CR_PRODUCT
Expand Down Expand Up @@ -391,14 +424,14 @@ BUILD_DEBUG(){
echo "----------------------------------------------"
echo " DEBUG : Debug build initiated "
CR_TARGET=5
CR_COMPILER=2
CR_SELINUX=1
CR_COMPILER=8
CR_SELINUX=0
CR_KSU="y"
CR_CLEAN="n"
echo " DEBUG : Set Build options "
echo " DEBUG : Variant : $CR_VARIANT_G965N"
echo " DEBUG : Compiler : $CR_GCC9"
echo " DEBUG : Selinux : $CR_SELINUX Permissive"
echo " DEBUG : Compiler : $CR_CLANG_EXP"
echo " DEBUG : Selinux : $CR_SELINUX Enforcing"
echo " DEBUG : Clean : $CR_CLEAN"
echo "----------------------------------------------"
BUILD
Expand Down Expand Up @@ -508,9 +541,12 @@ echo "1) $CR_GCC4 (GCC 4.9)"
echo "2) $CR_GCC9 (GCC 9.x)"
echo "3) $CR_GCC12 (GCC 12.x)"
echo "4) $CR_GCC13 (GCC 13.x)"
echo "5) $CR_CLANG (CLANG)"
echo "5) $CR_CLANG_11 (Clang 11 - Samsung)"
echo "6) $CR_CLANG_12 (Clang 12)"
echo "7) $CR_CLANG_14 (Clang 14)"
echo "8) $CR_CLANG_EXP (Clang 18)"
echo " "
read -p "Please select your compiler (1-5) > " CR_COMPILER
read -p "Please select your compiler (1-8) > " CR_COMPILER
echo " "
echo "1) Selinux Permissive " "2) Selinux Enforcing"
echo " "
Expand Down
37 changes: 31 additions & 6 deletions arch/arm/include/asm/vdso_datapage.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,53 @@

#include <asm/page.h>

#ifndef _VDSO_WTM_CLOCK_SEC_T
#define _VDSO_WTM_CLOCK_SEC_T
typedef u32 vdso_wtm_clock_nsec_t;
#endif

#ifndef _VDSO_XTIME_CLOCK_SEC_T
#define _VDSO_XTIME_CLOCK_SEC_T
typedef u32 vdso_xtime_clock_sec_t;
#endif

#ifndef _VDSO_RAW_TIME_SEC_T
#define _VDSO_RAW_TIME_SEC_T
typedef u32 vdso_raw_time_sec_t;
#endif

/* Try to be cache-friendly on systems that don't implement the
* generic timer: fit the unconditionally updated fields in the first
* 32 bytes.
*/
struct vdso_data {
u32 seq_count; /* sequence count - odd during updates */
u16 tk_is_cntvct; /* fall back to syscall if false */
u32 tb_seq_count; /* sequence count - odd during updates */
u16 use_syscall; /* fall back to syscall if true */
u16 cs_shift; /* clocksource shift */
u32 xtime_coarse_sec; /* coarse time */
u32 xtime_coarse_nsec;

u32 wtm_clock_sec; /* wall to monotonic offset */
u32 wtm_clock_nsec;
u32 xtime_clock_sec; /* CLOCK_REALTIME - seconds */
u32 cs_mult; /* clocksource multiplier */
/* wall to monotonic offset */
u32 wtm_clock_sec;
vdso_wtm_clock_nsec_t wtm_clock_nsec;
/* CLOCK_REALTIME - seconds */
vdso_xtime_clock_sec_t xtime_clock_sec;
u32 cs_mono_mult; /* clocksource multiplier */

u64 cs_cycle_last; /* last cycle value */
u64 cs_mask; /* clocksource mask */

u64 xtime_clock_snsec; /* CLOCK_REALTIME sub-ns base */
u32 tz_minuteswest; /* timezone info for gettimeofday(2) */
u32 tz_dsttime;

u32 btm_sec; /* monotonic to boot time */
u32 btm_nsec;
/* Raw clocksource multipler */
u32 cs_raw_mult;
/* Raw time */
vdso_raw_time_sec_t raw_time_sec;
u32 raw_time_nsec;
};

union vdso_data_store {
Expand Down
Loading