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