xmonad / X11

A Haskell binding to the X11 graphics library.

Home Page:http://hackage.haskell.org/package/X11

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cabal build does not actually use the library search paths that Autoconf has found

bonds opened this issue · comments

EDIT: Autoconf successfully determines the necessary -L search paths, but Cabal does not actually use them. See #53 (comment) for details.

error:

    /usr/bin/ld: cannot find -lXss

full log below

[...]

Using Stackage LTS 6.35 which points at X11 v1.6.1.2 everything works just fine and X11 successfully compiles. Using the newer Stackage LTS 9.0 which points at X11 v1.8, I get the above error and cannot complete the compile.

Can you find out what openbsd calls the X screensaver extension client library? The includes for it appear tp be present, from the build output.

And it's a good question why configure only tests for the headers and not the associated libraries... we inherited this beast and it has a number of flaws, some of which we're already trying to fix. cc @pjones

Here is the X screensaver extension client library code for OpenBSD, via web cvs:

On a running OpenBSD 6.1-stable-amd64 system, I find scrnsaver.h in /usr/X11R6/include/X11/extensions:

/u/X/i/X/extensions ❯❯❯ pwd                                                 Wed 2017-08-02 07:35:14 -0700
/usr/X11R6/include/X11/extensions
/u/X/i/X/extensions ❯❯❯ ls                                                  Wed 2017-08-02 07:35:47 -0700
EVI.h            XLbx.h           Xxf86dga.h       fontcache.h      render.h         xf86dga.h
EVIproto.h       XRes.h           ag.h             fontcacheP.h     renderproto.h    xf86dga1.h
MITMisc.h        XResproto.h      agproto.h        fontcachstr.h    saver.h          xf86dga1const.h
XEVI.h           XShm.h           bigreqsproto.h   ge.h             saverproto.h     xf86dga1proto.h
XI.h             XTest.h          bigreqstr.h      geproto.h        scrnsaver.h      xf86dga1str.h
XI2.h            Xag.h            composite.h      lbx.h            secur.h          xf86dgaconst.h
XI2proto.h       Xcomposite.h     compositeproto.h lbxproto.h       security.h       xf86dgaproto.h
XInput.h         Xcup.h           cup.h            mitmiscconst.h   securproto.h     xf86dgastr.h
XInput2.h        Xdamage.h        cupproto.h       mitmiscproto.h   shape.h          xf86misc.h
XIproto.h        Xdbe.h           damageproto.h    multibuf.h       shapeconst.h     xf86mscstr.h
XKB.h            Xext.h           damagewire.h     multibufconst.h  shapeproto.h     xf86vm.h
XKBbells.h       Xfixes.h         dbe.h            multibufproto.h  shm.h            xf86vmode.h
XKBconfig.h      Xge.h            dbeproto.h       panoramiXext.h   shmproto.h       xf86vmproto.h
XKBfile.h        Xinerama.h       dmx.h            panoramiXproto.h sync.h           xf86vmstr.h
XKBgeom.h        Xrandr.h         dmxext.h         presentproto.h   syncconst.h      xfixesproto.h
XKBproto.h       Xrender.h        dmxproto.h       presenttokens.h  syncproto.h      xfixeswire.h
XKBrules.h       Xv.h             dpms.h           randr.h          vldXvMC.h        xtestconst.h
XKBsrv.h         XvMC.h           dpmsconst.h      randrproto.h     xcmiscproto.h    xtestext1.h
XKBstr.h         XvMClib.h        dpmsproto.h      record.h         xcmiscstr.h      xtestext1const.h
XKBui.h          XvMCproto.h      dri2proto.h      recordconst.h    xf86bigfont.h    xtestext1proto.h
XKM.h            Xvlib.h          dri2tokens.h     recordproto.h    xf86bigfproto.h  xtestproto.h
XKMformat.h      Xvproto.h        extutil.h        recordstr.h      xf86bigfstr.h

does that help, or do you need something else?

Got it. Those are in /usr/X11R6/lib

~ ❯❯❯ ls -alh /usr/X11R6/lib/ | grep -i Xss                                 Wed 2017-08-02 12:22:32 -0700
-rw-r--r--  1 root  bin     9.7K Apr  1 13:05 libXss.a
-rw-r--r--  1 root  bin     976B Apr  1 12:53 libXss.la
-rw-r--r--  1 root  bin    16.7K Apr  1 12:53 libXss.so.6.0

Thanks! That seems to have worked. Now its in PR form: #54

The issue still exists on OpenBSD 6.5. The workaround of supplying --extra-lib-dir=/usr/X11R6/lib still works. The part I don't quite understand is why the values detected by configure are not used:

% cat dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/X11.buildinfo
-- X11.buildinfo.  Generated from X11.buildinfo.in by configure.
-- System-dependent values used by Distribution.Simple.defaultUserHooks
--
buildable: True
cc-options:  -I/usr/X11R6/include   -I/usr/X11R6/include -I/usr/X11R6/include
ld-options:  -L/usr/X11R6/lib 
extra-libraries: Xss Xinerama Xext

Why is ld-options: -L/usr/X11R6/lib ignored then?

Also, here, X_LIBS in config.mk value seems to be correct:

% cat dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/config.mk
X11_BUILD_PACKAGE=yes
ifneq "$(X11_BUILD_PACKAGE)" "no"
X_CFLAGS= -I/usr/X11R6/include
X_PRE_LIBS= -lSM -lICE
X_LIBS= -L/usr/X11R6/lib
X_EXTRA_LIBS=
PACKAGE=X11
VERSION=1.4.6
MAINTAINER=dons@galois.com
endif

Full log:

% cabal get X11
Unpacking to X11-1.9/
% cd X11-1.9
% cabal v2-freeze
Resolving dependencies...
Wrote freeze file: /home/greg/sandbox/X11-1.9/cabal.project.freeze
% cat ./cabal.project.freeze
constraints: any.array ==0.5.3.0,
             any.base ==4.12.0.0,
             any.containers ==0.6.0.1,
             any.data-default ==0.5.1,
             any.deepseq ==1.4.4.0,
             any.dlist ==0.8.0.5,
             any.ghc-prim ==0.5.3,
             any.integer-gmp ==1.0.2.0,
             any.old-locale ==1.0.0.7,
             any.rts ==1.0
% cabal --version
cabal-install version 2.4.0.0
compiled using version 2.4.0.1 of the Cabal library
% cabal v2-build
Resolving dependencies...
Build profile: -w ghc-8.6.4 -O1
In order, the following will be built (use -v for more details):
 - X11-1.9 (lib:X11) (first run)
Configuring X11-1.9...
configure: WARNING: unrecognized options: --with-compiler
checking for gcc... /usr/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/cc accepts -g... yes
checking for /usr/bin/cc option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/bin/cc -E
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking whether -R must be followed by a space... neither works
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking whether to build Xinerama... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking X11/extensions/Xinerama.h usability... yes
checking X11/extensions/Xinerama.h presence... yes
checking for X11/extensions/Xinerama.h... yes
checking X11/extensions/Xrandr.h usability... yes
checking X11/extensions/Xrandr.h presence... yes
checking for X11/extensions/Xrandr.h... yes
checking X11/extensions/scrnsaver.h usability... yes
checking X11/extensions/scrnsaver.h presence... yes
checking for X11/extensions/scrnsaver.h... yes
checking whether to include X.org keysyms... yes
checking X11/keysym.h usability... yes
checking X11/keysym.h presence... yes
checking for X11/keysym.h... yes
checking X11/DECkeysym.h usability... yes
checking X11/DECkeysym.h presence... yes
checking for X11/DECkeysym.h... yes
checking X11/Sunkeysym.h usability... yes
checking X11/Sunkeysym.h presence... yes
checking for X11/Sunkeysym.h... yes
checking X11/ap_keysym.h usability... yes
checking X11/ap_keysym.h presence... yes
checking for X11/ap_keysym.h... yes
checking X11/HPkeysym.h usability... yes
checking X11/HPkeysym.h presence... yes
checking for X11/HPkeysym.h... yes
checking X11/XF86keysym.h usability... yes
checking X11/XF86keysym.h presence... yes
checking for X11/XF86keysym.h... yes
checking X11/keysymdef.h usability... yes
checking X11/keysymdef.h presence... yes
checking for X11/keysymdef.h... yes
checking X11/cursorfont.h usability... yes
checking X11/cursorfont.h presence... yes
checking for X11/cursorfont.h... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating X11.buildinfo
config.status: creating include/HsX11Config.h
config.status: creating include/X11_extras_config.h
configure: WARNING: unrecognized options: --with-compiler
Preprocessing library for X11-1.9..
Building library for X11-1.9..
[ 1 of 28] Compiling Graphics.X11.Types ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Types.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Types.o )
[ 2 of 28] Compiling Graphics.X11.ExtraTypes.XorgDefault ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/XorgDefault.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/XorgDefault.o )
[ 3 of 28] Compiling Graphics.X11.ExtraTypes.XF86 ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/XF86.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/XF86.o )
[ 4 of 28] Compiling Graphics.X11.ExtraTypes.Sun ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/Sun.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/Sun.o )
[ 5 of 28] Compiling Graphics.X11.ExtraTypes.HP ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/HP.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/HP.o )
[ 6 of 28] Compiling Graphics.X11.ExtraTypes.DEC ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/DEC.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/DEC.o )
[ 7 of 28] Compiling Graphics.X11.ExtraTypes.AP ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/AP.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/AP.o )
[ 8 of 28] Compiling Graphics.X11.ExtraTypes ( Graphics/X11/ExtraTypes.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes.o )
[ 9 of 28] Compiling Graphics.X11.Xlib.Internal ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Internal.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Internal.o )
[10 of 28] Compiling Graphics.X11.Xlib.Types ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Types.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Types.o )
[11 of 28] Compiling Graphics.X11.Xlib.Screen ( Graphics/X11/Xlib/Screen.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Screen.o )
[12 of 28] Compiling Graphics.X11.Xlib.Region ( Graphics/X11/Xlib/Region.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Region.o )
[13 of 28] Compiling Graphics.X11.Xlib.Image ( Graphics/X11/Xlib/Image.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Image.o )
[14 of 28] Compiling Graphics.X11.Xlib.Font ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Font.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Font.o )
[15 of 28] Compiling Graphics.X11.Xlib.Cursor ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Cursor.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Cursor.o )
[16 of 28] Compiling Graphics.X11.Xlib.Display ( Graphics/X11/Xlib/Display.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Display.o )
[17 of 28] Compiling Graphics.X11.Xlib.Event ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Event.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Event.o )
[18 of 28] Compiling Graphics.X11.Xlib.Context ( Graphics/X11/Xlib/Context.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Context.o )
[19 of 28] Compiling Graphics.X11.Xlib.Color ( Graphics/X11/Xlib/Color.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Color.o )
[20 of 28] Compiling Graphics.X11.Xlib.Atom ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Atom.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Atom.o )
[21 of 28] Compiling Graphics.X11.Xlib.Misc ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Misc.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Misc.o )
[22 of 28] Compiling Graphics.X11.Xlib.Window ( Graphics/X11/Xlib/Window.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Window.o )
[23 of 28] Compiling Graphics.X11.Xlib ( Graphics/X11/Xlib.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib.o )
[24 of 28] Compiling Graphics.X11.XScreenSaver ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/XScreenSaver.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/XScreenSaver.o )
[25 of 28] Compiling Graphics.X11     ( Graphics/X11.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11.o )
[26 of 28] Compiling Graphics.X11.Xrandr ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xrandr.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xrandr.o )
[27 of 28] Compiling Graphics.X11.Xlib.Extras ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Extras.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Extras.o )
[28 of 28] Compiling Graphics.X11.Xinerama ( /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xinerama.hs, /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xinerama.o )
ld: error: unable to find library -lXss
ld: error: unable to find library -lXinerama
ld: error: unable to find library -lXext
ld: error: unable to find library -lX11
ld: error: unable to find library -lXrandr
ld: error: unable to find library -lXext
cc: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)
% cabal v2-build -v
this build was affected by the following (project) config files:
- /home/greg/sandbox/X11-1.9/cabal.project.freeze
Build profile: -w ghc-8.6.4 -O1
In order, the following will be built:
 - X11-1.9 (lib:X11) (first run)
creating /home/greg/sandbox/X11-1.9/dist-newstyle/build
creating /home/greg/sandbox/X11-1.9/dist-newstyle/tmp
creating
/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9
creating
/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/cache
Using self-exec internal setup method with build-type Configure and args:
["act-as-setup","--build-type=Configure","--","build","--verbose=2","--builddir=/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9","lib:X11"]
cabal act-as-setup --build-type=Configure -- build --verbose=2
--builddir=/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9
lib:X11
Reading parameters from
/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/X11.buildinfo
Component build order: library
/usr/local/bin/ghc-pkg init /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/package.conf.inplace
creating
/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build
creating
/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/autogen
creating
/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/autogen
Preprocessing library for X11-1.9..
Building library for X11-1.9..
creating
/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build
/usr/local/bin/ghc --make -fbuilding-cabal-package -O -static -dynamic-too -dynosuf dyn_o -dynhisuf dyn_hi -outputdir /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build -odir /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build -hidir /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build -stubdir /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build -i -i/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build -i. -i/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/autogen -i/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/global-autogen -I/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/autogen -I/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/global-autogen -I/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build -Iinclude -I/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/include -optP-include -optP/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/autogen/cabal_macros.h -this-unit-id X11-1.9-inplace -hide-all-packages -Wmissing-home-modules -no-user-package-db -package-db /home/greg/.cabal/store/ghc-8.6.4/package.db -package-db /home/greg/sandbox/X11-1.9/dist-newstyle/packagedb/ghc-8.6.4 -package-db /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/package.conf.inplace -package-id base-4.12.0.0 -package-id data-default-0.5.1-FoXGioXi2585r8kGFY1MGK -XHaskell98 -XForeignFunctionInterface -XCPP Graphics.X11 Graphics.X11.Types Graphics.X11.Xlib Graphics.X11.Xlib.Atom Graphics.X11.Xlib.Color Graphics.X11.Xlib.Context Graphics.X11.Xlib.Cursor Graphics.X11.Xlib.Display Graphics.X11.Xlib.Event Graphics.X11.Xlib.Font Graphics.X11.Xlib.Misc Graphics.X11.Xlib.Region Graphics.X11.Xlib.Screen Graphics.X11.Xlib.Types Graphics.X11.Xlib.Window Graphics.X11.Xlib.Image Graphics.X11.Xlib.Extras Graphics.X11.Xinerama Graphics.X11.Xrandr Graphics.X11.XScreenSaver Graphics.X11.ExtraTypes Graphics.X11.ExtraTypes.AP Graphics.X11.ExtraTypes.DEC Graphics.X11.ExtraTypes.HP Graphics.X11.ExtraTypes.Sun Graphics.X11.ExtraTypes.XF86 Graphics.X11.ExtraTypes.XorgDefault Graphics.X11.Xlib.Internal -funbox-strict-fields -Wall -fno-warn-unused-binds -fno-warn-tabs -hide-all-packages
Building C Sources...
creating
/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build
creating
/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build
creating
/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build
Linking...
[(DefiniteUnitId (DefUnitId {unDefUnitId = UnitId
"base-4.12.0.0"}),DefaultRenaming),(DefiniteUnitId (DefUnitId {unDefUnitId =
UnitId "data-default-0.5.1-FoXGioXi2585r8kGFY1MGK"}),DefaultRenaming)]
/usr/bin/ar -r /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/objs-39154/libHSX11-1.9-inplace.a '@/home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/objs-39154/ar39154-0.rsp'
/usr/bin/ar: creating /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/objs-39154/libHSX11-1.9-inplace.a
/usr/local/bin/ghc -shared -dynamic -lXss -lXinerama -lXext -lX11 -lXrandr -lXext -this-unit-id X11-1.9-inplace -hide-all-packages -no-auto-link-packages -no-user-package-db -package-db /home/greg/.cabal/store/ghc-8.6.4/package.db -package-db /home/greg/sandbox/X11-1.9/dist-newstyle/packagedb/ghc-8.6.4 -package-db /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/package.conf.inplace -package-id base-4.12.0.0 -package-id data-default-0.5.1-FoXGioXi2585r8kGFY1MGK /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Types.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Atom.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Color.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Context.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Cursor.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Display.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Event.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Font.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Misc.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Region.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Screen.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Types.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Window.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Image.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Extras.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xinerama.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xrandr.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/XScreenSaver.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/AP.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/DEC.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/HP.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/Sun.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/XF86.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/ExtraTypes/XorgDefault.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/Graphics/X11/Xlib/Internal.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/cbits/XUtils.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/cbits/auxiliaries.dyn_o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/cbits/fdset.dyn_o -o /home/greg/sandbox/X11-1.9/dist-newstyle/build/x86_64-openbsd/ghc-8.6.4/X11-1.9/build/libHSX11-1.9-inplace-ghc8.6.4.so -hide-all-packages
ld: error: unable to find library -lXss
ld: error: unable to find library -lXinerama
ld: error: unable to find library -lXext
ld: error: unable to find library -lX11
ld: error: unable to find library -lXrandr
ld: error: unable to find library -lXext
cc: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)

Notice the linker line starting with /usr/local/bin/ghc -shared -dynamic. It doesn't have -L/usr/X11R6/lib which gets added when cabal is running with --extra-lib-dir=/usr/X11R6/lib.

This is not a bug in X11. It's the user's resonsibility to provide the proper environment in which system libraries can be found, I'm afraid. We cannot possible know what those paths are and depend on the user to configure the build properly.

To be completely clear, is the value determined by configure not supposed to be used by cabal?

I've added a flag to OpenBSD ports. It's just whoever aspires to use cabal directly won't get the same benefit.

To be completely clear, is the value determined by configure not supposed to be used by cabal?

Oh, sorry, I misunderstood that part of the ticket. No, that is not supposed to be happening.