Incompatible architecture error on macOS 13.5 with proxychains-ng and Ruby
labolado opened this issue · 6 comments
I am experiencing an issue when using proxychains-ng on macOS 13.5 with Ruby. Here are the details:
System Information:
- OS: macOS 13.5
- Architecture: arm64 / apple m2
Steps to Reproduce:
- Install proxychains-ng using Homebrew.
- Configure the proxy in
/opt/homebrew/etc/proxychains.conf
. - Run the following command:
proxychains4 ruby -v
Expected Result:
Ruby version information should be displayed through proxychains4.
Actual Result:
$ csrutil status
System Integrity Protection status: disabled.
$ ruby -v
ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22]
$ proxychains4 ruby -v
[proxychains] config file found: /opt/homebrew/etc/proxychains.conf
[proxychains] preloading /opt/homebrew/lib/libproxychains4.dylib
dyld[3873]: terminating because inserted dylib '/opt/homebrew/lib/libproxychains4.dylib' could not be loaded: tried: '/opt/homebrew/lib/libproxychains4.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need '')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/libproxychains4.dylib' (no such file), '/opt/homebrew/lib/libproxychains4.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need ''))
dyld[3873]: tried: '/opt/homebrew/lib/libproxychains4.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need '')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/libproxychains4.dylib' (no such file), '/opt/homebrew/lib/libproxychains4.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need ''))
zsh: abort proxychains4 ruby -v
Interestingly, curl
works fine with proxychains4:
$ proxychains4 curl -V
[proxychains] config file found: /opt/homebrew/etc/proxychains.conf
[proxychains] preloading /opt/homebrew/lib/libproxychains4.dylib
[proxychains] DLL init: proxychains-ng 4.17-git-1-gfffd253
curl 8.8.0 (aarch64-apple-darwin22.6.0) libcurl/8.8.0 (SecureTransport) OpenSSL/3.3.1 zlib/1.2.11 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libssh2/1.11.0 nghttp2/1.61.0 librtmp/2.3 OpenLDAP/2.6.8
Release-Date: 2024-05-22
Additional Information:
- Proxychains-ng version: 4.17-git-1-gfffd253
- Ruby version: 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22]
The issue seems to be related to an architecture mismatch with the dynamically linked library /opt/homebrew/lib/libproxychains4.dylib
.
Could you please provide guidance on how to resolve this architecture compatibility issue?
Thank you!
" CFLAGS="-arch arm64e" LDFLAGS="-arch arm64e" ./configure --prefix=/usr/local --bindir=/usr/local/bin --libdir=/usr/local/lib --fat-binary-m1" not work for me.
$ ./proxychains4 curl ip.me
zsh: killed ./proxychains4 curl ip.me
follow the steps here
#481 (comment)
including the command to enable arm64e preview abi.
you can also try to replace the configure file with this one: https://0x0.st/Xccz.sh
curl https://0x0.st/Xccz.sh -o configure && chmod +x configure
then ./configure --fat-binary-m2
let me know if it works.
It works, but I cannot set boot-args in recovery mode.
shutdown & long press Power button to recovery mode -> Terminal
csrutil disable
#reboot
enable arm64e support
sudo nvram boot-args=-arm64e_preview_abi
git clone https://github.com/rofl0r/proxychains-ng
cd proxychains-ng
CFLAGS="-arch arm64e" LDFLAGS="-arch arm64e" ./configure --prefix=/usr/local --bindir=/usr/local/bin --libdir=/usr/local/lib --fat-binary-m1
make
./proxychains4 -f /opt/homebrew/etc/proxychains.conf ruby -v
ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22]
right. but could you please test the new configure script i uploaded. if it works i'll merge it into master and make the --fat-binary-m2 option available
you can also try to replace the configure file with this one: https://0x0.st/Xccz.sh
curl https://0x0.st/Xccz.sh -o configure && chmod +x configure
then
./configure --fat-binary-m2
let me know if it works.
It works.