-
Notifications
You must be signed in to change notification settings - Fork 233
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
Linker error on iOS and Apple Silicon: Undefined symbol _pixman_composite_over_n_8888_asm_neon #496
Comments
Also running into this problem at the moment. |
I am also hitting this issue. Has anyone come up with a solution? Short term fix I am thinking undef ARM_NEON ? |
oh, this only happens when building lottie2gif. The core rlottie project does not have this issue. I have just changed my build script to call |
I have worked around this locally, I changed the call in memfill32 to memset, and took the generic c implementation
|
I also have this problem when building rlottie on the Rasberry Pi using GCC. Applying the patch above solves the problems, so thanks for that! Thanks! :) |
Did the above patch which helped with the build, but when time came to do the install, it tried to move all the binary artifacts into This is no longer allowed under Apple's SIP security guidelines. You can manually disable SIP but this is bad security practice and may not even be allowed for certain environments. The solution is to edit Then when time comes to use the libraries, you have to make sure the include and lib paths are properly set up to point at HTH. |
Wrapping up solutions provided above, with some modification:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e0d4e0b..f0a84e5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,7 +87,7 @@ endif()
if (NOT LIB_INSTALL_DIR)
- set (LIB_INSTALL_DIR "/usr/lib")
+ set (LIB_INSTALL_DIR "/usr/local/lib")
endif (NOT LIB_INSTALL_DIR)
#declare source and include files
diff --git a/src/lottie/lottiemodel.cpp b/src/lottie/lottiemodel.cpp
index bf0e357..e96a043 100644
--- a/src/lottie/lottiemodel.cpp
+++ b/src/lottie/lottiemodel.cpp
@@ -188,11 +188,11 @@ void LOTGradient::populate(VGradientStops &stops, int frameNo)
return;
}
int colorPoints = mColorPoints;
- if (colorPoints < 0 || colorPoints > size / 4) { // for legacy bodymovin (ref: lottie-android)
+ if (colorPoints < 0 || (long unsigned int)(colorPoints) > size / 4) { // for legacy bodymovin (ref: lottie-android)
colorPoints = int(size / 4);
}
auto opacityArraySize = size - colorPoints * 4;
- if ((opacityArraySize % 2 != 0) || (colorPoints > opacityArraySize / 2 && opacityArraySize < 4)) {
+ if ((opacityArraySize % 2 != 0) || ((long unsigned int)(colorPoints) > opacityArraySize / 2 && opacityArraySize < 4)) {
opacityArraySize = 0;
}
float *opacityPtr = ptr + (colorPoints * 4);
diff --git a/src/vector/vdrawhelper_neon.cpp b/src/vector/vdrawhelper_neon.cpp
index 99fd34f..a4a791a 100644
--- a/src/vector/vdrawhelper_neon.cpp
+++ b/src/vector/vdrawhelper_neon.cpp
@@ -2,27 +2,18 @@
#include "vdrawhelper.h"
-extern "C" void pixman_composite_src_n_8888_asm_neon(int32_t w, int32_t h,
- uint32_t *dst,
- int32_t dst_stride,
- uint32_t src);
-
-extern "C" void pixman_composite_over_n_8888_asm_neon(int32_t w, int32_t h,
- uint32_t *dst,
- int32_t dst_stride,
- uint32_t src);
-
void memfill32(uint32_t *dest, uint32_t value, int length)
{
- pixman_composite_src_n_8888_asm_neon(length, 1, dest, length, value);
+ memset(dest, value, length);
}
void Vcomp_func_solid_SourceOver_neon(uint32_t *dest, int length,
uint32_t color,
uint32_t const_alpha)
{
+ int ialpha, i;
if (const_alpha != 255) color = BYTE_MUL(color, const_alpha);
-
- pixman_composite_over_n_8888_asm_neon(length, 1, dest, length, color);
+ ialpha = 255 - vAlpha(color);
+ for (i = 0; i < length; ++i) dest[i] = color + BYTE_MUL(dest[i], ialpha);
}
#endif We may also use |
Just curious when this will get rolled into the main line. I don't see a PR open. |
authored at Samsung#496
😬 |
I'd say the correct way of fixing this is not removing the usage of neon instructions from |
Any update? |
This is a more detailed error report for #488.
When compiling for iOS or Apple silicon, two symbols are not defined:
The file that uses these functions is
vdrawhelper_neon.cpp
.Steps to Reproduce:
CMakeLists.txt
to includeset(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE INTERNAL "")
below theproject
line, this will enable building Apple Silicon:mkdir -p build; cd build; cmake -G "Xcode" ..
Other Notes:
In the file
pixman-arm-neon-asm.S
(the file that contains the definitions forpixman_composite_over_n_8888_asm_neon
andpixman_composite_src_n_8888_asm_neon
), comments mention that there exists a C functionfast_composite_over_8888_0565
inpixman-fast-path.c
which implements an identical behavior to the arm assembly functions. Perhaps use that function instead invdrawhelper_neon.cpp
, when the target does not support the assembly implementation?The text was updated successfully, but these errors were encountered: