Bug 16129

Summary: Don't export private symbols on non-win32 systems
Product: cairo Reporter: Sebastian Dröge (slomo) <slomo>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.6.4   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: cairo-export-symbols.patch
cairo-export-symbols.patch

Description Sebastian Dröge (slomo) 2008-05-28 01:59:31 UTC
Created attachment 16782 [details] [review]
cairo-export-symbols.patch

Hi,
it would be nice if cairo didn't export private symbols like _cairo_atomic_mutex, _cairo_font_face_mutex, etc.

Attached patch makes cairo export whatever is in cairo.def (for some reason I don't have that file) on win32 as it was before but uses a symbol export regexp on other systems that makes it export only "^cairo.*" symbols.

Please consider applying this for 1.6.

Thanks
Comment 1 Sebastian Dröge (slomo) 2008-05-28 02:01:53 UTC
For x86 these symbols are:

$ objdump -T /usr/lib/libcairo.so.2 | grep _cairo
00060bec g    DO .bss	00000018  Base        _cairo_scaled_font_error_mutex
00060bd4 g    DO .bss	00000018  Base        _cairo_scaled_font_map_mutex
00060c1c g    DO .bss	00000018  Base        _cairo_xlib_display_mutex
00060c04 g    DO .bss	00000018  Base        _cairo_ft_unscaled_font_map_mutex
00060b8c g    DO .bss	00000018  Base        _cairo_pattern_solid_pattern_cache_lock
00060ba4 g    DO .bss	00000018  Base        _cairo_pattern_solid_surface_cache_lock
00060bbc g    DO .bss	00000018  Base        _cairo_font_face_mutex


Other architectures export potentially more.
Comment 2 Sebastian Dröge (slomo) 2008-05-28 02:09:34 UTC
Created attachment 16784 [details] [review]
cairo-export-symbols.patch

Better patch that only marks those accidentially exported cairo_.*_mutex symbols as private.

The other patch might still make sense.
Comment 3 Chris Wilson 2008-05-28 02:23:43 UTC
Too slow ;-) Behdad had already fixed it with commit 626edfc333b77604b6955c12ae111d14c174034c.
Comment 4 Behdad Esfahbod 2008-05-28 08:31:04 UTC
commit b5c6c8565055e3e096e2f6727ca3c831575ff424
Author: Behdad Esfahbod <behdad@behdad.org>
Date:   Wed May 28 10:59:35 2008 -0400

    [src/check-def.sh] Also check for public variables (#16129)

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.