Opened 8 years ago

Closed 8 years ago

#51068 closed defect (fixed)

p5.22-socket6 0.270 does not build on PPC Mac OS X 10.4.11, Tiger

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: haspatch Cc:
Port: p5-socket6

Description

The failure is:

:info:build "/opt/local/bin/perl5.22" "/opt/local/lib/perl5/5.22/ExtUtils/xsubpp" -noprototypes -typemap "/opt/local/lib/perl5/5.22/ExtUtils/typemap"  Socket6.xs > Socket6.xsc && mv Socket6.xsc Socket6.c
:info:build /opt/local/bin/gcc-apple-4.2 -c   -pipe -Os -fno-common -DPERL_DARWIN -I/opt/local/include -fno-strict-aliasing -I/opt/local/include -D_FORTIFY_SOURCE=2 -arch ppc -O3   -DVERSION=\"0.27\" -DXS_VERSION=\"0.27\"  "-I/opt/local/lib/perl5/5.22/darwin-thread-multi-2level/CORE"   Socket6.c
:info:build In file included from Socket6.xs:100:
:info:build inet_ntop.c:53: error: conflicting types for 'inet_ntop'
:info:build /usr/include/arpa/inet.h:105: error: previous declaration of 'inet_ntop' was here
:info:build Socket6.xs: In function 'XS_Socket6_inet_ntop':
:info:build Socket6.xs:544: warning: format '%d' expects type 'int', but argument 3 has type 'STRLEN'
:info:build Socket6.xs:544: warning: format '%d' expects type 'int', but argument 4 has type 'STRLEN'
:info:build Socket6.xs: In function 'XS_Socket6_unpack_sockaddr_in6':
:info:build Socket6.xs:623: warning: format '%d' expects type 'int', but argument 3 has type 'STRLEN'
:info:build Socket6.xs:623: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
:info:build Socket6.xs: In function 'XS_Socket6_unpack_sockaddr_in6_all':
:info:build Socket6.xs:659: warning: format '%d' expects type 'int', but argument 3 has type 'STRLEN'
:info:build Socket6.xs:659: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
:info:build Socket6.xs: In function 'XS_Socket6_getipnodebyaddr':
:info:build Socket6.xs:910: warning: format '%d' expects type 'int', but argument 3 has type 'STRLEN'
:info:build make: *** [Socket6.o] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_perl_p5-socket6/p5.22-socket6/work/Socket6-0.27'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_perl_p5-socket6/p5.22-socket6/work/Socket6-0.27" && /usr/bin/make -w all 
:info:build Exit code: 2

I reported that case to bug-Socket6 [at] rt.cpan.org, as mentioned on https://rt.cpan.org/Public/Bug/Report.html?Queue=Socket6.

Attachments (3)

main.log (5.3 KB) - added by ballapete (Peter "Pete" Dyballa) 8 years ago.
patch-inet_pton-6.patch (691 bytes) - added by ballapete (Peter "Pete" Dyballa) 8 years ago.
The working patch
Portfile.diff (329 bytes) - added by ballapete (Peter "Pete" Dyballa) 8 years ago.
Patch to patch the Portfile

Download all attachments as: .zip

Change History (10)

Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

comment:1 Changed 8 years ago by feilipu (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

This is an important issue, because it is a dependency for installation of git.

Last edited 8 years ago by feilipu (Phillip Stevens) (previous) (diff)

comment:2 in reply to:  1 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Replying to 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
}}}

comment:3 Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Andrew Gallante sent a patch which solves the problem in Tiger. (I corrected the paths to make them fit.)

Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: patch-inet_pton-6.patch added

The working patch

Changed 8 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: Portfile.diff added

Patch to patch the Portfile

comment:4 Changed 8 years ago by mf2k (Frank Schima)

Keywords: haspatch added
Owner: changed from macports-tickets@… to mf2k@…
Port: p5-socket6 added; p5.22-socket6 removed

comment:5 Changed 8 years ago by mf2k (Frank Schima)

Owner: changed from mf2k@… to macports-tickets@…

comment:6 Changed 8 years ago by dbevans (David B. Evans)

Owner: changed from macports-tickets@… to devans@…
Status: newassigned

According to your upstream ticket, this issue was fixed in p5-socket6 version 0.28 which was committed in r150089 a few days ago. Please verify that your Tiger issue has been resolved and that this ticket can be closed.

Last edited 8 years ago by dbevans (David B. Evans) (previous) (diff)

comment:7 Changed 8 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: assignedclosed

With no further reply, assuming that this issue is resolved.

Note: See TracTickets for help on using tickets.