-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Dynamic ANTLR C++ library not loaded because searched for (in Mac arm64) in the antlr.org Terence Parr's programs #4707
Comments
I don't know why the last part of the problem description became bold and in a large fount. Sorry about that! |
I'm having a hard time determining the exact URLs for these .jars and C++ libraries. Please be specific, e.g., https://repo1.maven.org/maven2/org/antlr/antlr4-runtime/4.13.2/antlr4-runtime-4.13.2.jar or https://github.com/antlr/website-antlr4/blob/gh-pages/download/antlr-4.13.2-complete.jar or https://github.com/antlr/website-antlr4/blob/gh-pages/download/antlr4-cpp-runtime-4.13.2-macos.zip or https://github.com/antlr/website-antlr4/blob/gh-pages/download/antlr4-cpp-runtime-4.13.2-source.zip etc. I can't find the file named "antlr4-complete.jar" on https://repo1.maven.org/maven2/org/antlr/antlr4-runtime/ nor https://github.com/antlr/website-antlr4/tree/gh-pages/download. |
Hi Kaby76,thanks for the message! You are "having a hard time determining the exact URLs for these .jars and C++ libraries." We downloaded (from the page https://www.antlr.org/download.html) 2 files: (1) (2) We access the libs using 2 symbolic links put in /usr/local/lib: Compiling our programs is OK on the 2 Macs ==> Hence our question. |
I completed my "comment", but how to understand "closed"? |
We are developing on 2 Macs under Sequoia and ANTLR4-4.13.2.
After migrating one Mac to ARM64, we use the "fat" .dylib (and .a).
Compiling our application was OK on both Macs.
But link-edit gave problems on the arm64 Mac.
We found brew did not generate the fat version.
Then we abandoned brew and downloaded the antlr4-complete.jar and the antlr4-runtime
from the antlr.org web site.
At that point, the link-edit problem disappeared.
Note that, in our project, the ANTLR libs are renamed (by the way of symbolic links) to include the ANTLR version number
(libantlr4-4.13.2.dylib is a link to libantlr4.dylib)
A new problem appears now at execution time, only on the arm64 Mac:
the dynamic library does not load properly (see trace below).
More precisely, the loader looks for
/Users/parrt/antlr/code/antlr4/runtime/Cpp/runtime/libantlr4-runtime.4.13.2.dylib
and does not find it (of course).
But why? We certainly don't want our programs to access T. Parr's disks at run time!
As the trace shows, our libs are at a correct place on our disks, and have the correct format.
What should we do? Or is it a bug?
Thanks for help -- we are on that problem since 1 week.
Also, trying to regenerate the entire ANTLR/C++ tool failed (we are not competent enough with the
CMake tool).
Thanks in advance,
Ch.Boitet and J.C. Durand
============= trace ===============
...Serveur: lldb serveur.out
(lldb) target create "serveur.out"
Current executable set to '/Users/boitet/ariane-y/Ariane-Y_prog_2013/Moniteurs/Moniteur-AY/Serveur/serveur.out' (arm64).
(lldb) pr la
Process 34520 launched: '/Users/boitet/ariane-y/Ariane-Y_prog_2013/Moniteurs/Moniteur-AY/Serveur/serveur.out' (arm64)
dyld[34520]: Library not loaded: /Users/parrt/antlr/code/antlr4/runtime/Cpp/runtime/libantlr4-runtime.4.13.2.dylib
Referenced from: <2CF14B04-8497-3164-973F-5F234426ECFC> /Users/Shared/Dev_ex_PC_ou_Linux/Ariane-Y/ariane-y/Ariane-Y_prog_2013/Moniteurs/Moniteur-AY/Serveur/serveur.out
Reason: tried: '/Users/parrt/antlr/code/antlr4/runtime/Cpp/runtime/libantlr4-runtime.4.13.2.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/parrt/antlr/code/antlr4/runtime/Cpp/runtime/libantlr4-runtime.4.13.2.dylib' (no such file), '/Users/parrt/antlr/code/antlr4/runtime/Cpp/runtime/libantlr4-runtime.4.13.2.dylib' (no such file)
Process 34520 stopped
frame #0: 0x00000001988e0628 dyld
__abort_with_payload + 8 dyld
__abort_with_payload:-> 0x1988e0628 <+8>: b.lo 0x1988e0648 ; <+40>
0x1988e062c <+12>: pacibsp
0x1988e0630 <+16>: stp x29, x30, [sp, #-0x10]!
0x1988e0634 <+20>: mov x29, sp
Target 0: (serveur.out) stopped.
(lldb) q
Quitting LLDB will kill one or more processes. Do you really want to proceed: [Y/n]
...Serveur: file /usr/local/lib/antlr4-4.13.2/libantlr4-4.13.2.dylib
/usr/local/lib/antlr4-4.13.2/libantlr4-4.13.2.dylib: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [arm64:Mach-O 64-bit dynamically linked shared library arm64]
/usr/local/lib/antlr4-4.13.2/libantlr4-4.13.2.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
/usr/local/lib/antlr4-4.13.2/libantlr4-4.13.2.dylib (for architecture arm64): Mach-O 64-bit dynamically linked shared library arm64
...Serveur:
...Serveur:
...Serveur: pwd
/Users/boitet/ariane-y/Ariane-Y_prog_2013/Moniteurs/Moniteur-AY/Serveur
The text was updated successfully, but these errors were encountered: