ksh giving error in Darwin Kernel Version 9.8.0 - macos

I've copied the latest version of ksh93 into the darwin computer but for some reason it doesn't work.
Whenever I execute anything with ksh (for example "ksh --version") this is the error that I get:
dyld: unknown required load command 0x80000022
Trace/BPT trap
Do you know what it might be?
My version is the following:
Darwin paramisx82614.fr.net.intra 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

The ast ksh downloads for Darwin require Mac OS X. So your kernel should be 10.x as well.
If you really need ksh for Darwin 9.x you will have to compile it from source.

Related

Library not loaded: /usr/lib/libc++.1.dylib when executing Valgrind on Clion Editor

When I execute Valgrind on Clion Editor, the following error shows up.
/usr/local/bin/valgrind --tool=memcheck --xml=yes --xml-file=/private/var/folders/gq/r_j6y6112zlccqkwxp0rj_v00000gn/T/clion-valgrind6333974d-afb4-4c0b-8c03-407df60789cf/valgrind_output_%p --gen-suppressions=all --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no /Users/hayashi-ay/Projects/tests/cmake-build-debug/main --gtest_filter=* --gtest_color=no
Testing started at 2:10 ...
dyld[8729]: Library not loaded: /usr/lib/libc++.1.dylib
Referenced from: /Users/hayashi-ay/Projects/tests/cmake-build-debug
Reason: tried: '/usr/lib/libc++.1.dylib' (no such file), '/usr/local/lib/libc++.1.dylib' (no such file)
main uses following dynamic libraries
otool -L main
main:
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
But simply run ./main works fine, so I guess valgrind can't handle dynamic linking.
My Environment:
OS:
sw_vers
ProductName: macOS
ProductVersion: 12.0.1
BuildVersion: 21A559
Valgrind:
valgrind --version
valgrind-3.18.0.GIT-lbmacos
CLion:
CLion 2021.2.2
Build #CL-212.5284.51, built on September 17, 2021
Licensed to xxxxxxxxxxxxxx
Subscription is active until October 6, 2022.
For educational use only.
Runtime version: 11.0.12+7-b1504.28 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.0.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2000M
Cores: 8
Registry: run.processes.with.pty=TRUE
Non-Bundled Plugins: com.intellij.plugins.vscodekeymap (212.3116.29)

ngrok binary file execution is not working on catalina(mac os)

Recently i have updated to Catalina and when i have tried running ngrok below error comes in:
-bash: ./ngrok: cannot execute binary file
Below are the details of file and system:
cmd:- file ./ngrok
output:- ./ngrok: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=WiQDkmDKISYhEPN12k-3/C6vlWFNDOR0o0u0x3X26/VIi6gzoMVXoqHTYgeFTz/LKswZ3xo2O5g2OnUiOwZ, not stripped
cmd:- uname -a
output:- Darwin XXXXXXX-MacBook-Air.local 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov 9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64
Any update would be appreciated
It was an access permission issue but this npm module solves it https://www.npmjs.com/package/ngrok, now it working smoothly.

Cross-compile to ARMv7 failed

I try to compile a go program on my Linux desktop (Linux desktop 4.10.0-28-generic #32-Ubuntu SMP Fri Jun 30 05:32:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux), go version go version go1.8.3 linux/amd64 to arm:
$ GOPATH=/home/xrfang/git/hermes/ GOARM=7 GOARCH=arm go build .
the executable is generated, but seems NOT ARMv7:
$ file hermes
hermes: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
It shows EABI5. How can I cross-compile to ARMv7? Is there anything missing on my Linux Desktop so that the cross-compile fallback to a lower ARM version?
Thanks.
I believe, it is not ARMv5. I was trying to do the same on MAC OS and 'file' command on Mac is saying v7, but the 'file' command on Linux don't. However, I do know that v7 has some good improvements and may boost the performance of your program.
But, that is out of scope of this question and you may need to dig deeper into what you're doing and why a performance improvement is expected.
All I can say is, it is compiled for v7.

Cross-compiling rsync on OS X 10.8 (64bit) to 10.7 (32bit)

I need get rsync binary with -iconv parameter (>v3.0.0) to OS X Lion (10.7.5) what doesn't have Xcode installed. (The default rsync on OS X is only archaic v2.6.9)
How to compile it from the sources on another computer running Mountain Lion (10.8.4)?
Tried:
export CFLAGS="-arch i386"
./configure
make
the compiled rsync run ok on the 10.8.4 but when copied it to 10.7.5 says:
$ ./rsync
Illegal instruction: 4
not works either:
export CFLAGS="-arch i386 -m32"
./configure
make
Can please someone tell me how to cross-compile the rsync v3.0.9 on OS X 10.8 for 10.7?
My system:
$ uname -a
Darwin jonatan.local 12.4.0 Darwin Kernel Version 12.4.0: Wed May 1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
target system
Darwin panda.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:26:45 PDT 2012; root:xnu-1699.32.7~1/RELEASE_I386 i386
Or, have anyone compiled rsync-3.0.9 for OS X 10.7.5 for download? ;)
Just found this question: What is the "Illegal Instruction: 4" error and why does "-mmacosx-version-min=10.x" fix it?
and the
export CFLAGS="-arch i386 -mmacosx-version-min=10.7"
./configure
make
works. :)

How to compile gcc-4.0 on Mountain Lion

So far I've successfully launched the configure, but when I type make, I get the following error, after some time (there's a lot which compile successfully):
ld: unknown/unsupported architecture name for: -arch i686
/usr/bin/libtool: internal link edit command failed
make[2]: *** [libgcc_s.dylib] Error 1
make[1]: *** [libgcc.a] Error 2
make: *** [all-gcc] Error 2
Is there a way to tell gcc not to compile itself for the i686 architecture?
Here's my uname -a if it can help:
Darwin Frizlabs-Computer.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64
Someone on serverfault answered the same question. So here's the way to compile gcc-4.0 on OS X Mountain Lion (copied from serverfault):
First get the old 4.0 package that was included with XCode 3.1 from Apple's Open Source page
Download the gcc-5493 package and build using:
mkdir darwin
cd darwin
../configure --prefix=/tmp/testplace --enable-languages=objc,c++
make bootstrap
make install

Resources