[PATCH v2 3/3] xfree86: Remove libxorg convenience library to speed up build

Daniel Stone daniel at fooishbar.org
Fri Jun 17 08:27:39 PDT 2011


Hi,

On Tue, Jun 14, 2011 at 11:02:15PM -0700, Dan Nicholson wrote:
> libxorg.la served to collect all the Xorg convenience libraries into one
> massive archive to link into Xorg. This made things easy for symbol
> resolution, but it tremendously slowed down the build since each change
> caused libxorg.la to be rebuilt. This is an extremely slow process of
> extracting all the objects from the sub-libraries and recombining them.
> 
> Instead, the archives are linked directly into Xorg. The order of the
> libraries had to be tweaked a bit to make symbols resolve correctly with
> the lower level code moving later in the link command.

My hero! This makes _such_ a difference to my builds.  Seriously.

> -libxorg_la_LIBADD = \
> +Xorg_LDADD = \
> +            $(MAIN_LIB) \
>              $(XSERVER_LIBS) \
>              loader/libloader.la \
> -            os-support/libxorgos.la \
>              common/libcommon.la \
> +            os-support/libxorgos.la \
>              parser/libxf86config_internal.la \
>              dixmods/libdixmods.la \
>              modes/libxf86modes.la \
> @@ -58,14 +57,11 @@ libxorg_la_LIBADD = \
>              ddc/libddc.la \
>              i2c/libi2c.la \
>              dixmods/libxorgxkb.la \
> +            $(XORG_LIBS) \
>              $(top_builddir)/mi/libmi.la \
>              $(top_builddir)/os/libos.la \
> -            @XORG_LIBS@
> -
> -libxorg_la_DEPENDENCIES = $(libxorg_la_LIBADD)
> -
> -Xorg_DEPENDENCIES = libxorg.la
> -Xorg_LDADD = $(MAIN_LIB) libxorg.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS)
> +            $(XORG_SYS_LIBS) \
> +            $(XSERVER_SYS_LIBS)

Are you fine with the following patch, which readds the _DEPENDENCIES
magic to relink Xorg whenever any of the relevant source files have
changed? If so, I'll integrate that into my tree and send out a pull
request for 1.11 when a couple of smaller changes have been reviewed,
including a dependencies patch for test/ which makes sure it gets
rebuilt as well.

With that, for the series:
Reviewed-by: Daniel Stone <daniel at fooishbar.org>

Cheers,
Daniel

diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 67c8773..a4ec1f7 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -44,7 +44,7 @@ AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@
 INCLUDES = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \
 	-I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac
 
-Xorg_LDADD = \
+LOCAL_LIBS = \
             $(MAIN_LIB) \
             $(XSERVER_LIBS) \
             loader/libloader.la \
@@ -59,9 +59,12 @@ Xorg_LDADD = \
             dixmods/libxorgxkb.la \
             $(XORG_LIBS) \
             $(top_builddir)/mi/libmi.la \
-            $(top_builddir)/os/libos.la \
+            $(top_builddir)/os/libos.la
+Xorg_LDADD = \
+            $(LOCAL_LIBS) \
             $(XORG_SYS_LIBS) \
             $(XSERVER_SYS_LIBS)
+Xorg_DEPENDENCIES = $(LOCAL_LIBS)
 
 Xorg_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 


More information about the xorg-devel mailing list