shc
shc copied to clipboard
How to handle multiple glibc versions?
I'm compiling the bash script in a machine, I want to use it different OS, but not all the OS has the same glibc version so the binary will fail with a message :
./myscript: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by ./myscript)
I'm compiling the shell script with the command - shc -U -r -f myscript.sh -o myscript
How to make my script to compatible with multiple OS?
try CFLAGS="-static" shc -U -r -f myscript.sh -o myscript
glibc-static package need to be installed on a Fedora base OS. I think this issue can be closed.
Well , we have the same problem :
- compile a simple script with shc -f ekidw.sh -r -o ekidw on Ubuntu 22.04
- Result complains that GlibC not found on Ubuntu 20.04
We should find a way to maximize portability across generation of distribution
CFLAGS="-static"
solved it for me. Now I can compile in Ubuntu 22.04 and run in Ubuntu 20.04. Thanks @RandomOS!
PS: should work for you too, @freechelmi.