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

Updated Makefile #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomhollingworth
Copy link

@tomhollingworth tomhollingworth commented Apr 21, 2017

Make was failing on a vanilla Ubuntu Mate 16.04 LTS image on a RPi3.

$ sudo make
mkdir -p obj/
gcc -O2 -Wall -c -I/usr/include/python2.7 -I/home/tom/Downloads/VL53L0X_rasp_python -I/home/tom/Downloads/VL53L0X_rasp_python/Api/core/inc -I/home/tom/Downloads/VL53L0X_rasp_python/platform/inc /home/tom/Downloads/VL53L0X_rasp_python/Api/core/src/vl53l0x_api_calibration.c -o obj/vl53l0x_api_calibration.o
mkdir -p obj/
gcc -O2 -Wall -c -I/usr/include/python2.7 -I/home/tom/Downloads/VL53L0X_rasp_python -I/home/tom/Downloads/VL53L0X_rasp_python/Api/core/inc -I/home/tom/Downloads/VL53L0X_rasp_python/platform/inc /home/tom/Downloads/VL53L0X_rasp_python/Api/core/src/vl53l0x_api_core.c -o obj/vl53l0x_api_core.o
mkdir -p obj/
gcc -O2 -Wall -c -I/usr/include/python2.7 -I/home/tom/Downloads/VL53L0X_rasp_python -I/home/tom/Downloads/VL53L0X_rasp_python/Api/core/inc -I/home/tom/Downloads/VL53L0X_rasp_python/platform/inc /home/tom/Downloads/VL53L0X_rasp_python/Api/core/src/vl53l0x_api_ranging.c -o obj/vl53l0x_api_ranging.o
mkdir -p obj/
gcc -O2 -Wall -c -I/usr/include/python2.7 -I/home/tom/Downloads/VL53L0X_rasp_python -I/home/tom/Downloads/VL53L0X_rasp_python/Api/core/inc -I/home/tom/Downloads/VL53L0X_rasp_python/platform/inc /home/tom/Downloads/VL53L0X_rasp_python/Api/core/src/vl53l0x_api_strings.c -o obj/vl53l0x_api_strings.o
mkdir -p obj/
gcc -O2 -Wall -c -I/usr/include/python2.7 -I/home/tom/Downloads/VL53L0X_rasp_python -I/home/tom/Downloads/VL53L0X_rasp_python/Api/core/inc -I/home/tom/Downloads/VL53L0X_rasp_python/platform/inc /home/tom/Downloads/VL53L0X_rasp_python/Api/core/src/vl53l0x_api.c -o obj/vl53l0x_api.o
mkdir -p obj/
gcc -O2 -Wall -c -I/usr/include/python2.7 -I/home/tom/Downloads/VL53L0X_rasp_python -I/home/tom/Downloads/VL53L0X_rasp_python/Api/core/inc -I/home/tom/Downloads/VL53L0X_rasp_python/platform/inc /home/tom/Downloads/VL53L0X_rasp_python/platform/src/vl53l0x_platform.c -o obj/vl53l0x_platform.o
mkdir -p obj/
gcc -O2 -Wall -c -I/usr/include/python2.7 -I/home/tom/Downloads/VL53L0X_rasp_python -I/home/tom/Downloads/VL53L0X_rasp_python/Api/core/inc -I/home/tom/Downloads/VL53L0X_rasp_python/platform/inc /home/tom/Downloads/VL53L0X_rasp_python/python_lib/vl53l0x_python.c -o obj/vl53l0x_python.o
mkdir -p bin/
gcc -shared obj/vl53l0x_api_calibration.o obj/vl53l0x_api_core.o obj/vl53l0x_api_ranging.o obj/vl53l0x_api_strings.o obj/vl53l0x_api.o obj/vl53l0x_platform.o obj/vl53l0x_python.o -I/usr/include/python2.7 -I/home/tom/Downloads/VL53L0X_rasp_python -I/home/tom/Downloads/VL53L0X_rasp_python/Api/core/inc -I/home/tom/Downloads/VL53L0X_rasp_python/platform/inc -lpthread -o bin/vl53l0x_python.so
/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.

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.
Gadgetoid referenced this pull request in Gadgetoid/VL53L0X-python Jun 20, 2018
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

Successfully merging this pull request may close these issues.

1 participant