[PATCH v5 xserver 7/6] tests: fix --disable-xorg build

Mihail Konev k.mvc at ya.ru
Wed Feb 8 21:12:29 UTC 2017


On Mon, Jan 16, 2017 at 02:47:26PM -0500, Adam Jackson wrote:
> On Sat, 2017-01-14 at 15:19 +0500, Mihail Konev wrote:
> > Commit ead5064581665ff40c177dd1b447949f1420e209 missed that xi1/
> > and xi2/ were conditioned on XORG, and made xfree86-only tests to be
> > built unconditionally.
> > Ifdef the tests and split tests_SOURCES.
> > 
> > Commit 704a867f8fb7652a8b7d5569bbe44e188457db4e missed that when
> > XORG is false, libxservertest.la isn't linked into anything.
> > However, before putting them into tests_LDADD, its static libraries
> > likely need to be reordered for linking not to fail.
> > Remove the former libxservertest.la for !XORG, as its build was only
> > triggered by 'make check'.
> > XSERVER_LIBS were depending on it; remove them too.
> > 
> > Commit 23f6dbc96e47be6cbeed78cc9ef303987c3e29a9 missed that -wrap
> > arguments to 'ld' could only be present when HAVE_LD_WRAP is true.
> 
> While this does make --disabled-xorg fail differently, it does not work
> for me:
> 
> tests-tests.o: In function `main':
> /home/ajax/git/xserver/test/tests.c:12: undefined reference to `fixes_test'
> /home/ajax/git/xserver/test/tests.c:14: undefined reference to `hashtabletest_test'
> /home/ajax/git/xserver/test/tests.c:16: undefined reference to `input_test'
> /home/ajax/git/xserver/test/tests.c:17: undefined reference to `misc_test'
> /home/ajax/git/xserver/test/tests.c:18: undefined reference to `signal_logging_test'
> /home/ajax/git/xserver/test/tests.c:19: undefined reference to `touch_test'
> /home/ajax/git/xserver/test/tests.c:20: undefined reference to `xfree86_test'
> /home/ajax/git/xserver/test/tests.c:21: undefined reference to `xkb_test'
> /home/ajax/git/xserver/test/tests.c:22: undefined reference to `xtest_test'
> /home/ajax/git/xserver/test/tests.c:26: undefined reference to `protocol_xchangedevicecontrol_test'
> /home/ajax/git/xserver/test/tests.c:28: undefined reference to `protocol_xiqueryversion_test'
> /home/ajax/git/xserver/test/tests.c:29: undefined reference to `protocol_xiquerydevice_test'
> /home/ajax/git/xserver/test/tests.c:30: undefined reference to `protocol_xiselectevents_test'
> /home/ajax/git/xserver/test/tests.c:31: undefined reference to `protocol_xigetselectedevents_test'
> /home/ajax/git/xserver/test/tests.c:32: undefined reference to `protocol_xisetclientpointer_test'
> /home/ajax/git/xserver/test/tests.c:33: undefined reference to `protocol_xigetclientpointer_test'
> /home/ajax/git/xserver/test/tests.c:34: undefined reference to `protocol_xipassivegrabdevice_test'
> /home/ajax/git/xserver/test/tests.c:35: undefined reference to `protocol_xiquerypointer_test'
> /home/ajax/git/xserver/test/tests.c:36: undefined reference to `protocol_xiwarppointer_test'
> /home/ajax/git/xserver/test/tests.c:37: undefined reference to `protocol_eventconvert_test'
> /home/ajax/git/xserver/test/tests.c:38: undefined reference to `xi2_test'
> collect2: error: ld returned 1 exit status
> 
> - ajax

This cannot happen on a clean build, at least for fixes_test():
(I should have sent this earlier, but grepping wouldn't come to mind).

  [xserver]$ git status
  HEAD detached at 730fd8c05f56
  nothing to commit, working tree clean
  [xserver]$

  [xserver]$ git show | head -n1
  commit 730fd8c05f56da21894691bbd2e7ff37f67b45f4
  [xserver]$

The only invocation of fixes_test is guarded by XORG_TESTS #define ..

  [xserver]$ grep '\bfixes_test\b' -r -C1
  Binary file test/tests-fixes.o matches
  --
  test/tests.c-#if XORG_TESTS
  test/tests.c:    run_test(fixes_test);
  test/tests.c-#ifdef RES_TESTS
  --
  test/fixes.c-int
  test/fixes.c:fixes_test(void)
  test/fixes.c-{
  --
  test/tests.h-
  test/tests.h:int fixes_test(void);
  test/tests.h-int hashtabletest_test(void);
  [xserver]$

And the only XORG_TESTS definition is guarded by XORG automake define ..

  [xserver]$ grep 'XORG_TESTS\b' -r -C1
  test/Makefile.am-if XORG
  test/Makefile.am:AM_CPPFLAGS += -DXORG_TESTS
  test/Makefile.am-# Tests that require at least some DDX functions in order to fully link
  --
  test/tests.c-
  test/tests.c:#if XORG_TESTS
  test/tests.c-    run_test(fixes_test);
  --
  test/Makefile.in-host_triplet = @host@
  test/Makefile.in:@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE at am__append_1 = -DXORG_TESTS
  test/Makefile.in- at ENABLE_UNIT_TESTS_TRUE@@RES_TRUE@@XORG_TRUE at am__append_2 = -DRES_TESTS
  --
  test/Makefile-host_triplet = x86_64-pc-linux-gnu
  test/Makefile:#am__append_1 = -DXORG_TESTS
  test/Makefile-#am__append_2 = -DRES_TESTS
  [xserver]$

Which is guarded by the XORG shell variable ..

  [xserver]$ grep '\[XORG\]' configure.ac
  AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
  [xserver]$

Which is 'yes' unless it is --disable-xorg, Windows, or Mac.

  [xserver]$ grep '\bXORG\b.*=' configure.ac -C0
  AC_ARG_ENABLE(xorg,           AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
  --
  if test "x$XORG" = xauto; then
          XORG="yes"
  --
                  cygwin*) XORG="no" ;;
                  mingw*)  XORG="no" ;;
                  darwin*) XORG="no" ;;
  --
  if test "x$XORG" = xyes; then
  --
  AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
  --
                  if test "x$XORG" = xyes; then
  [xserver]$

As there are no calls, there could be no undefined reference.
The tests-tests.o should have been compiled from an earlier commit.

Ping for https://patchwork.freedesktop.org/patch/136119/ ; also,
maybe it should have "Duplicates: 730fd8c05f56" and/or "Regressed-in(myself):".


More information about the xorg-devel mailing list