-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No reference implementation for getifaddrs available for this platform #16
Comments
Strangely, while stubbing it, I see |
Hi, something in configure doesn't seem to work out. A simple workaround would be to set the environment variable diff --git a/configure.ac b/configure.ac
index bfc443e..799a2ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,11 @@ AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
-AC_CHECK_FUNCS([asprintf strcasecmp strdup strerror strndup stpcpy vasprintf getifaddrs])
+AC_CHECK_FUNCS([asprintf strcasecmp strdup strerror strndup stpcpy vasprintf])
+
+# Check for additional functions
+AC_CHECK_HEADERS(ifaddrs.h)
+AC_CHECK_FUNCS(getifaddrs)
# Check for operating system
AC_MSG_CHECKING([for platform-specific build settings])``` |
Hmm... guess that doesn't really make a difference... |
I don't have direct access to this device at the moment but my workaround was this https://git.sr.ht/~voltagex/rt68u-itethering/tree/main/item/getifaddrs-stub.patch |
I see... Next time you do, could you check #ifdef __cplusplus
extern "C"
#endif
char getifaddrs();
int
main ()
{
return getifaddrs();
return 0;
} And then it tries to link that trying to see if that symbol exists. Something like Thanks for trying to figure this out. |
With or without your patch? |
Without. The patch is not really changing anything :) |
Apologies for the delay in getting back to you, @nikias. |
No problem at all. So it looks like it expects the symbol to be in some library after all:
Any idea what library that could be? Maybe /opt/brcm-arm/lib holds it. Try this command (notice the
|
Yeah, this is in Broadcom's proprietary (?) toolchain (?), in libshared.so - but when I looked again I actually did find it in AsusWRT Merlin
I ended up writing a shim to make the thing build, and then it looks like the symbol/.so is available on the device itself - unpacking the trx file (using 7zip) from wget https://sourceforge.net/projects/asuswrt-merlin/files/RT-AC68U/Release/RT-AC68U_386.4_0.zip, I can see the symbols.
Sorry, this is probably really offtopic for your project - it's not a libimobiledevice issue, however, setting the autoconf variable then leads to
as soon as something tries to link with libimobiledevice-glue. |
I agree this is really specific, but nonetheless it should be possible to get this to link somehow. |
-lshared fails unless I use the shim from my repo. If I get some time I'll try to get in contact with the Merlin devs and see if they can make a change so that the libshared library is available |
OK, thanks. Your patch only adds the ifaddr.h include, is that defining the functions? |
Yes, only the functions, and just barely. |
I have the exact same issue when cross-compiling for Android (using dockcross). @voltagex's patch fixes the build, but I understand it is not ideal: diff --git a/src/socket.c b/src/socket.c
index ad6135f..61da815 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -695,7 +695,8 @@ static int getifaddrs(struct ifaddrs** ifap)
return 0;
}
#else
-#error No reference implementation for getifaddrs available for this platform.
+#warning No reference implementation for getifaddrs available for this platform.
+#include "ifaddrs.h"
#endif
#endif For me, config.log says:
Though I have @nikias: any suggestion what else I should check? |
I'm building against an ancient uclibc (not my choice) and I can't build libimobiledevice-glue
All I'm after in the end is USB tethering, is it possible to #ifdef out all the wifi based stuff as well?
Otherwise, I note that you've got a portable-ish getifaddrs for Windows in socket.c, could this be made to work for uclibc as well?
The text was updated successfully, but these errors were encountered: