apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 65087] New: IPv6 support not detected when compiling on macOS with Xcode >= 12 due to implicit declaration of functions
Date Sun, 17 Jan 2021 09:14:48 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=65087

            Bug ID: 65087
           Summary: IPv6 support not detected when compiling on macOS with
                    Xcode >= 12 due to implicit declaration of functions
           Product: APR
           Version: 1.7.0
          Hardware: Macintosh
            Status: NEW
          Severity: major
          Priority: P2
         Component: APR
          Assignee: bugs@apr.apache.org
          Reporter: apache@ryandesign.com
  Target Milestone: ---

When APR 1.7.0* is compiled with Xcode 12 or later on macOS 10.15 or later
(using MacPorts, though that should not matter), IPv6 support is not detected.
Output from ./configure includes:


checking for inet_addr... no
checking for inet_network... no

checking for working getnameinfo... no

checking if APR supports IPv6... no -- no getnameinfo


config.log says:


configure:22788: checking for inet_addr
configure:22814: /usr/bin/clang -c -pipe -Os
-Werror=implicit-function-declaration -arch x86_64 -I/opt/local/include
-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -DDARWIN_10 conftest.c >&5
conftest.c:98:1: error: implicit declaration of function 'inet_addr' is invalid
in C99 [-Werror,-Wimplicit-function-declaration]
inet_addr("127.0.0.1");
^
1 error generated.


configure:22836: checking for inet_network
configure:22862: /usr/bin/clang -c -pipe -Os
-Werror=implicit-function-declaration -arch x86_64 -I/opt/local/include
-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -DDARWIN_10 conftest.c >&5
conftest.c:98:1: error: implicit declaration of function 'inet_network' is
invalid in C99 [-Werror,-Wimplicit-function-declaration]
inet_network("127.0.0.1");
^
1 error generated.


configure:29708: checking for working getnameinfo
configure:29762: /usr/bin/clang -o conftest -pipe -Os
-Werror=implicit-function-declaration -arch x86_64 -I/opt/local/include
-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -DDARWIN_10 -L/opt/local/lib
-Wl,-headerpad_max_install_names -arch x86_64 conftest.c -lpthread >&5
conftest.c:226:26: error: implicit declaration of function 'inet_addr' is
invalid in C99 [-Werror,-Wimplicit-function-declaration]
    sa.sin_addr.s_addr = inet_addr("127.0.0.1");
                         ^
1 error generated.


These configure checks fail because they don't include the necessary headers,
such as <arpa/inet.h>.

The configure checks are written with lines like the following:


#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif


This doesn't work because HAVE_ARPA_INET_H doesn't get defined until later on
in the configure script.


The consequence is that APR gets built without IPv6 support, which Apache users
have noticed and reported here:

https://lists.macports.org/pipermail/macports-users/2021-January/049311.html


*I know there were other implicit declaration of function problems in 1.7.0, at
least some of which have already been addressed by:

https://svn.apache.org/viewvc/apr/apr/trunk/configure.in?r1=1878362&r2=1882979

MacPorts uses a larger patch than that:

https://github.com/macports/macports-ports/blob/a14fc256193020cb92174919db733b10803cc3ca/devel/apr/files/patch-configure.diff

I have not personally attempted to verify whether all of our additional changes
are necessary but presumably the committer thought they were.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message