Tinkerboard Python GPIO package build error

  • 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.

    I get the following error when executing:

    $ PROJECT=Rockchip DEVICE=TinkerBoard ARCH=arm scripts/build gpio_lib_python

    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.

  • Try adding this in pre_make_target() function.

    Code
    export CFLAGS=$(echo $CFLAGS | sed -e "s|-mabi=aapcs-linux||g")
    export CFLAGS=$(echo $CFLAGS | sed -e "s|-mfloat-abi=hard||g")
    export CFLAGS=$(echo $CFLAGS | sed -e "s|-mfpu=neon-vfpv4||g")
  • Thanks for helping. Got a bit farther. I am now getting the following error on build:

    gcc: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead

    /usr/bin/ld.gold: fatal error: build/temp.linux-x86_64-2.7/source/py_gpio.o: unsupported ELF machine number 40

    collect2: error: ld returned 1 exit status

    error: command '/home/ben/http://LibreELEC.tv/build.LibreELEC-TinkerBoard.arm-9.0-devel/toolchain/bin/host-gcc' failed with exit status 1

    I have attached the full output if needed.

    Thanks again!gpio_lib_python-build.txt

  • In function make_target() use

    Code
    CC=$CC LDSHARED="$CC -shared" python setup.py build --verbose

    and remove those 3 lines for CFLAGS from pre_make_target() I suggested above.

    Better option is to use pre_configure_target() function and then make_target() doesn't need changes.

    Code
    pre_configure_target() {
      export LDSHARED="$CC -shared"
    }