1

I have a Perl script which I tried to use PAR::Packer in order to make it a standalone executable so it runs without having Perl on the target machine (because of security reasons).

I used WSL on Windows to pack the Perl script, but the problem I have when I run it on the target machine is the error: "version `GLIBC_2.29' not found".

I ran the command ldd --version and the version on the target machine is 2.17.

The problem I am facing is I cannot install anything on the target machine so I cannot install Perl + PAR::Packer to compile the script and then distribute it to the other machines that are gonna use the script (it's gonna be used in an image so lots of machines).

I cannot seem to find a solution or alternative for this, would love any help from the community.

Edit: the ubuntu on my WSL was ubuntu 22, the target machines runs redhat and not debian variant, IDK which version as they are a custom linux made by the company i work in.

why am i stuck? the main problem is that PAR::Packer isn't working on old ubuntu builds ( before 14) and at ubuntu 14 the glibc is already 2.22 while on version 12 its 2.15 so I need to compile the script on old ubuntu (version 12) but the compiling program (PAR::Packer) only works on ubuntu 14 and above so I am stuck in a loop and would apprentice any help or even alternatives for this problem.

Thanks!

Fooad Taha
  • 25
  • 8
  • 1
    *"I used WSL on windows.."* Which version of Ubuntu did you use with WSL? *"... but the problem when i run on the target machine"* Which version of Ubuntu on the target machine? If the target machine has a an older version of Ubuntu, you might need to install the same version in WSL before you create the executable – Håkon Hægland Jun 16 '22 at 15:33
  • Hi, i am editing the questiiong to include this info and a bit more the main problem is that PAR::Packer isnt working on old ubuntu builds ( before 14) and at ubuntu 14 the gLIBC is already 2.22 while on version 12 its 2.15 so i need to compile the script on old ubuntu ( 12) but the compiling program only owrks on ubuntu 14 and above so i am stuck in a loop would appreatie any help or even alternatives for this problem – Fooad Taha Jun 17 '22 at 16:20
  • Can you post a minimal example of the perl script? If we can reproduce the issue in a docker container say with different versions of Ubuntu or CentOS, it would be a good starting point for further investigations to see if this can be solved somehow – Håkon Hægland Jun 18 '22 at 09:18
  • Its the exiftool script. https://github.com/exiftool/exiftool, i installed ubuntu 22 on WSL, installed Par::Packer, used it on the exiftool script ( it was only the exiftool file + the lib folder which is enough to run the tool), then moved it to a machine with IDK whats the os as its custom but had GLIBC of version 2.17 while the wsl one was 2.3, so the script couldn't run, i tried searching how to downgrade the glibc but its not possible to go to 2.17 on a new linux, i installed vmware + ubuntu 12 which had GLIBC 2.15, but Par::Packer couldnt be installed , so i cannot use it with old glibc – Fooad Taha Jun 18 '22 at 13:12

1 Answers1

1

Edit: the ubuntu on my WSL was ubuntu 22, the target machines runs redhat

Your problem is that you are trying to build on newer Linux machine, and run the resulting binary on older Linux. That doesn't work (without additional effort).

The simplest solution is to build on the oldest Linux distribution you need to support, possibly in a docker container.

Some other solutions are listed here.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • The problem is i mentioned is that Par::Packer doesnt work on older linux – Fooad Taha Jun 18 '22 at 18:59
  • @FooadTaha "The problem is i mentioned is that Par::Packer doesnt work on older linux" -- I doubt that is true. In any case, you either have to _make it_ work, or you have to abandon this approach. – Employed Russian Jun 18 '22 at 21:51