I am trying to build and include the TinkerBoard python gpio library in a custom LIbreElec build.
Cloned rockchip branch and built it successfully in Ubuntu VM. Now I have created the following package.mk in /projects/Rockchip/packages/gpio_lib_python/ directory.
PKG_NAME="gpio_lib_python"
PKG_VERSION="0.1"
#PKG_SHA256="953be622e88323c6f43fad61ffd05bebe73b9fd9863a46d68b052d2aa7d71ce2"
PKG_ARCH="arm"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/TinkerBoard/gpio_lib_python"
PKG_URL="https://github.com/TinkerBoard/gpio_lib_python/archive/sbc/tinkerboard/python.zip"
PKG_SOURCE_DIR="gpio_lib_python-sbc-tinkerboard-python"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
#PKG_DEPENDS_TARGET="toolchain Python2"
PKG_SECTION="python/system"
PKG_SHORTDESC="TinkerBoard python gpio library"
PKG_LONGDESC="TinkerBoard python gpio library"
PKG_TOOLCHAIN="manual"
pre_make_target() {
#strip_lto
export PYTHONXCPREFIX="$SYSROOT_PREFIX/usr"
}
make_target() {
#python setup.py build --cross-compile
python setup.py build --verbose
}
makeinstall_target() {
python setup.py install --verbose --root=$INSTALL --prefix=/usr
#python setup_RPi.py install --root=$INSTALL --prefix=/usr
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
rm -rf $INSTALL/usr/lib/python*/site-packages/*/tests
}
Display More
I get the following error when executing:
$ PROJECT=Rockchip DEVICE=TinkerBoard ARCH=arm scripts/build gpio_lib_python
BUILD gpio_lib_python (target)
TOOLCHAIN manual
running build
running build_py
running build_ext
building 'ASUS.GPIO' extension
/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7ve -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a17 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -fPIC -I/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/python2.7 -c source/py_gpio.c -o build/temp.linux-x86_64-2.7/source/py_gpio.o
source/py_gpio.c: In function 'py_event_detected':
source/py_gpio.c:888:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Py_RETURN_TRUE;
^~~~~~~~~~~~~~
source/py_gpio.c:890:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Py_RETURN_FALSE;
^~~~~~~~~~~~~~~
source/py_gpio.c: In function 'initGPIO':
source/py_gpio.c:2056:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Py_INCREF(&PWMType);
^~~~~~~~~
/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7ve -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a17 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -fPIC -I/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/python2.7 -c source/c_gpio.c -o build/temp.linux-x86_64-2.7/source/c_gpio.o
/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7ve -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a17 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -fPIC -I/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/python2.7 -c source/cpuinfo.c -o build/temp.linux-x86_64-2.7/source/cpuinfo.o
/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7ve -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a17 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -fPIC -I/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/python2.7 -c source/event_gpio.c -o build/temp.linux-x86_64-2.7/source/event_gpio.o
/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7ve -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a17 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -fPIC -I/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/python2.7 -c source/soft_pwm.c -o build/temp.linux-x86_64-2.7/source/soft_pwm.o
/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7ve -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a17 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -fPIC -I/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/python2.7 -c source/py_pwm.c -o build/temp.linux-x86_64-2.7/source/py_pwm.o
/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7ve -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a17 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -fPIC -I/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/python2.7 -c source/common.c -o build/temp.linux-x86_64-2.7/source/common.o
/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7ve -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a17 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -fPIC -I/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/python2.7 -c source/constants.c -o build/temp.linux-x86_64-2.7/source/constants.o
/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7ve -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a17 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -fPIC -I/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/include/python2.7 -c source/wiringTB.c -o build/temp.linux-x86_64-2.7/source/wiringTB.o
/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/host-gcc -pthread -shared -Wl,-rpath,/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/lib -L/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/lib -march=armv7ve -mtune=cortex-a17 -Wl,--as-needed -fuse-ld=gold -fuse-linker-plugin -flto -march=armv7ve -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mcpu=cortex-a17 -mfloat-abi=hard -mfpu=neon-vfpv4 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects build/temp.linux-x86_64-2.7/source/py_gpio.o build/temp.linux-x86_64-2.7/source/c_gpio.o build/temp.linux-x86_64-2.7/source/cpuinfo.o build/temp.linux-x86_64-2.7/source/event_gpio.o build/temp.linux-x86_64-2.7/source/soft_pwm.o build/temp.linux-x86_64-2.7/source/py_pwm.o build/temp.linux-x86_64-2.7/source/common.o build/temp.linux-x86_64-2.7/source/constants.o build/temp.linux-x86_64-2.7/source/wiringTB.o -L/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/armv7ve-libreelec-linux-gnueabi/sysroot/usr/lib -lpython2.7 -o build/lib.linux-x86_64-2.7/ASUS/GPIO.so
gcc: error: unrecognized argument in option '-mabi=aapcs-linux'
gcc: note: valid arguments to '-mabi=' are: ms sysv
gcc: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead
gcc: error: unrecognized command line option '-mfloat-abi=hard'
gcc: error: unrecognized command line option '-mfpu=neon-vfpv4'
error: command '/home/ben/LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/host-gcc' failed with exit status 1
Display More
Any help would be greatly appreciated. Note that I have no idea what I'm doing. Would like to get gpio working on TinkerBoard so that I can use the gpio pins for IR remote control. (I know I could probably get some USB solution but I'm interested in getting this working using GPIO).
Thanks.