[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix build error due to open_memstream
From: |
Bruno Haible |
Subject: |
Fix build error due to open_memstream |
Date: |
Sun, 21 Feb 2021 23:31:45 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-201-generic; KDE/5.18.0; x86_64; ; ) |
On Solaris 10, I get a build error:
Undefined first referenced
symbol in file
open_memstream ../libpoke/.libs/libpoke.so
ld: fatal: symbol referencing errors. No output written to .libs/poke
This is because libpoke makes use of the unportable function 'open_memstream'.
This function exists in
- Solaris 11.4, but not in Solaris <= 11.3 and Solaris OpenIndiana,
- macOS 10.13, but not in macOS 10.5,
- NetBSD 8.0, but not in NetBSD 7.1.1,
- AIX 7.1, but not in AIX 6.1.
and is also missing in
- HP-UX 11.31
- Minix 3.3.
At least Solaris 11.3 is still supported for 3 more years, see
<https://en.wikipedia.org/wiki/Solaris_(operating_system)#Version_history> .
Gnulib provides a utility module 'string-buffer', as a replacement for
'open_memstream' (since today).
Here's a patch to make use of this module instead of 'open_memstream'.
The changes to the .c files in the test suite are needed to avoid a link
error in the test suite programs, caused by the following:
- The new module relies on vsnprintf().
- To avoid buggy vsnprintf outputs, I made it depend on 'vsnprintf-posix'
(poke/bootstrap.conf already relies on 'printf-posix').
- The redirection "#define vsnprintf rpl_vsnprintf" is only meant for
libpoke, but is visible also in the test suite.
- /usr/include/dejagnu.h has a couple of inline functions which reference
vsnprintf. So, they see the redirection to rpl_vsnprintf.
- The symbol rpl_vsnprintf is not exported from libpoke.so.
If you have a better idea how to fix this?
0001-Don-t-use-unportable-function-open_memstream.patch
Description: Text Data
- Fix build error due to open_memstream,
Bruno Haible <=