Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in build gpio.o: error adding symbols: Bad value (R_ARM_THM_MOVW_ABS_NC) #19

Open
bodtx opened this issue Mar 31, 2018 · 4 comments

Comments

@bodtx
Copy link

bodtx commented Mar 31, 2018

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)

@pkrich
Copy link

pkrich commented Jun 9, 2018

same here

@rzeldent
Copy link

rzeldent commented Jun 10, 2018

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

@bodtx
Copy link
Author

bodtx commented Jul 24, 2018

Same error with your line

@hunasdf
Copy link

hunasdf commented Jun 8, 2019

rzeldent solution works for me if I deleted the already complied *.o files.

cd gpio
rm *.o
cd ..
./build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants