Bug 5382

Summary: test apps fail to build, dll missing symbols, on cygwin
Product: cairo Reporter: David Dombrowsky <davek>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED NOTABUG QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high    
Version: 1.0.2   
Hardware: x86 (IA32)   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:

Description David Dombrowsky 2005-12-19 18:50:31 UTC
I've been trying to track down the source of this missing symbol for some time
now.  Here's the tail of the build...

if gcc -DHAVE_CONFIG_H -I. -I. -I.. -D_GNU_SOURCE -I. -I../pixman/src -I../src
-I../src -I/usr/X11R6/include    -I/usr/local/include/lib
then mv -f ".deps/imagediff.Tpo" ".deps/imagediff.Po"; else rm -f
".deps/imagediff.Tpo"; exit 1; fi
/bin/sh ../libtool --tag=CC --mode=link gcc  -g -O2  -Wl,-no-undefined -o
imagediff.exe  imagediff.o libcairotest.la ../src/libcairo.la
gcc -g -O2 -Wl,-no-undefined -o .libs/imagediff.exe imagediff.o 
./.libs/libcairotest.a ../src/.libs/libcairo.dll.a -L/usr/X11R6/lib -lX
./.libs/libcairotest.a(cairo-test.o): In function `create_xlib_surface':
/home/ddombrowsky/download/cairo-1.0.2/test/cairo-test.c:425: undefined
reference to `_cairo_xlib_surface_create_with_xrender_format'
collect2: ld returned 1 exit status
make[2]: *** [imagediff.exe] Error 1
make[2]: Leaving directory `/home/ddombrowsky/download/cairo-1.0.2/test'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ddombrowsky/download/cairo-1.0.2'
make: *** [all] Error 2

I try looking for the symbol ->

ddombrowsky% nm src/.libs/libcairo.a | grep
_cairo_xlib_surface_create_with_xrender_format
00002130 T _cairo_xlib_surface_create_with_xrender_format
ddombrowsky% nm src/.libs/libcairo.dll.a | grep
_cairo_xlib_surface_create_with_xrender_format
[nothing returned]

am I doing something wrong or is that dll missing the symbol while the static
lib has it.  sounds like an issue with the linker, but I've got the most recent
gnu binutils, libtool, and gcc built native on the box.  Unless there's a bug in
the code for cygwin, I can't think of another source.
Comment 1 David Dombrowsky 2005-12-21 11:19:22 UTC
I fixed the compilation error by editing cairo.def ->

--- tmp/cairo-1.0.2/src/cairo.def       2005-10-03 20:48:48.000000000 -0400
+++ cairo-1.0.2/src/cairo.def   2005-12-20 19:16:55.935325500 -0500
@@ -170,4 +170,9 @@
 cairo_win32_scaled_font_get_metrics_factor
 cairo_win32_scaled_font_select_font
 cairo_win32_surface_create
+cairo_xlib_surface_create
+cairo_xlib_surface_create_for_bitmap
+cairo_xlib_surface_create_with_xrender_format
+cairo_xlib_surface_set_drawable
+cairo_xlib_surface_set_size
 LIBRARY libcairo-2.dll

Since that isn't a generated file, I'm not sure why those symbols aren't
included.  When I included them in that list, they exported fine to
libcairo.dll.a and the test apps linked correctly.
Comment 2 David Dombrowsky 2005-12-22 04:44:00 UTC
after it built it segfaulted on 11 tests.  Looks like the hack didn't fix it.
Comment 3 David Dombrowsky 2005-12-22 07:17:58 UTC
I managed to remove some of the symbol errors by disabling Xlib.  I don't know
if that means my Xlib is broken or what.

But I still had to hack in new symbols into cairo.def to get everything to
compile, and then it segfaulted for the first freetype test 

/bin/sh: line 1:   608 Segmentation fault      (core dumped) ${dir}$tst
FAIL: ft-font-create-for-ft-face
Comment 4 David Dombrowsky 2005-12-23 14:46:15 UTC
I got it to build and install with --disable-win32.  Makes sense that I should
have tried that before disabling X :)
Comment 5 Chris Wilson 2008-09-30 03:35:18 UTC
Although the build process described is non-trivial, you did eventually managed to build a working cygwinified-cairo! Hopefully, with Behdad's work on updating the build system to be more non-linux friendly things are easier today. If you do have the time to try rebuilding, try following README.win32 and please report back any issues. Thanks.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.