Perl Binary
Posted in Fedora, Linux SysAdmin on November 30th, 2006 by Johan Huysmans – Be the first to commentFor a special task I needed to run a perl script on a specific machine, the problem was… there is no perl on that system.
This can be easily solved with the compilation of the perl script.
Fred tested the perl compilation with perlcc together with me. He has summarized the results in his “perl binary”-blog post. At the end he added the pp (Perl Packager) which also compiles perl scripts.
I tested this and at the first sight it worked fine, but at second sight some strange things happened.
The binary I created on my machine (Fedora Core 6) worked fine on my machine but gave a “Floating point exception” on any other machine. When I tested it on an other FC 6 it worked without any problems.
When the binary is created on an other machine it worked on all machines, including mine. I repeated this test with different machines (CentOs, Debian, Suse) and those worked fine. They also worked on the system without perl.
When comparing the binaries compiled on the different system I noticed that libresolv.so.2 shows up in the output of “ldd” only with the FC6 binaries.
When creating a chart of all systems with the check result, I added the glibc version of the system. It appeared that the version differs on the systems. On FC it was a newer version (2.5) then the other hosts (2.3).
I added glibc in my search query on google and I found following warnings on cpan.org:
Linux and other libc-based platforms * Try to avoid running pp on a bleeding-edge version of the OS * Older versions with an earlier libc won't work with new ones
This means that perl compilation with pp with the bleading edge version of glibc (2.5) may not work on other systems. If you compile it on a system with a more stable version of glibc, it will work on all systems. (or at least on the systems with the same glibc).