[MacPorts] #51708: libassuan @2.4.2 does not build on PPC Tiger, Mac OS X 10.4.11 because of macro INADDR_LOOPBACK inside #ifndef _POSIX_C_SOURCE
#51708: libassuan @2.4.2 does not build on PPC Tiger, Mac OS X 10.4.11 because of macro INADDR_LOOPBACK inside #ifndef _POSIX_C_SOURCE -----------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: libassuan -----------------------------+-------------------------------- This is the error: {{{ :info:build /bin/sh ../libtool --tag=CC --mode=compile /opt/local/bin /gcc-apple-4.2 -DHAVE_CONFIG_H -I. -I.. -I.. -I/opt/local/include -I/opt/local/include -pipe -Os -arch ppc -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wpointer-arith -MT libassuan_la-assuan-socket.lo -MD -MP -MF .deps/libassuan_la-assuan-socket.Tpo -c -o libassuan_la-assuan- socket.lo `test -f 'assuan-socket.c' || echo './'`assuan-socket.c :info:build libtool: compile: /opt/local/bin/gcc-apple-4.2 -DHAVE_CONFIG_H -I. -I.. -I.. -I/opt/local/include -I/opt/local/include -pipe -Os -arch ppc -Wall -Wcast-align -Wshadow -Wstrict-prototypes -Wpointer-arith -MT libassuan_la-assuan-socket.lo -MD -MP -MF .deps /libassuan_la-assuan-socket.Tpo -c assuan-socket.c -fno-common -DPIC -o .libs/libassuan_la-assuan-socket.o :info:build assuan-socket.c: In function 'socks5_connect': :info:build assuan-socket.c:732: error: 'INADDR_LOOPBACK' undeclared (first use in this function) :info:build assuan-socket.c:732: error: (Each undeclared identifier is reported only once :info:build assuan-socket.c:732: error: for each function it appears in.) :info:build make[3]: *** [libassuan_la-assuan-socket.lo] Error 1 :info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_devel_libassuan/libassuan/work/libassuan-2.4.2/src' }}} When the source file is compiled these C header files are included: {{{ . ../config.h . /usr/include/stdio.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/sys/types.h .. /usr/include/machine/types.h ... /usr/include/ppc/types.h .... /usr/include/ppc/_types.h .. /usr/include/machine/endian.h ... /usr/include/ppc/endian.h . /usr/include/sys/socket.h .. /usr/include/machine/param.h ... /usr/include/ppc/param.h . /usr/include/netinet/in.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/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/include/errno.h .. /usr/include/sys/errno.h . /usr/include/sys/stat.h . /usr/include/fcntl.h .. /usr/include/sys/fcntl.h . /usr/include/assert.h . assuan-defs.h .. /usr/include/sys/un.h .. /usr/include/unistd.h ... /usr/include/sys/unistd.h .. assuan.h ... /opt/local/lib/apple-gcc42/gcc/powerpc-apple- darwin8/4.2.4/include/stdarg.h ... /opt/local/include/gpg-error.h .... /opt/local/lib/apple-gcc42/gcc/powerpc-apple- darwin8/4.2.4/include/stddef.h . debug.h .. /usr/include/string.h .. /usr/include/inttypes.h }}} so `/usr/include/netinet/in.h` is included, but INADDR_LOOPBACK is excluded because of undefined guard _POSIX_C_SOURCE: {{{ 309 #ifndef _POSIX_C_SOURCE 310 #define IN_CLASSA(i) (((u_int32_t)(i) & 0x80000000) == 0) 311 #define IN_CLASSA_NET 0xff000000 312 #define IN_CLASSA_NSHIFT 24 313 #define IN_CLASSA_HOST 0x00ffffff 314 #define IN_CLASSA_MAX 128 315 316 #define IN_CLASSB(i) (((u_int32_t)(i) & 0xc0000000) == 0x80000000) 317 #define IN_CLASSB_NET 0xffff0000 318 #define IN_CLASSB_NSHIFT 16 319 #define IN_CLASSB_HOST 0x0000ffff 320 #define IN_CLASSB_MAX 65536 321 322 #define IN_CLASSC(i) (((u_int32_t)(i) & 0xe0000000) == 0xc0000000) 323 #define IN_CLASSC_NET 0xffffff00 324 #define IN_CLASSC_NSHIFT 8 325 #define IN_CLASSC_HOST 0x000000ff 326 327 #define IN_CLASSD(i) (((u_int32_t)(i) & 0xf0000000) == 0xe0000000) 328 #define IN_CLASSD_NET 0xf0000000 /* These ones aren't really */ 329 #define IN_CLASSD_NSHIFT 28 /* net and host fields, but */ 330 #define IN_CLASSD_HOST 0x0fffffff /* routing needn't know. */ 331 #define IN_MULTICAST(i) IN_CLASSD(i) 332 333 #define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) 334 #define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) 335 336 #define INADDR_LOOPBACK (u_int32_t)0x7f000001 337 #define INADDR_NONE 0xffffffff /* -1 return */ 338 339 #define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */ 340 #define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */ 341 #define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */ 342 #define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */ 343 344 #ifdef __APPLE__ 345 #define IN_LINKLOCALNETNUM (u_int32_t)0xA9FE0000 /* 169.254.0.0 */ 346 #define IN_LINKLOCAL(i) (((u_int32_t)(i) & IN_CLASSB_NET) == IN_LINKLOCALNETNUM) 347 #endif 348 349 #define IN_LOOPBACKNET 127 /* official! */ 350 #endif /* !_POSIX_C_SOURCE */ }}} -- Ticket URL: <https://trac.macports.org/ticket/51708> MacPorts <https://www.macports.org/> Ports system for OS X
#51708: libassuan @2.4.2 does not build on PPC Tiger, Mac OS X 10.4.11 because of macro INADDR_LOOPBACK inside #ifndef _POSIX_C_SOURCE ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: powerpc tiger Port: libassuan | ------------------------------+-------------------------------- Changes (by mf2k@…): * keywords: => powerpc tiger -- Ticket URL: <https://trac.macports.org/ticket/51708#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#51708: libassuan @2.4.2 does not build on PPC Tiger, Mac OS X 10.4.11 because of macro INADDR_LOOPBACK inside #ifndef _POSIX_C_SOURCE ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: powerpc tiger Port: libassuan | ------------------------------+-------------------------------- Comment (by kenneth.f.cunningham@…): Hi, I fixed this a few months back by adding the definition directly to assuan-socket.c -- it all compiled after that, and the port that requested it (which I don't recall just now) seems to work OK. {{{ /* assuan-socket.c - Socket wrapper Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. Copyright (C) 2001-2015 g10 Code GmbH This file is part of Assuan. */ //Kenhack #define INADDR_LOOPBACK (u_int32_t)0x7f000001 }}} -- Ticket URL: <https://trac.macports.org/ticket/51708#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#51708: libassuan @2.4.2 does not build on PPC Tiger, Mac OS X 10.4.11 because of macro INADDR_LOOPBACK inside #ifndef _POSIX_C_SOURCE ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: powerpc tiger Port: libassuan | ------------------------------+-------------------------------- Comment (by zhangchaowang@…): In 10.11, condition is little bit different from in.h in tiger: 313 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) I changed tiger in.h and report to upstream libassuan about this. -- Ticket URL: <https://trac.macports.org/ticket/51708#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#51708: libassuan @2.4.2 does not build on PPC Tiger, Mac OS X 10.4.11 because of macro INADDR_LOOPBACK inside #ifndef _POSIX_C_SOURCE ------------------------------+--------------------------- Reporter: Peter_Dyballa@… | Owner: larryv@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: powerpc tiger Port: libassuan | ------------------------------+--------------------------- Changes (by larryv@…): * owner: macports-tickets@… => larryv@… * status: new => assigned Comment: Please report all these issues to upstream. Given that this is a critical component of GnuPG, I will not be hotfixing the port. Feel free to Cc me on any upstream bugs. -- Ticket URL: <https://trac.macports.org/ticket/51708#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
#51708: libassuan @2.4.2 does not build on PPC Tiger, Mac OS X 10.4.11 because of macro INADDR_LOOPBACK inside #ifndef _POSIX_C_SOURCE ------------------------------+--------------------------- Reporter: Peter_Dyballa@… | Owner: larryv@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: powerpc tiger Port: libassuan | ------------------------------+--------------------------- Comment (by kenneth.f.cunningham@…): Editing <netinet/in.h> is an interesting idea I hadn't considered before, but it is admittedly tempting... blasphemy to edit the system SDK of course, and all manner of unpredictably bad things might happen. However, updating the header files in Tiger to the version that includes _DARWIN_C_SOURCE in the guards would fix some ports broken on Tiger, including libassuan. And indeed, changing that one line in <netinet/in.h> from this {{{ 309 #ifndef _POSIX_C_SOURCE }}} to this {{{ 309 #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) }}} allows libassuan to build. and would seem to me to be likely to be irrelevant to the Tiger SDK, looking at how the guard works, and thinking about all the darwin systems that followed it that use that guard. The only other visible option, of somehow undefining _POSIX_C_SOURCE to make the guard succeed, sounds like it would cause a lot more trouble and may not even be possible... And otherwise you're into piecemealing in the missing #defines like I did previously. I'm very tempted at the moment to (backup the /usr/include directory, of course) and then do a global search and replace on the whole Tiger /usr/include/* directory for that line and then see what then works and what breaks -- if anything breaks...I would hazard a bet that nothing breaks, although it would all be untested territory, to be sure -- although I can't help but think that someone must have thought to do this before. -- Ticket URL: <https://trac.macports.org/ticket/51708#comment:5> MacPorts <https://www.macports.org/> Ports system for OS X
#51708: libassuan @2.4.2 does not build on PPC Tiger, Mac OS X 10.4.11 because of macro INADDR_LOOPBACK inside #ifndef _POSIX_C_SOURCE ------------------------------+--------------------------- Reporter: Peter_Dyballa@… | Owner: larryv@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: powerpc tiger Port: libassuan | ------------------------------+--------------------------- Comment (by kenneth.f.cunningham@…): Larry - I know you said you wouldn't be hot fixing this. INADDR_LOOPBACK was not standard POSIX_C in 2004 and so it was guarded in the Tiger block. The DARWIN_C_SOURCE override did not exist in Tiger. I don't know how upstream would fix this, so in case you ever change your mind about the hot fix for Darwin 8, here's the port file diff and the small source diff to allow it to build. -- Ticket URL: <https://trac.macports.org/ticket/51708#comment:6> MacPorts <https://www.macports.org/> Ports system for OS X
#51708: libassuan @2.4.2 does not build on PPC Tiger, Mac OS X 10.4.11 because of macro INADDR_LOOPBACK inside #ifndef _POSIX_C_SOURCE ------------------------------+--------------------------- Reporter: Peter_Dyballa@… | Owner: larryv@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: powerpc tiger Port: libassuan | ------------------------------+--------------------------- Comment (by herminio.hernandezjr@…): I am also seeing this issue in Tiger and can verify the patch worked to get libassuan installed. -- Ticket URL: <https://trac.macports.org/ticket/51708#comment:7> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#51708: libassuan @2.4.2 does not build on PPC Tiger, Mac OS X 10.4.11 because of macro INADDR_LOOPBACK inside #ifndef _POSIX_C_SOURCE ------------------------------+--------------------------- Reporter: Peter_Dyballa@… | Owner: larryv@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: powerpc tiger Port: libassuan | ------------------------------+--------------------------- Comment (by Peter_Dyballa@…): This patch allows the build of libassuan, for me too. -- Ticket URL: <https://trac.macports.org/ticket/51708#comment:8> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
participants (1)
-
MacPorts