neurobin / shc

Shell script compiler
https://neurobin.org/projects/softwares/unix/shc/
GNU General Public License v3.0
2.02k stars 345 forks source link

How to handle multiple glibc versions? #135

Open hexclann opened 3 years ago

hexclann commented 3 years ago

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?

RandomOS commented 2 years ago

try CFLAGS="-static" shc -U -r -f myscript.sh -o myscript

tjyang commented 1 year ago

glibc-static package need to be installed on a Fedora base OS. I think this issue can be closed.

freechelmi commented 10 months ago

Well , we have the same problem :

We should find a way to maximize portability across generation of distribution

felipecrs commented 8 months ago

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.