GNOME Bugzilla – Bug 710962
error: 'F_DUPFD_CLOEXEC' undeclared (first use in this function)
Last modified: 2013-10-27 20:03:23 UTC
Building glib 2.39.0 fails on OS X 10.6.8 with Xcode 3.2.6 and Apple gcc-4.2: gsubprocess.c: In function 'child_setup': gsubprocess.c:255: error: 'F_DUPFD_CLOEXEC' undeclared (first use in this function) gsubprocess.c:255: error: (Each undeclared identifier is reported only once gsubprocess.c:255: error: for each function it appears in.) mv -f .deps/libgio_2_0_la-gsocketoutputstream.Tpo .deps/libgio_2_0_la-gsocketoutputstream.Plo gsubprocess.c: In function 'unix_open_file': gsubprocess.c:318: error: 'O_CLOEXEC' undeclared (first use in this function) /bin/sh ../libtool --tag=CC --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -DG_LOG_DOMAIN=\"GLib-GIO\" -I.. -I../glib -I../glib -I.. -I../gmodule -DG_ENABLE_DEBUG -DGIO_COMPILATION -DGIO_MODULE_DIR=\"/opt/local/lib/gio/modules\" -I/opt/local/include -D_REENTRANT -xobjective-c -pipe -Os -fstrict-aliasing -arch x86_64 -MT libgio_2_0_la-gsimpleproxyresolver.lo -MD -MP -MF .deps/libgio_2_0_la-gsimpleproxyresolver.Tpo -c -o libgio_2_0_la-gsimpleproxyresolver.lo `test -f 'gsimpleproxyresolver.c' || echo './'`gsimpleproxyresolver.c libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -DG_LOG_DOMAIN=\"GLib-GIO\" -I.. -I../glib -I../glib -I.. -I../gmodule -DG_ENABLE_DEBUG -DGIO_COMPILATION -DGIO_MODULE_DIR=\"/opt/local/lib/gio/modules\" -I/opt/local/include -D_REENTRANT -xobjective-c -pipe -Os -fstrict-aliasing -arch x86_64 -MT libgio_2_0_la-gsrvtarget.lo -MD -MP -MF .deps/libgio_2_0_la-gsrvtarget.Tpo -c gsrvtarget.c -fno-common -DPIC -o .libs/libgio_2_0_la-gsrvtarget.o make[4]: *** [libgio_2_0_la-gsubprocess.lo] Error 1 make[4]: *** Waiting for unfinished jobs.... Full log: https://build.macports.org/builders/buildports-snowleopard-x86_64/builds/21731/steps/compile/logs/stdio
Created attachment 258217 [details] [review] gsubprocess: Fall back to plain F_DUPFD+fcntl for OS X Since it apparently doesn't have F_DUPFD_CLOEXEC.
Only compile tested on gnome-continuous which is Linux/glibc; please let me know if it works for you!
Review of attachment 258217 [details] [review]: Looks good
I should clarify that glib 2.39.0 builds fine on OS X 10.9 Mavericks, OS X 10.8 Mountain Lion, and OS X 10.7 Lion, but fails on OS X 10.6 Snow Leopard (and maybe earlier).