Fix strnvis() and strnunvis() NetBSD ABI break

The NetBSD implementations have different prototypes to the ones coming
from OpenBSD, which will break builds, and have caused segfaults at
run-time. We provide now both interfaces with different prototypes as
different version nodes allow selecting them at compile-time, defaulting
for now to the OpenBSD one to avoid build-time breakage, while emitting
a compile-time warning. Later on, in 0.10.0, we will be switching the
compile-time default to the NetBSD version.

Ref: http://gnats.netbsd.org/44977
Fixes: https://bugs.debian.org/899282
This commit is contained in:
Guillem Jover
2018-05-22 13:50:44 +02:00
parent bf697b900c
commit e4e15ed286
8 changed files with 190 additions and 5 deletions

View File

@@ -160,3 +160,11 @@ LIBBSD_0.9 {
strsvisx;
svis;
} LIBBSD_0.8;
LIBBSD_0.9.1 {
/* The strnvis() and strnunvis() symbols changed prototype to match
* the NetBSD implementation. Provided as versioned nodes in 0.9.1, and
* exposed here explicitly so that we can redirect at compile-time. */
strnvis_netbsd;
strnunvis_netbsd;
} LIBBSD_0.9;