2

I just found out, that glibc 2.23 has a bug concerning the stdio function fmemopen(), see e.g. Using rewind() on a FILE* opened with fmemopen. (The buggy behaviour described there is not the only one. The problems becomes even more, if the size of the buffer exceeds 8192 bytes...)

Now I am considering to use the freshly released glibc 2.24, which has fixed this bug. However, my aimed user environment are Ubuntu computers, and I suppose it will still take some time until Ubuntu will support glibc 2.24 out of the box.

So, what problems will I face when I try to distribute my code?

Or, some related questions:

  • When can I expect that Ubuntu will support glibc 2.24?
  • Is it possible to have two libc versions in a system?
  • Is it possible to link libc statically?
  • Indeed, I would only need the stdio part. Is it possible to use only stdio from 2.24, would this give any benefit?
Community
  • 1
  • 1
ralfg
  • 552
  • 2
  • 11
  • 2
    http://stackoverflow.com/questions/3214168/linking-statically-with-glibc-and-libstdc – stark Aug 11 '16 at 10:43
  • @stark: Thanks. (I feel a little bit guilty that I did not thoroughly search for related questions.) – ralfg Aug 11 '16 at 13:59

1 Answers1

2

When can I expect that Ubuntu will support glibc 2.24?

Ubuntu has just released version 16.04 with GLIBC-2.23 link. You can expect the next LTS release to happen in 2 years. Even then, you can expect your customers to not have the latest release for another 5 years.

Is it possible to have two libc versions in a system?

Yes, see this answer. It's not a trivial proposition though, and most sane customers will balk at the idea of having a separate GLIBC which they would need to build and keep patched themselves (and if you are thinking of simply giving them a prebuilt copy, you are insane^H^H don't understand what you are signing up for).

Is it possible to link libc statically?

Maybe. If your application uses NSS (gethostbyname, etc.; most non-trivial applications do), then even statically linked app will not work (you'll get a linktime warning like this one).

Indeed, I would only need the stdio part. Is it possible to use only stdio from 2.24, would this give any benefit?

You can't easily separate stdio from the rest. Even if you do manage to produce a working binary, chances of it working correctly are slim.

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