| .. | .. |
|---|
| 10 | 10 | |
|---|
| 11 | 11 | # Same as cc-*option, but using CC_COMPAT instead of CC |
|---|
| 12 | 12 | ifeq ($(CONFIG_CC_IS_CLANG), y) |
|---|
| 13 | | -CC_COMPAT_CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%)) |
|---|
| 14 | | - |
|---|
| 15 | 13 | 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 |
|---|
| 23 | 15 | else |
|---|
| 24 | 16 | CC_COMPAT ?= $(CROSS_COMPILE_COMPAT)gcc |
|---|
| 17 | +endif |
|---|
| 18 | + |
|---|
| 19 | +ifeq ($(CONFIG_LD_IS_LLD), y) |
|---|
| 20 | +LD_COMPAT ?= $(LD) |
|---|
| 21 | +else |
|---|
| 25 | 22 | LD_COMPAT ?= $(CROSS_COMPILE_COMPAT)ld |
|---|
| 26 | 23 | endif |
|---|
| 27 | 24 | |
|---|
| .. | .. |
|---|
| 40 | 37 | # As a result we set our own flags here. |
|---|
| 41 | 38 | |
|---|
| 42 | 39 | # KBUILD_CPPFLAGS and NOSTDINC_FLAGS from top-level Makefile |
|---|
| 43 | | -VDSO_CPPFLAGS := -D__KERNEL__ -nostdinc |
|---|
| 40 | +VDSO_CPPFLAGS := -DBUILD_VDSO -D__KERNEL__ -nostdinc |
|---|
| 44 | 41 | VDSO_CPPFLAGS += -isystem $(shell $(CC_COMPAT) -print-file-name=include 2>/dev/null) |
|---|
| 45 | 42 | VDSO_CPPFLAGS += $(LINUXINCLUDE) |
|---|
| 46 | 43 | |
|---|
| 47 | 44 | # Common C and assembly flags |
|---|
| 48 | 45 | # From top-level Makefile |
|---|
| 49 | 46 | 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 | | - |
|---|
| 54 | 47 | VDSO_CAFLAGS += $(call cc32-option,-fno-PIE) |
|---|
| 55 | 48 | ifdef CONFIG_DEBUG_INFO |
|---|
| 56 | 49 | VDSO_CAFLAGS += -g |
|---|
| .. | .. |
|---|
| 88 | 81 | # Some useful compiler-dependent flags from top-level Makefile |
|---|
| 89 | 82 | VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,) |
|---|
| 90 | 83 | VDSO_CFLAGS += $(call cc32-option,-Wno-pointer-sign) |
|---|
| 91 | | -VDSO_CFLAGS += $(call cc32-option,-fno-strict-overflow) |
|---|
| 84 | +VDSO_CFLAGS += -fno-strict-overflow |
|---|
| 92 | 85 | VDSO_CFLAGS += $(call cc32-option,-Werror=strict-prototypes) |
|---|
| 93 | | -VDSO_CFLAGS += $(call cc32-option,-Werror=date-time) |
|---|
| 86 | +VDSO_CFLAGS += -Werror=date-time |
|---|
| 94 | 87 | VDSO_CFLAGS += $(call cc32-option,-Werror=incompatible-pointer-types) |
|---|
| 95 | 88 | |
|---|
| 96 | 89 | # The 32-bit compiler does not provide 128-bit integers, which are used in |
|---|
| .. | .. |
|---|
| 102 | 95 | # (on GCC 4.8 or older, there is unfortunately no way to silence this warning) |
|---|
| 103 | 96 | VDSO_CFLAGS += $(call cc32-disable-warning,shift-count-overflow) |
|---|
| 104 | 97 | 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 |
|---|
| 105 | 106 | |
|---|
| 106 | 107 | VDSO_AFLAGS := $(VDSO_CAFLAGS) |
|---|
| 107 | 108 | VDSO_AFLAGS += -D__ASSEMBLY__ |
|---|
| .. | .. |
|---|
| 115 | 116 | # From arm vDSO Makefile |
|---|
| 116 | 117 | VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1 |
|---|
| 117 | 118 | 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 |
|---|
| 119 | 120 | |
|---|
| 120 | 121 | |
|---|
| 121 | 122 | # Borrow vdsomunge.c from the arm vDSO |
|---|
| 122 | 123 | # We have to use a relative path because scripts/Makefile.host prefixes |
|---|
| 123 | | -# $(hostprogs-y) with $(obj) |
|---|
| 124 | +# $(hostprogs) with $(obj) |
|---|
| 124 | 125 | munge := ../../../arm/vdso/vdsomunge |
|---|
| 125 | | -hostprogs-y := $(munge) |
|---|
| 126 | +hostprogs := $(munge) |
|---|
| 126 | 127 | |
|---|
| 127 | 128 | c-obj-vdso := note.o |
|---|
| 128 | 129 | c-obj-vdso-gettimeofday := vgettimeofday.o |
|---|
| 129 | | -asm-obj-vdso := sigreturn.o |
|---|
| 130 | 130 | |
|---|
| 131 | 131 | ifneq ($(c-gettimeofday-y),) |
|---|
| 132 | 132 | VDSO_CFLAGS_gettimeofday_o += -include $(c-gettimeofday-y) |
|---|
| .. | .. |
|---|
| 142 | 142 | obj-vdso := $(c-obj-vdso) $(c-obj-vdso-gettimeofday) $(asm-obj-vdso) |
|---|
| 143 | 143 | |
|---|
| 144 | 144 | obj-y += vdso.o |
|---|
| 145 | | -extra-y += vdso.lds |
|---|
| 145 | +targets += vdso.lds |
|---|
| 146 | 146 | CPPFLAGS_vdso.lds += -P -C -U$(ARCH) |
|---|
| 147 | 147 | |
|---|
| 148 | 148 | # Force dependency (vdso.s includes vdso.so through incbin) |
|---|