GNOME Bugzilla – Bug 655065
Build failure on OS X 10.7 Lion
Last modified: 2012-03-02 18:49:49 UTC
Created attachment 192394 [details] [review] The Makefile patch. GTK doesn't build on Lion because of a small problem at the linking step with a test program named "autotestkeywords". Please find the patch attached. I am puzzled as to why including only headers in a file like autotestkeywords.cc would cause the symbol "_objc_msg_send_fixup" to be generated when using the 10.7 SDK as opposed to the 10.6 SDK? In any case, the patch causes linkage with the requisite frameworks. It probably causes other problems, which is why I'm consulting with the upstream (I am a MacPorts user). Below is the abbreviated build log: ---- libtool: link: /Developer/usr/bin/llvm-gcc-4.2 -DGDK_PIXBUF_DISABLE_DEPRECATED -pipe -O2 -fstrict-aliasing -arch x86_64 -Wall -arch x86_64 -o .libs/testtooltips testtooltips.o -L/opt/local/lib ../gdk/.libs/libgdk-quartz-2.0.dylib ../gtk/.libs/libgtk-quartz-2.0.dylib /opt/local/var/macports/build/_Users_administrator_Documents_build_macports_gnome_gtk2/gtk2/work/gtk+-2.24.4/gdk/.libs/libgdk-quartz-2.0.dylib /opt/local/lib/libpangocairo-1.0.dylib /opt/local/lib/libpangoft2-1.0.dylib /opt/local/lib/libpango-1.0.dylib /opt/local/lib/libatk-1.0.dylib /opt/local/lib/libcairo.dylib /opt/local/lib/libpixman-1.dylib -lpthread /opt/local/lib/libfontconfig.dylib /opt/local/lib/libexpat.dylib /opt/local/lib/libfreetype.dylib -lbz2 /opt/local/lib/libgdk_pixbuf-2.0.dylib /opt/local/lib/libpng14.dylib /opt/local/lib/libgio-2.0.dylib -lz /opt/local/lib/libgobject-2.0.dylib /opt/local/lib/libgmodule-2.0.dylib /opt/local/lib/libgthread-2.0.dylib /opt/local/lib/libglib-2.0.dylib -lresolv -lm /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -lc -framework Carbon -framework CoreFoundation -framework Cocoa /bin/sh ../libtool --tag=CXX --mode=link /Developer/usr/bin/llvm-g++-4.2 -pipe -O2 -arch x86_64 -L/opt/local/lib -arch x86_64 -o autotestkeywords autotestkeywords-autotestkeywords.o -lintl libtool: link: /Developer/usr/bin/llvm-g++-4.2 -pipe -O2 -arch x86_64 -arch x86_64 -o autotestkeywords autotestkeywords-autotestkeywords.o -L/opt/local/lib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -lc Undefined symbols for architecture x86_64: "_objc_msgSend_fixup", referenced from: l_objc_msgSend_fixup_autorelease in autotestkeywords-autotestkeywords.o (maybe you meant: l_objc_msgSend_fixup_autorelease) ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status ---- Notice that, with the current Makefile, autotestkeywords links with a reduced set of libraries.
Review of attachment 192394 [details] [review]: This doesnt seem correct. You have to modify tests/Makefile.am, tests/Makefile.in is an autogenerated file
My bad. That's because I'm a MacPorts user and that was the patch as applied to the GTK source distribution, which I believe is post-automake.
For reference, MacPorts ticket is here: https://trac.macports.org/ticket/30281
Created attachment 198656 [details] [review] Simple Makefile.am patch to correct CFLAGS for autotestkeywords.c I'm able to duplicate this when building from the 2.24.6 tarball, but when I build from git gtk-2-24, it builds fine. Perhaps a libtool issue. Anyway, the fix is harmless, so this patch does what the OP proposed, except to Makefile.am
Created attachment 198657 [details] [review] More comprehensive patch, uses default variable LDADD However, I like this solution better, because renaming LDADDS to LDADD lets automake take care of adding the default set of link flags; foo_LDADD needn't be assigned in Makefile.am unless there's a special case (and there aren't any yet).
Comment on attachment 198656 [details] [review] Simple Makefile.am patch to correct CFLAGS for autotestkeywords.c If no-one objects soon, I'm going to push the latest patch...
If it fixes my build, I'm all for it!
(In reply to comment #6) > (From update of attachment 198656 [details] [review]) > If no-one objects soon, I'm going to push the latest patch... Would be good if you could double check the patch with Matthias Clasen (now on CC). I usually don't touch the build system.
Review of attachment 198657 [details] [review]: looks okay to me.
Echoing John's comment above: I'm building git gtk-2-24 on Lion and there is no issue.
Comment on attachment 198657 [details] [review] More comprehensive patch, uses default variable LDADD Committed on master and backported to 3.2. I'll backport to 2.4 tomorrow.
Backported to 2-24.