forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/arm64/kernel/vdso32/Makefile
....@@ -10,18 +10,15 @@
1010
1111 # Same as cc-*option, but using CC_COMPAT instead of CC
1212 ifeq ($(CONFIG_CC_IS_CLANG), y)
13
-CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
14
-
1513 CC_COMPAT ?= $(CC)
16
-CC_COMPAT += $(CC_COMPAT_CLANG_FLAGS)
17
-
18
-ifeq ($(LLVM),1)
19
-LD_COMPAT ?= $(LD)
20
-else
21
-LD_COMPAT ?= $(CROSS_COMPILE_COMPAT)ld
22
-endif
14
+CC_COMPAT += --target=arm-linux-gnueabi
2315 else
2416 CC_COMPAT ?= $(CROSS_COMPILE_COMPAT)gcc
17
+endif
18
+
19
+ifeq ($(CONFIG_LD_IS_LLD), y)
20
+LD_COMPAT ?= $(LD)
21
+else
2522 LD_COMPAT ?= $(CROSS_COMPILE_COMPAT)ld
2623 endif
2724
....@@ -40,17 +37,13 @@
4037 # As a result we set our own flags here.
4138
4239 # KBUILD_CPPFLAGS and NOSTDINC_FLAGS from top-level Makefile
43
-VDSO_CPPFLAGS := -D__KERNEL__ -nostdinc
40
+VDSO_CPPFLAGS := -DBUILD_VDSO -D__KERNEL__ -nostdinc
4441 VDSO_CPPFLAGS += -isystem $(shell $(CC_COMPAT) -print-file-name=include 2>/dev/null)
4542 VDSO_CPPFLAGS += $(LINUXINCLUDE)
4643
4744 # Common C and assembly flags
4845 # From top-level Makefile
4946 VDSO_CAFLAGS := $(VDSO_CPPFLAGS)
50
-ifneq ($(shell $(CC_COMPAT) --version 2>&1 | head -n 1 | grep clang),)
51
-VDSO_CAFLAGS += --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
52
-endif
53
-
5447 VDSO_CAFLAGS += $(call cc32-option,-fno-PIE)
5548 ifdef CONFIG_DEBUG_INFO
5649 VDSO_CAFLAGS += -g
....@@ -88,9 +81,9 @@
8881 # Some useful compiler-dependent flags from top-level Makefile
8982 VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,)
9083 VDSO_CFLAGS += $(call cc32-option,-Wno-pointer-sign)
91
-VDSO_CFLAGS += $(call cc32-option,-fno-strict-overflow)
84
+VDSO_CFLAGS += -fno-strict-overflow
9285 VDSO_CFLAGS += $(call cc32-option,-Werror=strict-prototypes)
93
-VDSO_CFLAGS += $(call cc32-option,-Werror=date-time)
86
+VDSO_CFLAGS += -Werror=date-time
9487 VDSO_CFLAGS += $(call cc32-option,-Werror=incompatible-pointer-types)
9588
9689 # The 32-bit compiler does not provide 128-bit integers, which are used in
....@@ -102,6 +95,14 @@
10295 # (on GCC 4.8 or older, there is unfortunately no way to silence this warning)
10396 VDSO_CFLAGS += $(call cc32-disable-warning,shift-count-overflow)
10497 VDSO_CFLAGS += -Wno-int-to-pointer-cast
98
+
99
+# Compile as THUMB2 or ARM. Unwinding via frame-pointers in THUMB2 is
100
+# unreliable.
101
+ifeq ($(CONFIG_THUMB2_COMPAT_VDSO), y)
102
+VDSO_CFLAGS += -mthumb -fomit-frame-pointer
103
+else
104
+VDSO_CFLAGS += -marm
105
+endif
105106
106107 VDSO_AFLAGS := $(VDSO_CAFLAGS)
107108 VDSO_AFLAGS += -D__ASSEMBLY__
....@@ -115,18 +116,17 @@
115116 # From arm vDSO Makefile
116117 VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1
117118 VDSO_LDFLAGS += -z max-page-size=4096 -z common-page-size=4096
118
-VDSO_LDFLAGS += -nostdlib -shared --hash-style=sysv --build-id
119
+VDSO_LDFLAGS += -nostdlib -shared --hash-style=sysv --build-id=sha1
119120
120121
121122 # Borrow vdsomunge.c from the arm vDSO
122123 # We have to use a relative path because scripts/Makefile.host prefixes
123
-# $(hostprogs-y) with $(obj)
124
+# $(hostprogs) with $(obj)
124125 munge := ../../../arm/vdso/vdsomunge
125
-hostprogs-y := $(munge)
126
+hostprogs := $(munge)
126127
127128 c-obj-vdso := note.o
128129 c-obj-vdso-gettimeofday := vgettimeofday.o
129
-asm-obj-vdso := sigreturn.o
130130
131131 ifneq ($(c-gettimeofday-y),)
132132 VDSO_CFLAGS_gettimeofday_o += -include $(c-gettimeofday-y)
....@@ -142,7 +142,7 @@
142142 obj-vdso := $(c-obj-vdso) $(c-obj-vdso-gettimeofday) $(asm-obj-vdso)
143143
144144 obj-y += vdso.o
145
-extra-y += vdso.lds
145
+targets += vdso.lds
146146 CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
147147
148148 # Force dependency (vdso.s includes vdso.so through incbin)