shc icon indicating copy to clipboard operation
shc copied to clipboard

How to handle multiple glibc versions?

Open hexclann opened this issue 3 years ago • 4 comments

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?

hexclann avatar Jul 16 '21 07:07 hexclann

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

RandomOS avatar Jul 05 '22 14:07 RandomOS

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

tjyang avatar Jan 15 '23 15:01 tjyang

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

freechelmi avatar Dec 11 '23 12:12 freechelmi

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.

felipecrs avatar Mar 06 '24 15:03 felipecrs