From 85892581f7568b7831376de21f385913485ea24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Sun, 8 Jul 2018 18:21:43 +0200 Subject: [PATCH] In order to avoid blhost segfaults, statically link it, and set its architecture to x86-64 so that it won't contain special instructions. This change was made by @iprok. See https://github.com/UltimateHackingKeyboard/agent/issues/681#issuecomment-403057795 --- validation/blhost/gcc/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/validation/blhost/gcc/Makefile b/validation/blhost/gcc/Makefile index b6c8f31..b47ebfa 100644 --- a/validation/blhost/gcc/Makefile +++ b/validation/blhost/gcc/Makefile @@ -38,8 +38,8 @@ INCLUDES += $(BOOT_ROOT)/validation/blhost/src \ $(BOOT_ROOT)/src/drivers/common \ $(BOOT_ROOT)/src/bm_usb -CXXFLAGS := -D LINUX -D BOOTLOADER_HOST -std=c++11 -CFLAGS := -std=c99 -D LINUX -D BOOTLOADER_HOST -D _GNU_SOURCE +CXXFLAGS := -D LINUX -D BOOTLOADER_HOST -std=c++11 -march=x86-64 -mtune=generic +CFLAGS := -std=c99 -D LINUX -D BOOTLOADER_HOST -D _GNU_SOURCE -mtune=generic -march=x86-64 LD := g++ SOURCES := $(BOOT_ROOT)/validation/blhost/src/blhost.cpp \ @@ -199,7 +199,7 @@ $(MAKE_TARGET): $(OBJECTS_ALL) @$(call printmessage,link,Linking, $(APP_NAME)) $(at)$(LD) $(LDFLAGS) \ $(OBJECTS_ALL) \ - -lc -lstdc++ -lm -ludev \ + -static -lc -lstdc++ -lm -ludev -lrt \ -o $@ @echo "Output binary:" ; echo " $(APP_NAME)"