autotools project libssh2 porting with libmbedtls
Posted: Sun Aug 09, 2020 2:58 am
I've been searching everywhere for this and recognize I must be doing something wrong, possibly related to LDFLAGS missing a "-Wl" parameter or so trying the autotools route? I've tried searching for clues in all other projects. The modules included `-lmbedtls -lmbedx509 -lmbedcrypto` and the order before `-lnx` doesn't make much difference.
Trying to build libssh2 https://github.com/libssh2/libssh2
Error(make):
switchvars.sh: modified with 2 lines in the bottom
./configure
I appreciate you taking your time. I love the work the switch homebrew community has done! Thank you!
Trying to build libssh2 https://github.com/libssh2/libssh2
Error(make):
Code: Select all
CC ssh2.o
CCLD ssh2
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/10.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/portlibs/switch/lib/libmbedcrypto.a(entropy.c.obj): in function `mbedtls_hardware_poll':
entropy.c:(.text.mbedtls_hardware_poll+0x1c): undefined reference to `csrngGetRandomBytes'
Code: Select all
export PORTLIBS_PREFIX=${DEVKITPRO}/portlibs/switch
export PATH=$PORTLIBS_PREFIX/bin:$PATH
export ARCH="-march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIC -ftls-model=local-exec"
export CFLAGS="${ARCH} -O2 -ffunction-sections -fdata-sections"
export CXXFLAGS="${CFLAGS}"
export CPPFLAGS="-D__SWITCH__ -I${PORTLIBS_PREFIX}/include -isystem${DEVKITPRO}/libnx/include"
export LDFLAGS="${ARCH} -L${PORTLIBS_PREFIX}/lib -L${DEVKITPRO}/libnx/lib"
export DEVKITPRO=/opt/devkitpro
export PORTLIBS_ROOT=${DEVKITPRO}/portlibs
export PATH=${DEVKITPRO}/tools/bin:${DEVKITPRO}/devkitA64/bin:$PATH
export TOOL_PREFIX=aarch64-none-elf-
export AR=${TOOL_PREFIX}gcc-ar
export RANLIB=${TOOL_PREFIX}gcc-ranlib
# modified/added
export CC="/opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc"
export LIBS="-L/opt/devkitpro/libnx/lib -L/opt/devkitpro/portlibs/switch/lib -lmbedtls -lmbedx509 -lmbedcrypto -lnx"
Code: Select all
./configure --enable-static=no --enable-shared=no --host=arm-none-eabi --with-crypto=mbedtls --with-libmbedcrypto-prefix=/opt/devkitpro/portlibs/switch --includedir=/opt/devkitpro/portlibs/switch/include