Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 Apr 2018 01:54:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 227382] Can't use devel/stack to build statically
Message-ID:  <bug-227382-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227382

            Bug ID: 227382
           Summary: Can't use devel/stack to build statically
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: darius@dons.net.au

I'm trying to build https://github.com/erebe/wstunnel statically like so..
stack install --ghc-options=3D'-optl-static' --system-ghc

However it complains it can't find various libraries, eg..
[vm11 1:35] ~/wstunnel >stack install --ghc-options=3D'-optl-static' --syst=
em-ghc
wstunnel-0.1.0.0: build (lib + exe)
Preprocessing library wstunnel-0.1.0.0...
/usr/bin/ld: cannot find -lHSwebsockets-0.10.0.0-VnlKayMDvyHnd2tkINzmP-ghc8=
.0.2
cc: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)

--  While building package wstunnel-0.1.0.0 using:
=20=20=20=20
/usr/home/darius/.stack/setup-exe-cache/x86_64-freebsd/Cabal-simple_mPHDZzA=
J_1.24.2.0_ghc-8.0.2
--builddir=3D.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0 build lib:wstun=
nel
exe:wstunnel --ghc-options " -ddump-hi -ddump-to-file"
   Process exited with code: ExitFailure 1

The library is at
/home/darius/.stack/snapshots/x86_64-freebsd/lts-9.9/8.0.2/lib/x86_64-freeb=
sd-ghc-8.0.2/websockets-0.10.0.0-VnlKayMDvyHnd2tkINzmP/libHSwebsockets-0.10=
.0.0-VnlKayMDvyHnd2tkINzmP-ghc8.0.2.a

but that isn't in the search path. I note that
/home/darius/.stack/snapshots/x86_64-freebsd/lts-9.9/8.0.2/lib/x86_64-freeb=
sd-ghc-8.0.2/libHSwebsockets-0.10.0.0-VnlKayMDvyHnd2tkINzmP-ghc8.0.2.so
is present though so I tried symlinking
/home/darius/.stack/snapshots/x86_64-freebsd/lts-9.9/8.0.2/lib/x86_64-freeb=
sd-ghc-8.0.2/websockets-0.10.0.0-VnlKayMDvyHnd2tkINzmP/libHSwebsockets-0.10=
.0.0-VnlKayMDvyHnd2tkINzmP.a
into that directory as
libHSwebsockets-0.10.0.0-VnlKayMDvyHnd2tkINzmP-ghc8.0.2.a (and a bunch of
others plus ones under /usr/local/lib/ghc-8.0.2).

That got me further but then I ended up seeing a heap of undefined reference
errors, eg..
2018-04-09 01:40:02.967973: [info] wstunnel-0.1.0.0: build (lib + exe)
@(Stack/Build/Execute.hs:830:23)
2018-04-09 01:40:02.968352: [debug] Run process:
/usr/home/darius/.stack/setup-exe-cache/x86_64-freebsd/Cabal-simple_mPHDZzA=
J_1.24.2.0_ghc-8.0.2
--builddir=3D.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0 build lib:wstun=
nel
exe:wstunnel --ghc-options " -ddump-hi -ddump-to-file"
@(System/Process/Read.hs:306:3)
2018-04-09 01:40:03.086921: [info] Preprocessing library wstunnel-0.1.0.0...
@(Stack/Build/Execute.hs:1096:67)
2018-04-09 01:40:05.253730: [warn] /usr/bin/ld: warning: cannot find entry
symbol _start; defaulting to 0000000000400180
@(Stack/Build/Execute.hs:1096:67)
2018-04-09 01:40:05.276500: [warn]
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Tunnel.dyn_o: In funct=
ion
`r1boV_info':
@(Stack/Build/Execute.hs:1096:67)
2018-04-09 01:40:05.276617: [warn] (.text+0x61): undefined reference to
`newCAF'
@(Stack/Build/Execute.hs:1096:67)
2018-04-09 01:40:05.276709: [warn]
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Tunnel.dyn_o: In funct=
ion
`r1boV_info':
@(Stack/Build/Execute.hs:1096:67)
2018-04-09 01:40:05.276848: [warn] (.text+0x71): undefined reference to
`stg_bh_upd_frame_info'
@(Stack/Build/Execute.hs:1096:67)
2018-04-09 01:40:05.276969: [warn]
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Tunnel.dyn_o: In funct=
ion
`c1fNY_info':
@(Stack/Build/Execute.hs:1096:67)
2018-04-09 01:40:05.277063: [warn] (.text+0x11c): undefined reference to
`stg_ap_0_fast'
@(Stack/Build/Execute.hs:1096:67)

etc etc..
Running with -v shows..
/usr/bin/ar -r
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/objs-40035/libHSwstunn=
el-0.1.0.0-AW3X1jAtS7XCeg7CJRwMWe.a
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Tunnel.o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Protocols.o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Types.o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Logger.o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Socks5.o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Credentials.o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/HttpProxy.o
ar: warning: creating
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/objs-40035/libHSwstunn=
el-0.1.0.0-AW3X1jAtS7XCeg7CJRwMWe.a
/usr/local/bin/ghc -shared -dynamic '-dynload deploy'
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/array-0.5.1.1
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/base-4.9.1.0
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/binary-0.8.3.0
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/bytestring-0.10.8.1
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/containers-0.5.7.1
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/deepseq-1.4.2.0
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/directory-1.3.0.0
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/filepath-1.4.1.1
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/ghc-boot-th-8.0.2
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/ghc-prim-0.5.0.0
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/integer-gmp-1.0.0.1
-optl-Wl,-rpath,/usr/local/lib
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/pretty-1.1.3.3
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/process-1.4.3.0
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/rts
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/template-haskell-2.11.1.0
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/time-1.6.0.1
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/transformers-0.5.2.0
-optl-Wl,-rpath,/usr/local/lib/ghc-8.0.2/unix-2.7.2.1
-optl-Wl,-rpath,/usr/home/darius/.stack/snapshots/x86_64-freebsd/lts-9.9/8.=
0.2/lib/x86_64-freebsd-ghc-8.0.2
-hide-all-packages -no-auto-link-packages -no-user-package-db -package-db
/usr/home/darius/.stack/snapshots/x86_64-freebsd/lts-9.9/8.0.2/pkgdb
-package-db
/usr/home/darius/wstunnel/.stack-work/install/x86_64-freebsd/lts-9.9/8.0.2/=
pkgdb
-package-db .stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/package.conf.inp=
lace
-package-id async-2.1.1.1-8yywY4inVGRLJSCg60gBXj -package-id base-4.9.1.0
-package-id base64-bytestring-1.0.0.1-4O9TExPPz6eI82Yj7L4SIj -package-id
binary-0.8.3.0 -package-id bytestring-0.10.8.1 -package-id
classy-prelude-1.2.0.1-DI7QyZr6dYQLSGY5Zda29N -package-id
connection-0.2.8-BxEaNY3oDHHAFXlQHNmyac -package-id
hslogger-1.2.10-Li6ZV5C1ftGLPA71zPNMlf -package-id
mtl-2.2.1-BLKBelFsPB3BoFeSWSOYj6 -package-id
network-2.6.3.2-IsLM4TXcLoRI0fmmBYVyQz -package-id
network-conduit-tls-1.2.2-Fk5CYGzzcFcSIVqij7Uvk -package-id
streaming-commons-0.1.17-6xuIA5RXrs65yyeq3HWIWP -package-id
text-1.2.2.2-9UQZjEJZQFSGMffj1Z5g00 -package-id
unordered-containers-0.2.8.0-Bp9XgxjuHxcI4tFehVMDGC -package-id
websockets-0.10.0.0-VnlKayMDvyHnd2tkINzmP
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Tunnel.dyn_o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Protocols.dyn_o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Types.dyn_o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Logger.dyn_o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Socks5.dyn_o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Credentials.dyn_o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/HttpProxy.dyn_o -o
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/libHSwstunnel-0.1.0.0-=
AW3X1jAtS7XCeg7CJRwMWe-ghc8.0.2.so
-optl-static -ddump-hi -ddump-to-file
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to
0000000000400180
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Tunnel.dyn_o: In funct=
ion
`r1boV_info':
(.text+0x61): undefined reference to `newCAF'
.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/build/Tunnel.dyn_o: In funct=
ion
`r1boV_info':
(.text+0x71): undefined reference to `stg_bh_upd_frame_info'

But unfortunately I have zero Haskell clue so I'm not sure what's missing.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227382-7788>