WiringOP-Zero
WiringOP-Zero copied to clipboard
error in build gpio.o: error adding symbols: Bad value (R_ARM_THM_MOVW_ABS_NC)
Hi, I'm trying to build on my OPIZ
here is the PI:
Welcome to ARMBIAN 5.38 stable Debian GNU/Linux 9 (stretch) 4.14.18-sunxi
System load: 0.41 0.25 0.10 Up time: 1 min
Memory usage: 9 % of 493MB IP: 192.168.1.18
CPU temp: 35°C
Usage of /: 8% of 15G
here is the log
GPIO Utility
[Link]
/usr/bin/ld: gpio.o: relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
gpio.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:48: recipe for target 'gpio' failed
make: *** [gpio] Error 1
I tried to add -fPIC flag in gpio/Makefile with no success
@$(CC) -o $@ $(OBJ) $(LDFLAGS) -fPIC $(LIBS)
same here
This can be resolved by adding -fPIC in the CFLAGS in the Makefile for wiringPi:
CFLAGS += $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
Same error with your line
rzeldent solution works for me if I deleted the already complied *.o files.
cd gpio
rm *.o
cd ..
./build