[PATCH 1/6] Add MAIN_LIB as the first library to server libs

Tomas Carnecky tom at dbservice.com
Wed Aug 4 10:25:14 PDT 2010


On 8/4/10 6:06 PM, Tiago Vignatti wrote:
> On Tue, Aug 03, 2010 at 10:34:10PM +0200, ext Tomas Carnecky wrote:
>> MAIN_LIB only implements the main() method and doesn't provide anything
>> that other libraries would depend on. So it can go as the very first
>> into the set of libraries linked to each server.
>> One exception is darwin/xquartz which redefines main() to dix_main() and
>> then calls it from somewhere inside hw/xquartz/. But this change doesn't
>> affect xquartz because the library which calls dix_main() (libXquartz.la)
>> is passed before $(DARWIN_LIBS) to X11.bin.
> 
> Looks nice!
> 
> One thing: test/ has its own main.c. Are you sure it's safe with your changes?

I just tested the tree and `make check` runs the tests and not Xorg.

My theory: the test apps now link with two object files which implement
main(), but since xkb.o comes before @XORG_LIBS@ on the linker
commandline, the linker takes the main() implementation from xkb.o
instead of the implementation from MAIN_LIB.

However, even though that seems to work, I'm still not happy with how
the tests link with @XORG_LIBS@ and all the other libraries that make up
Xorg. AFAICS the tests do not depend on anything specific in the Xorg
DDX, and it seems as they would link fine with only $(XSERVER_LIBS) plus
the stubs required by the DIX. So why not treat the tests just like
another DDX and compose TEST_LIBS, TEST_SYS_LIBS inside the configure
file and then implement the few stubs that are needed by the
XSERVER_LIBS (DDXRingBell, LegalModifier, AbortDDX, OsVendorFatalError,
OsVendorInit, ddxProcessArgument, ddxUseMsg, ProcessInputEvents)?

tom



More information about the xorg-devel mailing list