summaryrefslogtreecommitdiff
path: root/libc-test/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'libc-test/build.rs')
-rw-r--r--libc-test/build.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index d5bf3ea61b..85d6d17f84 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -204,6 +204,7 @@ fn test_apple(target: &str) {
"iconv.h",
"ifaddrs.h",
"langinfo.h",
+ "libgen.h",
"libproc.h",
"limits.h",
"locale.h",
@@ -417,6 +418,7 @@ fn test_openbsd(target: &str) {
"errno.h",
"execinfo.h",
"fcntl.h",
+ "libgen.h",
"limits.h",
"link.h",
"locale.h",
@@ -992,6 +994,7 @@ fn test_netbsd(target: &str) {
"elf.h",
"errno.h",
"fcntl.h",
+ "libgen.h",
"limits.h",
"link.h",
"locale.h",
@@ -1206,6 +1209,7 @@ fn test_dragonflybsd(target: &str) {
"ifaddrs.h",
"kvm.h",
"langinfo.h",
+ "libgen.h",
"limits.h",
"link.h",
"locale.h",
@@ -1505,6 +1509,7 @@ fn test_android(target: &str) {
"fcntl.h",
"grp.h",
"ifaddrs.h",
+ "libgen.h",
"limits.h",
"link.h",
"locale.h",
@@ -1866,6 +1871,7 @@ fn test_freebsd(target: &str) {
"iconv.h",
"ifaddrs.h",
"langinfo.h",
+ "libgen.h",
"libutil.h",
"limits.h",
"link.h",
@@ -2771,6 +2777,7 @@ fn test_linux(target: &str) {
"iconv.h",
"ifaddrs.h",
"langinfo.h",
+ "libgen.h",
"limits.h",
"link.h",
"locale.h",
@@ -3410,6 +3417,22 @@ fn test_linux(target: &str) {
// it can't be changed from struct.
"pthread_sigqueue" => true,
+ // There are two versions of basename(3) on Linux with glibc, see
+ //
+ // https://man7.org/linux/man-pages/man3/basename.3.html
+ //
+ // If libgen.h is included, then the POSIX version will be available;
+ // If _GNU_SOURCE is defined and string.h is included, then the GNU one
+ // will be used.
+ //
+ // libc exposes both of them, providing a prefix to differentiate between
+ // them.
+ //
+ // Because the name with prefix is not a valid symbol in C, we have to
+ // skip the tests.
+ "posix_basename" if gnu => true,
+ "gnu_basename" if gnu => true,
+
_ => false,
}
});