Comments (12)
yeah, i've struggled to even explain the problem to the maintainer --- https://sourceforge.net/p/sevenzip/bugs/2383/
i don't think they think armv7 is a real thing.
from ndk.
Closing as it sounds like this is a 7-zip bug, not an NDK bug. If I've misunderstood, just lmk and we can reopen.
from ndk.
this would apply to other projects using AES encryption (not just 7-zip)
from ndk.
(my current workaround is to disable such AES/SHA256 code from compiling when targeting __ANDROID__
arm cpu's)
from ndk.
tho this then introduces a situation where x86 based android devices support AES encryption and arm based android devices do not support AES encryption
from ndk.
this would apply to other projects using AES encryption (not just 7-zip)
But in each case it's the projects that are wrong, right? The problem here is that projects are assuming availability of optional hardware features?
from ndk.
tho this then introduces a situation where x86 based android devices support AES encryption and arm based android devices do not support AES encryption
no, because Android's x86-64 ABI also doesn't include AES. (but again, you may happen to be running on a device that does, given that your x86-64 "device" is likely a modern laptop!) but if your code assumes x86-64 AES, it's still strictly wrong.
look at zlib for an example of how to do this kind of thing correctly.
from ndk.
#define ATTRIB_AES __attribute__((__target__("+crypto")))
This indicates that the code is trying to do the right thing. This attribute should build functions with aes support even if the source file isn't: https://godbolt.org/z/Ts934oox5. Can you check if the attribute is set at the relevant functions (or share a repro)?
how can i determine if support for the vaeseq_u8 intrinsic is actually present on my device
The library would also need to do runtime detection using a cpu-features library (or use ifuncs) to check if crypto is available on the device.
from ndk.
This indicates that the code is trying to do the right thing
well, for armv8 --- my point was that it's broken for armv7: https://sourceforge.net/p/sevenzip/bugs/2383/
from ndk.
well, for armv8 --- my point was that it's broken for armv7: https://sourceforge.net/p/sevenzip/bugs/2383/
Aah, yea, that's correct. @mgood7123 if you're already modifying the library code, use enh's suggested fix - to move the aes functions to a separate file and compile it for armv8.
from ndk.
so to be clear
on "desktop" x86 devices, AES support is (probably?) high
on "android" x86/arm devices, AES support is low (optional but probably only rarely actually supported in the cpu itself, eg one x86 device may have AES support while another x86 device lacks AES support)
would this be right?
from ndk.
on "android" x86/arm devices, AES support is low (optional but probably only rarely actually supported in the cpu itself, eg one x86 device may have AES support while another x86 device lacks AES support)
i don't think "high" or "low" are really the point --- the point is that it's not guaranteed so you need to check at runtime (with if ((getauxval(AT_HWCAP) & HWCAP_AES) != 0)
for arm64, say), and then either call the routine that uses the instruction or a routine that doesn't.
lzma tries to do this but (as explained in https://sourceforge.net/p/sevenzip/bugs/2383/) they got it wrong, or at least "don't believe that armv7 still exists".
from ndk.
Related Issues (20)
- [Bug]: ld.lld: error: undefined symbol: __aeabi_l2d HOT 4
- [BUG] Unable to Handle Exceptions Properly HOT 2
- [BUG] With Buildozer for Python/Kivy project for Android NDK 26b HOT 6
- [Bug]: Cannot select while compiling llama.cpp on Windows HOT 4
- Simpleperf: Only one FEAT_FILE2 feature section can be read from the file HOT 2
- [FR] clang driver should default to gnu hashes if the target api level is >= 23? HOT 7
- [Bug]: Segmentation Fault trying to run an LLVM pass HOT 2
- [Bug] clang frontend crashes on NDK 28.0.11617993 HOT 11
- [BUG] Building Library\Bee\artifacts\Android\a7sem\2b6k1szry106.o failed [RAM ISSUE?] HOT 9
- [FR] remove superfluous LLVM libraries HOT 10
- [BUG] clang frontend crashes on both r26d and canary version HOT 5
- [Bug] ndk clang building release raise error `declaration does not match` while llvm upstream compiles HOT 8
- [FR] improve bad diagnostic for `__REMOVED_IN` on `ALooper_pollAll` HOT 8
- [BUG] With Compose AndroidView on API 29, ANativeWindow_fromSurface with SurfaceView without an additional ViewGroup makes AndroidViewsHandle go black HOT 3
- [FR] Update Vulkan headers in sysroot of NDK r27 to enable FFmpeg's Vulkan integration HOT 18
- [Feature request] consider to provide libc.a for each API level HOT 6
- [BUG] using thread_local in x64 Android 12L/13 desktop simulator for release build generates invalid init function for thread_local variable that leads to SIGSEGV HOT 1
- [BUG] 23.1.77 Build errors on Unity 2022.3.21f1 HOT 7
- [BUG] Prebuilt clang and ld.lld fail to load compatible pass plugin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ndk.