Fix the compilation failure when autoconf-2.71 is used

This commit is contained in:
panxiaohe 2022-03-31 16:54:15 +08:00
parent e0e3f784e6
commit 3be22a092f
2 changed files with 71 additions and 1 deletions

View File

@ -2,7 +2,7 @@
Name: apr
Version: 1.7.0
Release: 3
Release: 4
Summary: Apache Portable Runtime.
License: ASL 2.0 and BSD with advertising and ISC and BSD
URL: http://apr.apache.org
@ -15,6 +15,7 @@ Patch2: Split-apr_pool_check_integrity-into-two-parts.patch
Patch3: Pool-debugging-fixes.patch
Patch4: Fix-pool-debugging-output-so-that-creation-events-ar.patch
Patch5: backport-CVE-2017-12613-Bounds-check-human-readable-date-fields.patch
Patch6: backport-build-apr_common.me-avoid-explicit-inclusion-if-conf.patch
BuildRequires: gcc autoconf libtool libuuid-devel python3 lksctp-tools-devel
@ -98,6 +99,12 @@ make check
%doc docs/incomplete_types docs/non_apr_programs
%changelog
* Thu Mar 31 2022 panxiaohe <panxh.life@foxmail.com> - 1.7.0-4
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Fix the compilation failure when autoconf-2.71 is used
* Tue Mar 30 2021 shenyangyang<shenyangyang4@huawei.com> - 1.7.0-3
- Type:bugfix
- ID:NA

View File

@ -0,0 +1,63 @@
From 0a763c5e500f4304b7c534fae0fad430d64982e8 Mon Sep 17 00:00:00 2001
From: Yann Ylavic <ylavic@apache.org>
Date: Sat, 6 Mar 2021 22:20:59 +0000
Subject: [PATCH] build/apr_common.m4: avoid explicit inclusion of "confdefs.h"
The failure is observed on `autoconf-2.69d` (soon to be released
as `autoconf-2.70`). There `int64_t` detection fails as:
$ autoreconf && ./configure
checking whether int64_t and int use fmt %d... no
checking whether int64_t and long use fmt %ld... no
checking whether int64_t and long long use fmt %lld... no
configure: error: could not determine the string function for int64_t
```
This happens because `./configure` always stumbles on warning:
configure:3350: gcc -c -g -O2 -Werror conftest.c >&5
In file included from conftest.c:31:
confdefs.h:22: error: "__STDC_WANT_IEC_60559_ATTRIBS_EXT__" redefined [-Werror]
22 | #define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
|
It's triggered by double inclusion of `"confdefs.h"` contents:
explicitly in `APR_TRY_COMPILE_NO_WARNING` macro and implicitly
via `AC_LANG_SOURCE` use.
To fix it and avoid having to define `main()` declaration the change
uses `AC_LANG_PROGRAM` instead.
Tested on both `autoconf-2.69` and `autoconf-2.69d`.
Github: closes #25
Submitted by: Sergei Trofimovich <slyfox gentoo.org>
Reviewed by: ylavic
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1887279 13f79535-47bb-0310-9956-ffa450edef68
---
build/apr_common.m4 | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/build/apr_common.m4 b/build/apr_common.m4
index 3dfe85542b7..67d004983d2 100644
--- a/build/apr_common.m4
+++ b/build/apr_common.m4
@@ -467,13 +467,9 @@ AC_DEFUN([APR_TRY_COMPILE_NO_WARNING],
CFLAGS="$CFLAGS -Werror"
fi
AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE(
- [#include "confdefs.h"
- ]
- [[$1]]
- [int main(int argc, const char *const *argv) {]
+ [AC_LANG_PROGRAM(
+ [[$1]],
[[$2]]
- [ return 0; }]
)], [CFLAGS=$apr_save_CFLAGS
$3], [CFLAGS=$apr_save_CFLAGS
$4])