commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
4k stars 844 forks source link

hackage-security build fails on freebsd (breaks stack upgrade) #3244

Closed alios closed 7 years ago

alios commented 7 years ago

General summary/comments

Trying to install cabal-install in global project or do a stack upgrade --git fails on FreeBSD (11.0-RELEASE-p9).

Steps to reproduce

  1. install devel/stack (1.4.0_1 in my case) from ports
  2. set .stack/global-project/stack.yaml to use lts-8.19 for global project
  3. run stack setup (will install ghc-8.0.2)
  4. put $HOME/.local/bin into path
  5. run either stack install cabal-install or stack upgrade --git both will try to install hackage-security-0.5.2.2 as a dependency at some point, which fails (see below)

Note: I had no other problems with any other package into global project so far. F.e. I build all my dev tools (alex, happy, ghc-mod, hoogle etc) into the global project in my home dir.

Expected

Would expect to compile stack or cabal-install into the global-project into my home dir.

Actual

The build of hackage-secuirty fails with a linker error, which seems to not understand the --build-id=none command line option. I guess that is because on FreeBSD 11.0-RELEASE-p9 /usr/bin/ld is a pretty old version (GNU ld 2.17.50 [FreeBSD] 2007-07-03) while the installed by a port in /usr/local/bin is GNU ld ((GNU Binutils) 2.28).

[~]$ stack install cabal-install                                                                                                                                                    
hackage-security-0.5.2.2: configure
hackage-security-0.5.2.2: build
Progress: 1/2
--  While building package hackage-security-0.5.2.2 using:
      /usr/home/alios/dot_files/.stack/setup-exe-cache/x86_64-freebsd/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /usr/home/alios/dot_files/.stack/global-project/.stack-work/logs/hackage-security-0.5.2.2.log

    Configuring hackage-security-0.5.2.2...
    Building hackage-security-0.5.2.2...
    Preprocessing library hackage-security-0.5.2.2...
    [ 1 of 42] Compiling Prelude          ( src/Prelude.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Prelude.o )
    [ 2 of 42] Compiling Text.JSON.Canonical ( src/Text/JSON/Canonical.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Text/JSON/Canonical.o )
    [ 3 of 42] Compiling Hackage.Security.Util.TypedEmbedded ( src/Hackage/Security/Util/TypedEmbedded.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Util/TypedEmbedded.o )
    [ 4 of 42] Compiling Hackage.Security.Util.Stack ( src/Hackage/Security/Util/Stack.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Util/Stack.o )
    [ 5 of 42] Compiling Hackage.Security.Util.Pretty ( src/Hackage/Security/Util/Pretty.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Util/Pretty.o )
    [ 6 of 42] Compiling Hackage.Security.Util.Some ( src/Hackage/Security/Util/Some.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Util/Some.o )
    [ 7 of 42] Compiling Hackage.Security.Util.Path ( src/Hackage/Security/Util/Path.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Util/Path.o )
    [ 8 of 42] Compiling Hackage.Security.Util.Lens ( src/Hackage/Security/Util/Lens.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Util/Lens.o )
    [ 9 of 42] Compiling Hackage.Security.Util.JSON ( src/Hackage/Security/Util/JSON.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Util/JSON.o )
    [10 of 42] Compiling Hackage.Security.Util.IO ( src/Hackage/Security/Util/IO.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Util/IO.o )
    [11 of 42] Compiling Hackage.Security.Util.Checked ( src/Hackage/Security/Util/Checked.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Util/Checked.o )
    [12 of 42] Compiling Hackage.Security.Util.Base64 ( src/Hackage/Security/Util/Base64.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Util/Base64.o )
    [13 of 42] Compiling Hackage.Security.TUF.Paths ( src/Hackage/Security/TUF/Paths.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Paths.o )
    [14 of 42] Compiling Hackage.Security.TUF.Layout.Repo ( src/Hackage/Security/TUF/Layout/Repo.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Layout/Repo.o )
    [15 of 42] Compiling Hackage.Security.TUF.Layout.Cache ( src/Hackage/Security/TUF/Layout/Cache.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Layout/Cache.o )
    [16 of 42] Compiling Hackage.Security.Key ( src/Hackage/Security/Key.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Key.o )
    [17 of 42] Compiling Hackage.Security.Key.Env ( src/Hackage/Security/Key/Env.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Key/Env.o )
    [18 of 42] Compiling Hackage.Security.JSON ( src/Hackage/Security/JSON.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/JSON.o )
    [19 of 42] Compiling Hackage.Security.TUF.Common ( src/Hackage/Security/TUF/Common.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Common.o )
    [20 of 42] Compiling Hackage.Security.TUF.FileInfo ( src/Hackage/Security/TUF/FileInfo.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/FileInfo.o )
    [21 of 42] Compiling Hackage.Security.TUF.FileMap ( src/Hackage/Security/TUF/FileMap.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/FileMap.o )
    [22 of 42] Compiling Hackage.Security.TUF.Header ( src/Hackage/Security/TUF/Header.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Header.o )
    [23 of 42] Compiling Hackage.Security.TUF.Patterns ( src/Hackage/Security/TUF/Patterns.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Patterns.o )
    [24 of 42] Compiling Hackage.Security.TUF.Signed ( src/Hackage/Security/TUF/Signed.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Signed.o )
    [25 of 42] Compiling Hackage.Security.TUF.Mirrors ( src/Hackage/Security/TUF/Mirrors.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Mirrors.o )
    [26 of 42] Compiling Hackage.Security.TUF.Snapshot ( src/Hackage/Security/TUF/Snapshot.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Snapshot.o )
    [27 of 42] Compiling Hackage.Security.TUF.Targets ( src/Hackage/Security/TUF/Targets.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Targets.o )
    [28 of 42] Compiling Hackage.Security.TUF.Layout.Index ( src/Hackage/Security/TUF/Layout/Index.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Layout/Index.o )
    [29 of 42] Compiling Hackage.Security.TUF.Timestamp ( src/Hackage/Security/TUF/Timestamp.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Timestamp.o )
    [30 of 42] Compiling Hackage.Security.TUF.Root ( src/Hackage/Security/TUF/Root.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF/Root.o )
    [31 of 42] Compiling Hackage.Security.TUF ( src/Hackage/Security/TUF.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/TUF.o )
    [32 of 42] Compiling Hackage.Security.Server ( src/Hackage/Security/Server.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Server.o )
    [33 of 42] Compiling Hackage.Security.Trusted.TCB ( src/Hackage/Security/Trusted/TCB.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Trusted/TCB.o )
    [34 of 42] Compiling Hackage.Security.Trusted ( src/Hackage/Security/Trusted.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Hackage/Security/Trusted.o )
      /usr/bin/ld: unrecognized option '--build-id=none'
    /usr/bin/ld: use the --help option for usage information
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    `clang' failed in phase `Linker'. (Exit code: 1)

Stack version

$ stack --version
Version 1.4.0 x86_64
Compiled with:
- Cabal-1.24.2.0
- Glob-0.7.14
- HUnit-1.5.0.0
- MonadRandom-0.5.1
- QuickCheck-2.9.2
- SHA-1.6.4.2
- StateVar-1.1.0.4
- aeson-1.1.0.0
- aeson-compat-0.3.6
- annotated-wl-pprint-0.7.0
- ansi-terminal-0.6.2.3
- ansi-wl-pprint-0.6.7.3
- array-0.5.1.0
- asn1-encoding-0.9.5
- asn1-parse-0.9.4
- asn1-types-0.3.2
- async-2.1.1
- attoparsec-0.13.1.0
- auto-update-0.1.4
- base-4.8.1.0
- base-compat-0.9.2
- base-orphans-0.5.4
- base16-bytestring-0.1.1.6
- base64-bytestring-1.0.0.1
- bifunctors-5.4.1
- binary-0.7.5.0
- binary-tagged-0.1.4.2
- bitarray-0.0.1.1
- blaze-builder-0.4.0.2
- blaze-html-0.9.0.1
- blaze-markup-0.8.0.0
- byteable-0.1.1
- bytestring-0.10.6.0
- call-stack-0.1.0
- case-insensitive-1.2.0.8
- cereal-0.5.4.0
- clock-0.7.2
- comonad-5
- conduit-1.2.9
- conduit-extra-1.1.15
- connection-0.2.7
- constraints-0.9.1
- containers-0.5.6.2
- contravariant-1.4
- cookie-0.4.2.1
- cryptohash-0.11.9
- cryptohash-sha256-0.11.100.1
- cryptonite-0.19
- cryptonite-conduit-0.1
- data-default-class-0.1.2.0
- deepseq-1.4.1.1
- digest-0.0.1.2
- directory-1.2.2.0
- distributive-0.5.2
- dlist-0.8.0.2
- easy-file-0.2.1
- ed25519-0.0.5.0
- either-4.4.1.1
- errors-2.1.3
- exceptions-0.8.3
- extra-1.5.1
- fail-4.9.0.0
- fast-logger-2.4.10
- file-embed-0.0.10
- filelock-0.1.0.1
- filepath-1.4.0.0
- free-4.12.4
- fsnotify-0.2.1
- generic-deriving-1.11.1
- generics-sop-0.2.4.0
- ghc-prim-0.4.0.0
- gitrev-1.2.0
- hackage-security-0.5.2.2
- hashable-1.2.5.0
- hastache-0.6.1
- hit-0.6.3
- hourglass-0.2.10
- hpack-0.17.0
- hpc-0.6.0.2
- hspec-2.4.2
- hspec-core-2.4.2
- hspec-discover-2.4.2
- hspec-expectations-0.8.2
- hspec-smallcheck-0.4.2
- http-api-data-0.3.5
- http-client-0.5.6.1
- http-client-tls-0.3.4
- http-conduit-2.2.3.1
- http-types-0.9.1
- ieee754-0.8.0
- integer-gmp-1.0.0.0
- integer-logarithms-1.0.1
- lifted-async-0.9.1.1
- lifted-base-0.2.3.10
- logict-0.6.0.2
- memory-0.13
- microlens-0.4.8.0
- microlens-mtl-0.1.10.0
- microlens-th-0.4.1.1
- mime-types-0.1.0.7
- mmorph-1.0.9
- monad-control-1.0.1.0
- monad-logger-0.3.20.2
- monad-loops-0.4.3
- monad-unlift-0.2.0
- mono-traversable-1.0.2
- mtl-2.2.1
- nats-1.1.1
- network-2.6.2.1
- network-uri-2.6.1.0
- old-locale-1.0.0.7
- old-time-1.1.0.3
- open-browser-0.2.1.0
- optparse-applicative-0.13.2.0
- optparse-simple-0.0.3
- parsec-3.1.9
- path-0.5.12
- path-io-1.2.2
- path-pieces-0.2.1
- patience-0.1.1
- pem-0.2.2
- persistent-2.6.1
- persistent-sqlite-2.6.2
- persistent-template-2.5.2
- pid1-0.1.0.1
- prelude-extras-0.4.0.3
- pretty-1.1.2.0
- primitive-0.6.2.0
- process-1.2.3.0
- profunctors-5.2
- project-template-0.2.0
- quickcheck-io-0.1.4
- random-1.1
- regex-applicative-0.3.3
- regex-applicative-text-0.1.0.1
- resource-pool-0.2.3.2
- resourcet-1.1.9
- retry-0.7.4.2
- rts-1.0
- safe-0.3.14
- safe-exceptions-0.1.5.0
- scientific-0.3.4.10
- semigroupoids-5.1
- semigroups-0.18.2
- setenv-0.1.1.3
- silently-1.2.5
- smallcheck-1.1.1
- socks-0.5.5
- split-0.2.3.1
- stm-2.4.4
- stm-chans-3.0.0.4
- store-0.3.1
- store-core-0.3
- streaming-commons-0.1.17
- syb-0.7
- system-fileio-0.3.16.3
- system-filepath-0.4.13.4
- tagged-0.8.5
- tar-0.5.0.3
- template-haskell-2.10.0.0
- temporary-1.2.0.4
- text-1.2.1.3
- text-binary-0.2.1.1
- text-metrics-0.2.0
- tf-random-0.5
- th-expand-syns-0.4.2.0
- th-lift-0.7.6
- th-lift-instances-0.1.11
- th-orphans-0.13.3
- th-reify-many-0.1.6
- th-utilities-0.2.0.1
- time-1.5.0.1
- time-locale-compat-0.1.1.3
- tls-1.3.8
- transformers-0.4.2.0
- transformers-base-0.4.4
- transformers-compat-0.5.1.4
- unexceptionalio-0.3.0
- unicode-transforms-0.3.0
- unix-2.7.1.0
- unix-compat-0.4.3.1
- unix-time-0.3.7
- unordered-containers-0.2.7.2
- uri-bytestring-0.2.3.1
- utf8-string-1.0.1.1
- uuid-types-1.0.3
- vector-0.12.0.1
- vector-algorithms-0.7.0.1
- vector-binary-instances-0.2.3.4
- void-0.7.1
- x509-1.6.5
- x509-store-1.6.2
- x509-system-1.6.4
- x509-validation-1.6.5
- yaml-0.8.22
- zip-archive-0.3.0.5
- zlib-0.5.4.2
- zlib-bindings-0.1.1.5

$ pkg info stack                                                                                                                                                                 
stack-1.4.0_1
Name           : stack
Version        : 1.4.0_1
Installed on   : Mon Jun 26 23:28:40 2017 CEST
Origin         : devel/stack
Architecture   : FreeBSD:11:amd64
Prefix         : /usr/local
Categories     : haskell devel
Licenses       : BSD3CLAUSE
Maintainer     : tobik@FreeBSD.org
WWW            : http://www.haskellstack.org/
Comment        : Cross-platform program for developing Haskell programs
Shared Libs required:
        libgmp.so.10
        libcharset.so.1
        libiconv.so.2
        libffi.so.6
Annotations    :
Flat size      : 52.2MiB
Description    :
Stack is a cross-platform program for developing Haskell projects.
It is aimed at Haskellers both new and experienced. 

WWW: http://www.haskellstack.org/
alios commented 7 years ago

Oh i noticed I also get this kind of linker problem when trying to install X11 (which tries to bind native x11 libaries)

stack install xmonad                                                                                                                                                
X11-1.8: configure
Package X11 uses a custom Cabal build, but does not use a custom-setup stanza
Not using the explicit setup deps approach based on configuration
Strongly recommend fixing the package's cabal file
X11-1.8: build
Package X11 uses a custom Cabal build, but does not use a custom-setup stanza
Not using the explicit setup deps approach based on configuration
Strongly recommend fixing the package's cabal file
Progress: 1/2
--  While building package X11-1.8 using:
      /tmp/stack38817/X11-1.8/.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /usr/home/alios/dot_files/.stack/global-project/.stack-work/logs/X11-1.8.log

    [1 of 2] Compiling Main             ( /tmp/stack38817/X11-1.8/Setup.hs, /tmp/stack38817/X11-1.8/.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/setup/Main.o )

    /tmp/stack38817/X11-1.8/Setup.hs:6:29: warning: [-Wdeprecations]
        In the use of ‘defaultUserHooks’
        (imported from Distribution.Simple):
        Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
                 compatibility in which case you must stick with defaultUserHooks"
    [2 of 2] Compiling StackSetupShim   ( /usr/home/alios/dot_files/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /tmp/stack38817/X11-1.8/.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/setup/StackSetupShim.o )
    Linking /tmp/stack38817/X11-1.8/.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/setup/setup ...
    Warning: defaultUserHooks in Setup script is deprecated.
    Configuring X11-1.8...
    configure: WARNING: unrecognized options: --with-hc
    checking for gcc... /usr/bin/clang
    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/clang accepts -g... yes
    checking for /usr/bin/clang option to accept ISO C89... none needed
    checking how to run the C preprocessor... /usr/bin/clang -E
    checking for X... libraries /usr/local/lib, headers /usr/local/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 whether to build XScreenSaver... 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-hc
    Building X11-1.8...
    Preprocessing library X11-1.8...
    XF86.hsc:711:27: warning: extra tokens at end of #ifdef directive [-Wextra-tokens]
    #ifdef XF86XK_AudioForward,
                              ^
                              //
    XF86.hsc:711:27: warning: extra tokens at end of #ifdef directive [-Wextra-tokens]
    #ifdef XF86XK_AudioForward,
                              ^
                              //
    XF86.hsc:711:27: warning: extra tokens at end of #ifdef directive [-Wextra-tokens]
    #ifdef XF86XK_AudioForward,
                              ^
                              //
    3 warnings generated.
    [ 1 of 28] Compiling Graphics.X11.Xlib.Internal ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Internal.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Internal.o )
    [ 2 of 28] Compiling Graphics.X11.Types ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Types.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Types.o )
    [ 3 of 28] Compiling Graphics.X11.Xlib.Types ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Types.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Types.o )
    [ 4 of 28] Compiling Graphics.X11.Xlib.Atom ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Atom.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Atom.o )
    [ 5 of 28] Compiling Graphics.X11.Xlib.Color ( Graphics/X11/Xlib/Color.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Color.o )
    [ 6 of 28] Compiling Graphics.X11.Xlib.Context ( Graphics/X11/Xlib/Context.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Context.o )
    [ 7 of 28] Compiling Graphics.X11.Xlib.Display ( Graphics/X11/Xlib/Display.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Display.o )
    [ 8 of 28] Compiling Graphics.X11.Xlib.Event ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Event.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Event.o )
    [ 9 of 28] Compiling Graphics.X11.Xlib.Font ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Font.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Font.o )
    [10 of 28] Compiling Graphics.X11.Xlib.Cursor ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Cursor.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Cursor.o )
    [11 of 28] Compiling Graphics.X11.Xlib.Image ( Graphics/X11/Xlib/Image.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Image.o )
    [12 of 28] Compiling Graphics.X11.Xlib.Misc ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Misc.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Misc.o )
    [13 of 28] Compiling Graphics.X11.Xlib.Region ( Graphics/X11/Xlib/Region.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Region.o )
    [14 of 28] Compiling Graphics.X11.Xlib.Screen ( Graphics/X11/Xlib/Screen.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Screen.o )
    [15 of 28] Compiling Graphics.X11.Xlib.Window ( Graphics/X11/Xlib/Window.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Window.o )
    [16 of 28] Compiling Graphics.X11.Xlib ( Graphics/X11/Xlib.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib.o )
    [17 of 28] Compiling Graphics.X11.XScreenSaver ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/XScreenSaver.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/XScreenSaver.o )
    [18 of 28] Compiling Graphics.X11.Xrandr ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xrandr.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xrandr.o )
    [19 of 28] Compiling Graphics.X11.Xlib.Extras ( .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Extras.hs, .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Graphics/X11/Xlib/Extras.o )
    /usr/bin/ld: unrecognized option '--build-id=none'
    /usr/bin/ld: use the --help option for usage information
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    `clang' failed in phase `Linker'. (Exit code: 1)
alios commented 7 years ago

It turned out, that upgradeing to the stable/11 branch of FreeBSD seems to fix this issue (wich I experienced on binary release FreeBSD 11.0-RELEASE-p9)... One of the biggest changes (which might be the reason that is fixed there) might be the update to llvm-4.0 on amd64.

alios commented 7 years ago

from most recent FreeBSD commit there is an explaination in the git comments:

commit 6b6fbf7beeb9122b2a33dc9bde987bca593bfb15
Author: emaste <emaste@FreeBSD.org>
Date:   Wed Jul 19 03:19:44 2017 +0000

    MFC r320235: retire arm64 kernel module linker workaround

    Relocatable linking in aarch64 ld from binutils 2.25.1 does not work.
    The linker corrupts the references to the external symbols which are
    defined by other object in the linking set and should therefore lose
    the GOT entry.

    The problem is fixed in later versions of GNU ld and does not exist in
    the in-tree lld linker that we now use by default for arm64, so the
    workaround can be removed.

    Sponsored by:   The FreeBSD Foundation

It seems that there was an linker problem in early versions of FreeBSD 11 on amd64. It has been fixed by replacing the old gnu ld. (the reason why it works with more recent FreeBSD 11 versions.

So it was not really a stack issue and this ticket can be closed.