GNOME Bugzilla – Bug 602371
Build failed on Mac OS X 10.6
Last modified: 2016-07-21 10:13:05 UTC
Created attachment 148095 [details] gtk-vnc-0.3.10 build log on Mac OS X 10.6.2 (Snow Leopard) Building first failed on file gvnc.c: libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include/gtk-2.0 -I/opt/local/lib/gtk-2.0/include -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng12 -I/opt/local/include -Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Winline -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables -DSYSCONFDIR=\"/usr/local/etc\" -DPACKAGE_LOCALE_DIR=\"/usr/local/share/locale\" -DG_LOG_DOMAIN=\"gtk-vnc\" -I../gnulib/lib -I../gnulib/lib -g -O2 -MT libgtk_vnc_1_0_la-gvnc.lo -MD -MP -MF .deps/libgtk_vnc_1_0_la-gvnc.Tpo -c gvnc.c -fno-common -DPIC -o .libs/libgtk_vnc_1_0_la-gvnc.o In file included from continuation.h:24, from coroutine.h:27, from gvnc.c:40: /usr/include/ucontext.h:42:2: error: #error ucontext routines are deprecated, and require _XOPEN_SOURCE to be defined This might be a snow leopard specific issue, it is resolved by adding #define _XOPEN_SOURCE 600 in continuation.h Then, building failed on continuation.c: libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include/gtk-2.0 -I/opt/local/lib/gtk-2.0/include -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng12 -I/opt/local/include -Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Winline -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables -DSYSCONFDIR=\"/usr/local/etc\" -DPACKAGE_LOCALE_DIR=\"/usr/local/share/locale\" -DG_LOG_DOMAIN=\"gtk-vnc\" -I../gnulib/lib -I../gnulib/lib -g -O2 -MT libgtk_vnc_1_0_la-continuation.lo -MD -MP -MF .deps/libgtk_vnc_1_0_la-continuation.Tpo -c continuation.c -fno-common -DPIC -o .libs/libgtk_vnc_1_0_la-continuation.o In file included from continuation.c:23: continuation.h:30: error: expected specifier-qualifier-list before ‘size_t’ continuation.c: In function ‘continuation_trampoline’: continuation.c:43: error: ‘struct continuation’ has no member named ‘entry’ continuation.c: In function ‘cc_init’: continuation.c:50: error: ‘struct continuation’ has no member named ‘uc’ continuation.c:53: error: ‘struct continuation’ has no member named ‘uc’ continuation.c:53: error: ‘struct continuation’ has no member named ‘last’ continuation.c:54: error: ‘struct continuation’ has no member named ‘uc’ continuation.c:55: error: ‘struct continuation’ has no member named ‘uc’ continuation.c:55: error: ‘struct continuation’ has no member named ‘stack_size’ continuation.c:56: error: ‘struct continuation’ has no member named ‘uc’ continuation.c:58: error: ‘struct continuation’ has no member named ‘uc’ continuation.c: In function ‘cc_release’: continuation.c:65: error: ‘struct continuation’ has no member named ‘release’ continuation.c:66: error: ‘struct continuation’ has no member named ‘release’ continuation.c: In function ‘cc_swap’: continuation.c:73: error: ‘struct continuation’ has no member named ‘exited’ continuation.c:74: error: ‘struct continuation’ has no member named ‘last’ continuation.c:76: error: ‘struct continuation’ has no member named ‘exited’ continuation.c:77: error: ‘struct continuation’ has no member named ‘exited’ continuation.c:78: error: ‘struct continuation’ has no member named ‘exited’ continuation.c:81: error: ‘struct continuation’ has no member named ‘uc’ continuation.c:81: error: ‘struct continuation’ has no member named ‘uc’ make[2]: *** [libgtk_vnc_1_0_la-continuation.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 This problem is solved by adding #include <sys/types.h> in continuation.h Then the building failed on coroutine_ucontext.c: libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include/gtk-2.0 -I/opt/local/lib/gtk-2.0/include -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng12 -I/opt/local/include -Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Winline -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables -DSYSCONFDIR=\"/usr/local/etc\" -DPACKAGE_LOCALE_DIR=\"/usr/local/share/locale\" -DG_LOG_DOMAIN=\"gtk-vnc\" -I../gnulib/lib -I../gnulib/lib -g -O2 -MT libgtk_vnc_1_0_la-coroutine_ucontext.lo -MD -MP -MF .deps/libgtk_vnc_1_0_la-coroutine_ucontext.Tpo -c coroutine_ucontext.c -fno-common -DPIC -o .libs/libgtk_vnc_1_0_la-coroutine_ucontext.o coroutine_ucontext.c: In function ‘coroutine_init’: coroutine_ucontext.c:63: error: ‘MAP_ANONYMOUS’ undeclared (first use in this function) coroutine_ucontext.c:63: error: (Each undeclared identifier is reported only once coroutine_ucontext.c:63: error: for each function it appears in.) make[2]: *** [libgtk_vnc_1_0_la-coroutine_ucontext.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 This problem is solved by substitute 'MAP_ANONYMOUS' with 'MAP_ANON'. Finally, building failed at linking stage: ld: duplicate symbol __PyGObject_API in .libs/gtkvnc_la-vncmodule.defs.o and .libs/gtkvnc_la-vncmodule.o collect2: ld returned 1 exit status make[2]: *** [gtkvnc.la] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 The complete build log is attached. Thanks!
"duplicate symbol __PyGObject_API" is because the symbol is actually declared multiple places instead of being shared as extern in all but one place, and darwin's linker is particularly careful about tracking storage of variables. In all other places, need to define a token prior to including pygobject: >+#define NO_IMPORT_PYGOBJECT > #include <pygobject.h> It doesn't even matter (except pendantically I assume:) which ones have the extern vs the real storage allocation. The following three files have that #include: src/vnc.override src/vncmodule.c src/vncmodule.defs.c
Created attachment 169154 [details] [review] Fix OS-X compilation problems I don't have an OS-X machine to test this on. Can someone please try this attached patch, against latest GTK-VNC GIT, and confirm that it fixes all problems.
Created attachment 170577 [details] [review] Patch to add recognition of mac osx with improved ld flags Hi Dan, There's a typo in that patch: #define MAP_ANO3NYMOUS MAP_ANON There's a "3" embedded. With that fixed, it's still not working though. MAP_ANON doesn't seem to be set when it gets there, even though it should be getting set in sys/mman.h. From the sys/mman.h file, this "if" statement wraps the MAP_ANON: #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) #define MS_KILLPAGES 0x0004 /* invalidate pages, leave mapped */ #define MS_DEACTIVATE 0x0008 /* deactivate pages, leave mapped */ /* * Mapping type */ #define MAP_FILE 0x0000 /* map from file (default) */ #define MAP_ANON 0x1000 /* allocated from memory, swap space */ #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ After manually inserting the above MAP_ANON define in the src/coroutine_ucontext.c file, that error is taken care of and compiling continues... then fails almost immediately with: $ make make all-recursive Making all in src make all-am CC libgvnc_1_0_la-coroutine_ucontext.lo CCLD libgvnc-1.0.la ld: unknown option: --no-undefined collect2: ld returned 1 exit status make[3]: *** [libgvnc-1.0.la] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 $ That was an easy fix, just needed configure.ac to know about Darwin/MacOS. Patch attached. After that, things on my system broke due to local configuration issues. (tried using the OSX "Homebrew" build system, but at this point in its development it's missing many of the tools needed by autogen.sh. Had to manually install them. Probably need to rip it out and put in MacPorts again or Fink before continuing on gtkvnc. Note, that shouldn't be responsible for the MAP_ANON thing, as I was getting that using MacPorts too.)
Note, that was testing against latest GTK-VNC git.
(In reply to comment #3) > Created an attachment (id=170577) [details] [review] > Patch to add recognition of mac osx with improved ld flags Does it work if you add NO_UNDEFINED_FLAGS="-no-undefined" to the darwin block?
Closing since there's no response for 5+ years