Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle multiple glibc versions? #135

Open
hexclann opened this issue Jul 16, 2021 · 4 comments
Open

How to handle multiple glibc versions? #135

hexclann opened this issue Jul 16, 2021 · 4 comments

Comments

@hexclann
Copy link

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
Copy link

RandomOS commented Jul 5, 2022

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

@tjyang
Copy link
Contributor

tjyang commented Jan 15, 2023

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

@freechelmi
Copy link

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

@felipecrs
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants