From f5c4cb7c93d32afe04c8890b4bb11061fc627aa3 Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 21 Apr 2017 15:04:41 +1000 Subject: [PATCH] Updated Makefile Compile was failing on a vanilla Ubuntu Mate 16.04 LTS: ``` /usr/bin/ld: obj/vl53l0x_api_calibration.o: relocation R_ARM_THM_MOVW_ABS_NC against `__stack_chk_guard' can not be used when making a shared object; recompile with -fPIC obj/vl53l0x_api_calibration.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status Makefile:44: recipe for target 'bin/vl53l0x_python' failed ``` Added -fPIC as instructed and compiled and executed ok. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 93c1099..d0dcb3d 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ CC = $(CROSS_COMPILE)gcc RM = rm #CFLAGS = -O0 -g -Wall -c -CFLAGS = -O2 -Wall -c +CFLAGS = -O2 -Wall -c -fPIC OUTPUT_DIR = bin OBJ_DIR = obj