1. 02 Nov, 2019 1 commit
    • Ulrich Sibiller's avatar
      nxagent: drop NXextension.c · e54d2a39
      Ulrich Sibiller authored
      instead of including it and creating NXextension.o we can simply use
      the dix version. There are no NX specials anymore.
      e54d2a39
  2. 01 Nov, 2019 1 commit
  3. 10 Oct, 2019 1 commit
    • Ulrich Sibiller's avatar
      nxagent/Imakefile: remove ../../exports/lib · b55c66e8
      Ulrich Sibiller authored
      nxagent links system libraries that link against libX11. Unfortunately,
      nxagent (and libXcompshad) require a modified libX11 version,
      nicknamed libNX_X11, for proper functioning. Fortunately, this one can
      act as a drop-in replacement for the system libX11. So we’ll hack our
      way out: add a DT_NEEDED entry for libX11 by linking against the
      system library when building nxagent and link the other system
      libraries later and set DT_RUNPATH to a special directory containing
      symlinks from libNX_X11 to libX11.
      
      This tricks the loader into pulling in the "fake" libX11 version
      without checking its SONAME and thus satisfying the DT_NEEDED entry
      early on - specifically also for the system libraries.
      
      Ex.:
      readelf -a /usr/bin/nxagent | grep NEEDED
       0x0000000000000001 (NEEDED)             Shared library: [libX11.so.6]
      ...
       0x0000000000000001 (NEEDED)             Shared library: [libNX_X11.so.6]
      ...
      
      If, however, you run the build a second time, it will find the newly
      created libX11 links in ../../exports/lib (used as an additional
      library search path) instead of the system libX11. The results in a
      binary looking like this:
      
       0x0000000000000001 (NEEDED)             Shared library: [libNX_X11.so.6]
      ...
      
      With such a setup, the whole magic falls apart and system libraries
      will suddenly pull in the actual system libX11 file.
      
      We initially believed a compiler call such as:
      
      ${CC} [--unrelated-options ...] [-Lunrelated_library_path ...] -lX11 [more
             options like -l and -L] -L../../exports/lib -lother_libraries
      
      to do "the right thing" and link against the system libX11 (or, at
      worst, a libX11 found in the library directory search list preceding the
      link call) and use ../../exports/lib only for later linking operations,
      since the order of options matters.
      
      However, this turned out to be blatantly wrong: while the order of -L
      arguments does matter for building the search path, the whole search
      path including elements from *ALL* -L arguments (and the system paths)
      will always be used when linking libraries.
      
      Hence, (counter-intuitively to us) both these calls will be equivalent:
      
      ${CC} [--unrelated-options ...] -la -Loverride_liba -lb
            [-Lunrelated_library_path ...] -lc
      
      ${CC} [--unrelated-options ...] -Loverride_liba [-Lunrelated_library_path
             ...] -la -lb -lc
      
      By removing LDPRELIBS from NXAGENTSYSLIBS, ../../exports/lib is no
      longer used during building/linking and the binaries are built
      reproducibly. We never intended to use this directory at link time
      anyway.
      b55c66e8
  4. 11 Jun, 2019 1 commit
  5. 10 May, 2019 1 commit
  6. 15 Mar, 2018 4 commits
  7. 30 Dec, 2017 3 commits
    • Mihai Moldovan's avatar
      nx-X11: reintroduce creation of libX11 compat symlinks. · ecaa13ce
      Mihai Moldovan authored
      We need this to be able to execute the resulting nxagent binary from
      within the build directory.
      ecaa13ce
    • Mihai Moldovan's avatar
      nx-X11: build programs with a temporary RPATH/RUNPATH value and a relinked… · ffc09a73
      Mihai Moldovan authored
      nx-X11: build programs with a temporary RPATH/RUNPATH value and a relinked version with the system location.
      
      While the install target explicitly installs the relinked
      system-location version of a program, we do not actually use this.
      
      Currently, we copy nxagent directly out of the build root.
      ffc09a73
    • Mihai Moldovan's avatar
      nxagent: implement RPATH/RUNPATH override for libX11. · 26ab7b8a
      Mihai Moldovan authored
      As discussed in ArcticaProject/nx-libs#610, we need a way to load
      libNX_X11 as a fake version of libX11 into nxagent's address space.
      
      For doing so, we have to link against libX11 at build-time and specify
      a(n) RPATH/RUNPATH to our libX11 -> libNX_X11 compat symlinks.
      
      This commit is essentially doing a cross between options 3 and 4
      discussed in the provided GH issue.
      
      We link libX11 early (before specifying -Lcompat_symlinks_dir), so that
      the linker finds the "real" libX11 version with the libX11 SONAME. This
      leads to our binary depending upon both libX11 and libNX_X11 SONAMEs. We
      already always added RPATH/RUNPATH, but these values are not passed down
      to dependent libraries.
      
      What happens at run-time is that the loader searches for a libX11
      SONAME, takes RPATH/RUNPATH into account and loads our libNX_X11 library
      instead via the compat symlinks. This satisfies the libX11 SONAME and
      dependent libraries will *not* load the system libX11 version again.
      
      Debian's dpkg-shlibdeps isn't quite happy about this mismatching SONAME
      situation, so instruct to look the other way while we're minding our
      business.
      
      Fixes: ArcticaProject/nx-libs#610
      26ab7b8a
  8. 16 Dec, 2017 1 commit
  9. 25 Aug, 2017 2 commits
  10. 26 Jul, 2017 1 commit
  11. 13 Jul, 2017 1 commit
  12. 21 Apr, 2017 2 commits
  13. 10 Apr, 2017 2 commits
  14. 21 Mar, 2017 1 commit
  15. 03 Mar, 2017 1 commit
    • Mihai Moldovan's avatar
      misc nx-X11/programs/Xserver/{hw/nxagent,miext,render}/: move code around so… · 1a7fc41c
      Mihai Moldovan authored
      misc nx-X11/programs/Xserver/{hw/nxagent,miext,render}/: move code around so that we can drop nx-X11/programs/Xserver/render/miglyph.c (and by extension nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.)
      
      This is essentially a bastardized cross/backport of these X.Org commits - based
      on our current architecture:
      
      commit 4b14c9a9cd2033d3839c4ba364d41ab4c4b198ab
      Author: Eric Anholt <eric@anholt.net>
      Date:   Fri Oct 19 16:34:54 2007 -0700
      
          Replace calls to Glyphs screen hook with CompositeGlyphs and remove dead code.
      
          Not all of the DDX/miext Glyphs hook implementations have been removed, but
          they should be.
      
      and
      
      commit 2251572062b2c25643671b8d5070de1c3f7ae976
      Author: Aaron Plattner <aplattner@nvidia.com>
      Date:   Fri Oct 26 15:13:50 2007 -0700
      
          Restore the CompositeGlyphs -> ps->Glyphs -> miGlyphs callchain to allow acceleration architectures to wrap above miGlyphs.
      
      Conflicts:
      	nx-X11/programs/Xserver/render/miglyph.c
      	nx-X11/programs/Xserver/render/mipict.h
      	nx-X11/programs/Xserver/render/picture.c
      1a7fc41c
  16. 01 Mar, 2017 5 commits
  17. 26 Feb, 2017 1 commit
    • Mike Gabriel's avatar
      Xserver/os/oscolor.c: Follow X.org in dropping the rgb.txt file entirely.… · f6a11402
      Mike Gabriel authored
      Xserver/os/oscolor.c: Follow X.org in dropping the rgb.txt file entirely. Content of that file is now hard-coded.
      
       Adopting an exact copy of os/oscolor.c from X.org leads to this compiler warning:
      
       ```
       oscolor.c:844:1: warning: string length ‘7614’ is greater than the length ‘4095’ ISO C99 compilers are required to support [-Woverlength-strings]
       };
       ^
       ```
      
       This will be address later in coordination with X.org.
      
       Note: there is a tiny change in oscolor.c as we ship it. The original X.org file includes <X11/keysym.h> which seems
       unneeded. We drop that one line from oscolor.c.
      
       Fixes ArcticaProject/nx-libs#259.
      f6a11402
  18. 08 Feb, 2017 4 commits
  19. 15 Nov, 2016 2 commits
  20. 02 Nov, 2016 1 commit
  21. 31 Oct, 2016 1 commit
  22. 30 Oct, 2016 3 commits