[MacPorts] #51068: p5.22-socket6 0.270 does not build on PPC Mac OS X 10.4.11, Tiger
MacPorts
noreply at macports.org
Fri Jun 10 14:56:55 PDT 2016
#51068: p5.22-socket6 0.270 does not build on PPC Mac OS X 10.4.11, Tiger
------------------------------+--------------------------------
Reporter: Peter_Dyballa@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.3.4
Resolution: | Keywords:
Port: p5.22-socket6 |
------------------------------+--------------------------------
Comment (by Peter_Dyballa@…):
Replying to [comment:1 phillip.stevens@…]:
> The build error can be resolved by commenting out the definition of
inet_ntop in the inet_ntop.c file, and relying on the definition in
/usr/include/arpa/inet.h
>
Yes, that would be a work-around.
Looking a bit closer at the case Socket6.xs has:
{{{
99 #ifndef HAVE_INET_NTOP
100 #include "inet_ntop.c"
101 #define HAVE_INET_NTOP 1
102 #endif
103 #ifndef HAVE_INET_PTON
104 #include "inet_pton.c"
105 #define HAVE_INET_PTON 1
106 #endif
}}}
So it has to do with configure. Config.log has:
{{{
165 configure:3922: checking for inet_pton
166 configure:3922: /opt/local/bin/gcc-apple-4.2 -o conftest -fno-
common -DPERL_DARWIN -pipe -Os -fno-strict-aliasing -I/opt/local/include
-D_FORTIFY_SOURCE=2 -DPERL_USE_SAFE_PUTENV -I/opt/local/include
-L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc conftest.c
>&5
167 configure:3922: $? = 0
168 configure:3922: result: yes
169 configure:4082: checking for inet_ntop
170 configure:4082: /opt/local/bin/gcc-apple-4.2 -o conftest -fno-
common -DPERL_DARWIN -pipe -Os -fno-strict-aliasing -I/opt/local/include
-D_FORTIFY_SOURCE=2 -DPERL_USE_SAFE_PUTENV -I/opt/local/include
-L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc conftest.c
>&5
171 configure:4082: $? = 0
172 configure:4082: result: yes
173 configure:4246: checking for working inet_ntop
174 configure:4279: /opt/local/bin/gcc-apple-4.2 -o conftest -fno-
common -DPERL_DARWIN -pipe -Os -fno-strict-aliasing -I/opt/local/include
-D_FORTIFY_SOURCE=2 -DPERL_USE_SAFE_PUTENV -I/opt/local/include
-L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc conftest.c
>&5
175 configure:4279: $? = 0
176 configure:4279: ./conftest
177 configure:4279: $? = 1
178 configure: program exited with status 1
179 configure: failed program was:
180 | /* confdefs.h */
181 | #define PACKAGE_NAME ""
182 | #define PACKAGE_TARNAME ""
183 | #define PACKAGE_VERSION ""
184 | #define PACKAGE_STRING ""
185 | #define PACKAGE_BUGREPORT ""
186 | #define PACKAGE_URL ""
187 | #define HAVE_PL_SV_UNDEF 1
188 | #define HAVE_GETADDRINFO 1
189 | #define HAVE_GETNAMEINFO 1
190 | #define HAVE_GETHOSTBYNAME2 1
191 | #define HAVE_GETIPNODEBYNAME 1
192 | #define HAVE_GETIPNODEBYADDR 1
193 | #define HAVE_INET_PTON 1
194 | #define HAVE_INET_NTOP 1
195 | /* end confdefs.h. */
196 |
197 | #include <string.h>
198 | #include <stdlib.h>
199 | #include <sys/types.h>
200 | #include <sys/socket.h>
201 | #include <netinet/in.h>
202 | #include <arpa/inet.h>
203 |
204 | int
205 | main() {
206 | static struct in6_addr addr;
207 | static char str[INET6_ADDRSTRLEN];
208 |
209 | addr.s6_addr[15] = 0x21;
210 | inet_ntop(AF_INET6, &addr, str, sizeof(str));
211 | if (strcmp(str,"::21"))
212 | exit(1);
213 | }
214 |
215 configure:4296: result: no
}}}
So it has to do with the test programme here that `net_ntop.c` gets
included, because this test programme fails to run correctly. There do not
seem particular (environment) variables to be set. So using that test
programme I tried to compile it manually with additional diagnostic
output:
{{{
root 239 /\ /opt/local/bin/gcc-apple-4.2 -o conftest -fno-common
-DPERL_DARWIN -pipe -Os -fno-strict-aliasing -I/opt/local/include
-D_FORTIFY_SOURCE=2 -DPERL_USE_SAFE_PUTENV -I/opt/local/include
-L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc -H -Wl,-t
check-inet_ntop.c
. /usr/include/string.h
.. /usr/include/_types.h
... /usr/include/sys/_types.h
.... /usr/include/sys/cdefs.h
.... /usr/include/machine/_types.h
..... /usr/include/ppc/_types.h
. /usr/include/stdlib.h
.. /usr/include/sys/wait.h
... /usr/include/sys/signal.h
.... /usr/include/sys/appleapiopts.h
.... /usr/include/machine/signal.h
..... /usr/include/ppc/signal.h
... /usr/include/sys/resource.h
... /usr/include/machine/endian.h
.... /usr/include/ppc/endian.h
..... /usr/include/sys/_endian.h
...... /opt/local/lib/apple-gcc42/gcc/powerpc-apple-
darwin8/4.2.4/include/stdint.h
...... /usr/include/libkern/OSByteOrder.h
....... /usr/include/libkern/ppc/OSByteOrder.h
.. /usr/include/alloca.h
.. /usr/include/machine/types.h
... /usr/include/ppc/types.h
.... /usr/include/ppc/_types.h
. /usr/include/sys/types.h
. /usr/include/sys/socket.h
.. /usr/include/machine/param.h
... /usr/include/ppc/param.h
. /usr/include/netinet/in.h
.. /usr/include/netinet6/in6.h
. /usr/include/arpa/inet.h
.. /usr/include/sys/param.h
... /usr/include/sys/syslimits.h
... /opt/local/lib/apple-gcc42/gcc/powerpc-apple-
darwin8/4.2.4/include/limits.h
.... /opt/local/lib/apple-gcc42/gcc/powerpc-apple-
darwin8/4.2.4/include/syslimits.h
.... /usr/include/limits.h
..... /usr/include/machine/limits.h
...... /usr/include/ppc/limits.h
....... /usr/include/ppc/_limits.h
/usr/lib/crt1.o
/var/tmp//ccBwLRZw.o
/usr/lib/libgcc_s.10.4.dylib
/opt/local/lib/apple-gcc42/gcc/powerpc-apple-darwin8/4.2.4/libgcc.a
/usr/lib/libSystemStubs.a
/usr/lib/libSystem.dylib
/usr/lib/system/libmathCommon.A.dylib
}}}
The binary built is:
{{{
-rwxr-xr-x 1 root admin 13480 10 Jun 22:44 conftest
root 241 /\ file ./conftest
./conftest: Mach-O executable ppc
root 242 /\ otool -L ./conftest
./conftest:
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 88.1.12)
}}}
and when invoked it fails (it is a tcsh I am using):
{{{
root 243 /\ ./conftest
root 244 /\ echo $status
1
}}}
I cannot judge what's wrong here…
Assuming that PPC Tiger has an IPv6 compatible implementation of
inet_ntop() one could simply patch Socket6.xs to not contain these three
lines:
{{{
100 #include "inet_ntop.c"
101 #define HAVE_INET_NTOP 1
102 #endif
}}
Some IPv6 support seems to exist in PPC, according to `configure`:
{{{
checking whether you have sin6_scope_id in struct sockaddr_in6... yes
}}}
--
Ticket URL: <https://trac.macports.org/ticket/51068#comment:2>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list