[Xcb] hidden-visibility and library size

Jamey Sharp jamey at minilop.net
Tue Dec 27 13:36:45 PST 2005


On Tue, Dec 27, 2005 at 09:26:18PM +0100, Vincent Torri wrote:
> There are the acinclude.m4 file and a diff of configure.ac attached
> $(VISIBILITY_CFLAGS) must be added in src/Makefile.am of course

Nothing seems to be attached. I would like to see the changes though.
Would you ensure that you've made all the necessary changes and that XCB
still builds and works (and passes its test suite?) -- and then run
	cvs add acinclude.m4
and post just the output of `cvs diff -Nu`?

> Maybe we can modify it so that your modifications are taken into
> account.

I can merge my changes after we've got the hidden visibility stuff
committed, if you want. Or I can just commit and you can merge. Let me
know which way you'd like to go.

> On Tue, 27 Dec 2005, Jamey Sharp wrote:
> > Interesting statistics: compiling --with-opt=small saves 15kB (59.6kB
> > total) over --with-opt (73.4kB total) and --without-opt (74.1kB).
> 
> I also guess that adding -s during linking should decrease even more the
> library size (libXCB_la_LDFLAGS = -s   in src/Makefile.am). I've not tried
> it, i've just used strip on the library directly.

Won't make any difference on the numbers I'm quoting though, since I'm
just measuring the size of the text, data, and bss segments.

Since you can just run strip after compiling, or set LDFLAGS in the
environment, I'm not inclined to add anything to configure or the
Makefiles to run it automatically.

> i also think that we must be sure that, if debugging is set, only the
> warning flags and -g must be passed to gcc during compilation and -s not
> be passed during linking.

I don't think I want that. If you give an odd combination of
optimization and debugging flags, you probably know what you're doing.
For example, I frequently build XCB with both -O3 and -g, which is a
pretty reasonable thing to do. I might even want to build
--with-opt=small, which is "-Os -fomit-frame-pointer -DNDEBUG", and have
debugging on -- the debugger will be mostly useless, but not completely
useless.

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20051227/16d02d4b/attachment.pgp


More information about the Xcb mailing list