I have been working on a PHP compile for my Apple M1 and have been dealing with dependency snags related to the arm64 architecture. I solved some similar linking errors related to openssl, but I still hit errors linking to the oniguruma libraries. I have compiled with various configurations, and from what I can tell, the resulting libraries are arm64 compatible. A call to
objdump -a /usr/local/oniguruma/lib/libonig.a shows output similar to:
/usr/local/oniguruma/lib/libonig.a(cp1251.o): file format mach-o arm64 rw-r--r-- 501/20 8828 Fri Jan 14 11:33:41 2022 cp1251.o /usr/local/oniguruma/lib/libonig.a(onig_init.o): file format mach-o arm64 rw-r--r-- 501/20 3772 Fri Jan 14 11:33:41 2022 onig_init.o
My env has the following:
LDFLAGS="-L/usr/local/oniguruma/lib -L/usr/local/openssl/lib $LDFLAG" and I have verified the call to clang specifies the correct directory for the library.
I feel like I am missing something obvious, and I have been at this for a while now. Do I need to specify the library location in a different way? Is there anything else I need to check to ensure that the library is indeed compatible with the project?