Hi. I'm using devkitA64-r26.1-2 and getting a link error below.
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/14.1.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/14.1.0/../../../../aarch64-none-elf/lib/pic/libg.a(libc_a-sysgetentropy.o): in function `getentropy':
(.text.getentropy+0x28): undefined reference to `_getentropy_r'
collect2: error: ld returned 1 exit status
Link error undefined reference to _getentropy.o
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Link error undefined reference to _getentropy.o
What's pulling in getentropy?
We can have a look & see what we can do, will take a little toolchain fiddling though.
We can have a look & see what we can do, will take a little toolchain fiddling though.
Re: Link error undefined reference to _getentropy.o
I believe it's from libarchive. If I exclude libarchive, then I just get a bunch of link errors related to libarchive and don't see getentropy link error
Re: Link error undefined reference to _getentropy.o
I built libarchive myself and I dont get the getentropy link error. Used cmake instead. Used same version 3.7.2 and patches distributed with pacman.
cmake -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DBUILD_TESTING=OFF -DENABLE_BZip2=OFF -DENABLE_CAT=OFF -DENABLE_CPIO=OFF -DENABLE_TAR=OFF -DENABLE_TEST=OFF -DENABLE_UNZIP=OFF -DENABLE_ZSTD=ON -DENABLE_OPENSSL=OFF ..
cmake -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DBUILD_TESTING=OFF -DENABLE_BZip2=OFF -DENABLE_CAT=OFF -DENABLE_CPIO=OFF -DENABLE_TAR=OFF -DENABLE_TEST=OFF -DENABLE_UNZIP=OFF -DENABLE_ZSTD=ON -DENABLE_OPENSSL=OFF ..
Last edited by cy33hc on Sun Jul 21, 2024 10:18 pm, edited 3 times in total.
-
- Site Admin
- Posts: 1986
- Joined: Tue Aug 09, 2005 3:21 am
- Location: UK
- Contact:
Re: Link error undefined reference to _getentropy.o
Your self build has disabled half the options in libarchive and I'm not sure that's actually the source of your issue. As far as I can tell none of our portlibs reference getentropy so I'm not really sure what's happening. Can you by any chance provide a small code sample which shows the error you've reported?
Re: Link error undefined reference to _getentropy.o
Rebuilt again using cmake, using same disabled options from configure except for disabling additionally the TEST code. Didn't get link error to getentropy
cmake -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DENABLE_CAT=OFF -DENABLE_CPIO=OFF -DENABLE_TAR=OFF -DENABLE_UNZIP=OFF -DENABLE_ZSTD=ON -DENABLE_OPENSSL=OFF -DENABLE_LIBXML2=OFF -DENABLE_ACL=OFF -DENABLE_TEST=OFF -DBUILD_TESTING=OFF ..
The ENABLE_CAT=OFF, ENABLE_CPIO=OFF, ENABLE_TAR=OFF, ENABLE_UNZIP=OFF etc.. are the same as disable-bsdcat, disable-bsdtar , disable-bsdunzip, disable-bsdcpio etc..
./configure --prefix="${PORTLIBS_PREFIX}" --host=aarch64-none-elf \
--disable-shared --enable-static \
--disable-bsdtar --disable-bsdcat \
--disable-bsdunzip --disable-bsdcpio --disable-acl \
--without-xml2 --without-openssl
I used libarchive in my project. https://github.com/cy33hc/switch-ezremo ... p_util.cpp
Currently building the app using libarchive that I built myself.
cmake -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DENABLE_CAT=OFF -DENABLE_CPIO=OFF -DENABLE_TAR=OFF -DENABLE_UNZIP=OFF -DENABLE_ZSTD=ON -DENABLE_OPENSSL=OFF -DENABLE_LIBXML2=OFF -DENABLE_ACL=OFF -DENABLE_TEST=OFF -DBUILD_TESTING=OFF ..
The ENABLE_CAT=OFF, ENABLE_CPIO=OFF, ENABLE_TAR=OFF, ENABLE_UNZIP=OFF etc.. are the same as disable-bsdcat, disable-bsdtar , disable-bsdunzip, disable-bsdcpio etc..
./configure --prefix="${PORTLIBS_PREFIX}" --host=aarch64-none-elf \
--disable-shared --enable-static \
--disable-bsdtar --disable-bsdcat \
--disable-bsdunzip --disable-bsdcpio --disable-acl \
--without-xml2 --without-openssl
I used libarchive in my project. https://github.com/cy33hc/switch-ezremo ... p_util.cpp
Currently building the app using libarchive that I built myself.
Who is online
Users browsing this forum: No registered users and 2 guests