SHA256
3
0
forked from pool/meson
meson/pr7648-fix-lchmod-check-for-glibc-2.32.patch

71 lines
3.3 KiB
Diff

From 4182ba04775b460ab5a7404f7eaeebe7af0573c9 Mon Sep 17 00:00:00 2001
From: Daniel Mensinger <daniel@mensinger-ka.de>
Date: Wed, 26 Aug 2020 17:46:35 +0200
Subject: [PATCH 1/2] tests: fix lchmod check for glibc >= 2.32 (fixes #6784)
---
test cases/common/39 has function/meson.build | 20 +++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/test cases/common/39 has function/meson.build b/test cases/common/39 has function/meson.build
index 16f43c4975..26f13d6faa 100644
--- a/test cases/common/39 has function/meson.build
+++ b/test cases/common/39 has function/meson.build
@@ -54,15 +54,23 @@ foreach cc : compilers
args : unit_test_args),
'couldn\'t detect "poll" when defined by a header')
lchmod_prefix = '#include <sys/stat.h>\n#include <unistd.h>'
+ has_lchmod = cc.has_function('lchmod', prefix : lchmod_prefix, args : unit_test_args)
+
if host_system == 'linux'
- assert (not cc.has_function('lchmod', prefix : lchmod_prefix,
- args : unit_test_args),
- '"lchmod" check should have failed')
+ glibc_major = cc.get_define('__GLIBC__', prefix: '#include <gnu/libc-version.h>', args: unit_test_args)
+ glibc_minor = cc.get_define('__GLIBC_MINOR__', prefix: '#include <gnu/libc-version.h>', args: unit_test_args)
+ glibc_vers = '@0@.@1@'.format(glibc_major, glibc_minor)
+ message('GLIBC vetsion:', glibc_vers)
+
+ # lchmod was implemented in glibc 2.32 (https://sourceware.org/pipermail/libc-announce/2020/000029.html)
+ if glibc_vers.version_compare('<2.32')
+ assert (not has_lchmod, '"lchmod" check should have failed')
+ else
+ assert (has_lchmod, '"lchmod" check should have succeeded')
+ endif
else
# macOS and *BSD have lchmod
- assert (cc.has_function('lchmod', prefix : lchmod_prefix,
- args : unit_test_args),
- '"lchmod" check should have succeeded')
+ assert (has_lchmod, '"lchmod" check should have succeeded')
endif
# Check that built-ins are found properly both with and without headers
assert(cc.has_function('alloca', args : unit_test_args),
From 3062fc4251acb440870ba5199780d65a81a5b658 Mon Sep 17 00:00:00 2001
From: Daniel Mensinger <daniel@mensinger-ka.de>
Date: Wed, 26 Aug 2020 17:47:16 +0200
Subject: [PATCH 2/2] tests: update .gitignore
---
.../157 wrap file should not failed/subprojects/.gitignore | 1 +
test cases/unit/79 user options for subproject/.gitignore | 1 +
2 files changed, 2 insertions(+)
create mode 100644 test cases/unit/79 user options for subproject/.gitignore
diff --git a/test cases/common/157 wrap file should not failed/subprojects/.gitignore b/test cases/common/157 wrap file should not failed/subprojects/.gitignore
index 5550e2e0da..aabded6b26 100644
--- a/test cases/common/157 wrap file should not failed/subprojects/.gitignore
+++ b/test cases/common/157 wrap file should not failed/subprojects/.gitignore
@@ -1,2 +1,3 @@
/foo-1.0
/bar-1.0
+/foo-1.0-patchdir
diff --git a/test cases/unit/79 user options for subproject/.gitignore b/test cases/unit/79 user options for subproject/.gitignore
new file mode 100644
index 0000000000..0bec5eac13
--- /dev/null
+++ b/test cases/unit/79 user options for subproject/.gitignore
@@ -0,0 +1 @@
+/subprojects