Closed alios closed 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)
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.
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.
General summary/comments
Trying to install
cabal-install
in global project or do astack upgrade --git
fails on FreeBSD (11.0-RELEASE-p9).Steps to reproduce
devel/stack
(1.4.0_1 in my case) from ports.stack/global-project/stack.yaml
to use lts-8.19 for global projectstack setup
(will install ghc-8.0.2)$HOME/.local/bin
into pathstack install cabal-install
orstack upgrade --git
both will try to installhackage-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 version