1

I have an application that needs to be run on various ancient Linux platforms so I link it against GNU libc 2.1.2. However currently I'm considering building a UNICODE version of the app. The problem is that the libc I'm linking against does not have certain basic functions like vswprintf.

Would it be possible to use let's say libc 2.4 and provide it with my application (as a separate file libc.so.6)? Would it violate the GNU libc license?

Are there other solutions? Perhaps there is a vswprintf function available (I believe it's not very efficient to code this one). So far the only other option I have is to convert everything to char* and use vsprintf.

Alex G
  • 307
  • 3
  • 7

2 Answers2

0

Sounds like pretty bad idea. Ancient platforms should have ancient system calls, with ancient prototypes.Read here

The world changes and system calls change. Since one must not break old binaries, the semantics associated to any given system call number must remain fully backwards compatible.

What happens in practice is one of two things: either one gets a new and improved system call with a new name and number, and the libc routine that used to invoke the old call is changed to use the new one, or the new call (with new number) gets the old name, and the old call gets "old" prefixed to its name.

Dabo
  • 2,371
  • 2
  • 18
  • 26
0

Would it be possible to use let's say libc 2.4 and provide it with my application (as a separate file libc.so.6)?

Yes and no. You can't distribute just libc.so.6, for reasons explained here.

You would have to distribute an almost complete build of GLIBC, and it would have to be installed in a fixed location (because you can't easily update path to ld-linux that is hardcoded into your executable at build time). And your build will likely not work on sufficiently old kernels anyway.

Would it violate the GNU libc license?

Not if you make the sources that you used to build libc available, and use dynamic linking (but I am not a lawyer, and you should consult with one for legal questions like this one).

Are there other solutions?

BSD libc appears to have an implementation of wide-character printf that you may be able to reuse, as do musl and uClibc. Beware, this is likely a non-trivial proposition.

Community
  • 1
  • 1
Employed Russian
  • 199,314
  • 34
  • 295
  • 362