mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-26 04:16:39 +00:00
tools/virtio: fix build break for aarch64
[ Upstream commit77b894f220
] "-mfunction-return=thunk -mindirect-branch-register" are only valid for x86. So introduce compiler operation check to avoid such issues Fixes:0d0ed40061
("tools/virtio: enable to build with retpoline") Signed-off-by: Peng Fan <peng.fan@nxp.com> Message-Id: <20230323040024.3809108-1-peng.fan@oss.nxp.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7b6a9ec3ed
commit
e975c52403
1 changed files with 12 additions and 1 deletions
|
@ -4,7 +4,18 @@ test: virtio_test vringh_test
|
||||||
virtio_test: virtio_ring.o virtio_test.o
|
virtio_test: virtio_ring.o virtio_test.o
|
||||||
vringh_test: vringh_test.o vringh.o virtio_ring.o
|
vringh_test: vringh_test.o vringh.o virtio_ring.o
|
||||||
|
|
||||||
CFLAGS += -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h -mfunction-return=thunk -fcf-protection=none -mindirect-branch-register
|
try-run = $(shell set -e; \
|
||||||
|
if ($(1)) >/dev/null 2>&1; \
|
||||||
|
then echo "$(2)"; \
|
||||||
|
else echo "$(3)"; \
|
||||||
|
fi)
|
||||||
|
|
||||||
|
__cc-option = $(call try-run,\
|
||||||
|
$(1) -Werror $(2) -c -x c /dev/null -o /dev/null,$(2),)
|
||||||
|
cc-option = $(call __cc-option, $(CC),$(1))
|
||||||
|
|
||||||
|
CFLAGS += -g -O2 -Werror -Wno-maybe-uninitialized -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE -include ../../include/linux/kconfig.h $(call cc-option,-mfunction-return=thunk) $(call cc-option,-fcf-protection=none) $(call cc-option,-mindirect-branch-register)
|
||||||
|
|
||||||
CFLAGS += -pthread
|
CFLAGS += -pthread
|
||||||
LDFLAGS += -pthread
|
LDFLAGS += -pthread
|
||||||
vpath %.c ../../drivers/virtio ../../drivers/vhost
|
vpath %.c ../../drivers/virtio ../../drivers/vhost
|
||||||
|
|
Loading…
Reference in a new issue