I agree with the architecture change, "all" is a far better choice.
The -llog changes are slightly less straightforward though. The sample and test
applications for Android don't directly call any Android logging code, so
shouldn't need to have liblog.so added to their NEEDED sections.
Comparing the linker line from armeabi:
```
Executable : dpfp
~/Android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++
-Wl,--gc-sections -Wl,-z,nocopyreloc
--sysroot=~/Android/android-ndk-r8e/platforms/android-3/arch-arm
./obj/local/armeabi/objs/dpfp/__/__/examples/dpfp.o -lgcc
./obj/local/armeabi/libusb1.0.so -no-canonical-prefixes -Wl,--no-undefined
-Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -lc -lm -o
./obj/local/armeabi/dpfp
Install : dpfp => libs/armeabi/dpfp
```
to the linker line for mips:
```
Executable : dpfp
~/Android/android-ndk-r8e/toolchains/mipsel-linux-android-4.6/prebuilt/linux-x86_64/bin/mipsel-linux-android-g++
-Wl,--gc-sections -Wl,-z,nocopyreloc
--sysroot=~/Android/android-ndk-r8e/platforms/android-9/arch-mips
./obj/local/mips/objs/dpfp/__/__/examples/dpfp.o -lgcc
./obj/local/mips/libusb1.0.so -no-canonical-prefixes -Wl,--no-undefined
-Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -lc -lm -o ./obj/local/mips/dpfp
~/Android/android-ndk-r8e/toolchains/mipsel-linux-android-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/mipsel-linux-android/4.6/../../../../mipsel-linux-android/bin/ld:
warning: liblog.so, needed by ./obj/local/mips/libusb1.0.so, not found (try
using -rpath or -rpath-link)
./obj/local/mips/libusb1.0.so: undefined reference to `__android_log_write'
```
The linker lines for the two appear to have the same options. I suspect that
this is actually a bug in the mips toolchain in the NDK not invoking the linker
in the same way as other toolchains.
An alternative would be to tell the linker to be happy to have unresolved
symbols in shared library dependencies (APP_LDFLAGS :=
-Wl,--allow-shlib-undefined), but that still issues warnings for the MIPS
builds and would let through other issues.
Instead of adding all the extra LDFLAGS to all the mk files I'd suggest just
adding APP_LDFLAGS := -llog to Application.mk along the lines of:
```
# Workaround for MIPS toolchain linker being unable to find liblog dependency
of shared object
# in NDK versions at least up to r9
APP_LDFLAGS := -llog
```
Could you update your pull request to use APP_LDFLAGS? If not then I'm happy to
generate a new patch which uses it.
---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/pull/133#issuecomment-22935387
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel