Might be that a different solution is in order.
But it still sounds like the best choice.
I have tried statically linking glibc by doing it on one of my text mode utility. It's a simple utility but it already has a number of modules in common with the project I need to run on the remote non-upgraded PCLinuxOS computers.
Once statically linked, it works both locally and on the remote computers and I have found no problem so far. The executable is 640Kb instead of 40, but I knew it would be bigger and it's not a problem.
On this simple statically linked program, if I try to add the libncurses module and call a ncurses function, I get a number of linker errors. These are:
lib_mouse.c:(.text+0x862): undefined reference to `dlopen'
lib_mouse.c:(.text+0x87d): undefined reference to `dlsym'
lib_mouse.c:(.text+0x897): undefined reference to `dlsym'
lib_mouse.c:(.text+0x8b1): undefined reference to `dlsym'
lib_mouse.c:(.text+0x8cb): undefined reference to `dlsym'
lib_mouse.c:(.text+0x8e8): undefined reference to `dlclose'
They are exactly the same errors I get when I try to build a statically linked version of my number-crunching project.
I have googled more than several hours on this, and ultimately it looks like I need to link statically with a version of ncurses... designed to be statically linked. On many other distributions you have a package named ncurses-static, and here is its description:
ncurses-static rpm build for : Fedora 12. For other distributions click here.
Name : ncurses-static
Version : 5.7 Vendor : Fedora Project
Release : 3.20090207.fc12 Date : 2009-07-27 06:34:56
Group : Development/Libraries Source RPM : ncurses-5.7-3.20090207.fc12.src.rpm
Size : 2.72 MB
Packager : Fedora Project
Summary : Static libraries for the ncurses library
The ncurses-static package includes static libraries of the ncurses library.
(this is for Fedora 12, but this package is available on many other distros)
Unfortunately this package is not available for PCLinuxOS!
I guess I have to ask in the relevant section for this package to be added to the repositories. Until I get this package my project is almost totally stopped.