On 05/ 8/17 10:58 PM, Ben Gamari wrote:
Note that in addition to the usual complement of Linux/Windows/Darwin
bindists, I have also produced a FreeBSD distribution this time around.
I've noticed that as my tools for producing these distributions improves
the marginal cost of producing another distribution is shrinking. I
would be happy to add OpenBSD as well, but first we'll need to nail
#10032, as far as I understand.
Hi Ben,
the situation on OpenBSD is a little bit lucky than on Solaris since I'm
not sure if this helps, but "system" libffi is in fact installed into
/usr/local from ports and there is no other libffi on OpenBSD and this
by probably lucky coincidence makes GHC working with the only quirk
which is GNU tar complaining about missing header files while making
binary-dist:
"rm" -f bindistprep/ghc-8.2.0.20170507-x86_64-unknown-openbsd.tar
cd bindistprep && "/usr/local/bin/gtar" hcf - -T ../bindist-list |
/usr/local/bin/xz -c >
../bindistprep/ghc-8.2.0.20170507-x86_64-unknown-openbsd.tar.xz
/usr/local/bin/gtar: ghc-8.2.0.20170507/rts/dist/build/ffi.h: Cannot
stat: No such file or directory
/usr/local/bin/gtar: ghc-8.2.0.20170507/rts/dist/build/ffitarget.h:
Cannot stat: No such file or directory
/usr/local/bin/gtar: Exiting with failure status due to previous errors
mv bindistprep/*.tar.xz .
anyway, tarbal is generated, it unpacks well, it even install well (with
just ./configure --prefix=; gmake install) and resulting compiler
is working and linked libffi is where it should be:
$ ghc --make HelloWorld.lhs
[1 of 1] Compiling Main ( HelloWorld.lhs, HelloWorld.o )
Linking HelloWorld ...
/usr/local/build/karel/ghc-8.2.1-rc2/lib/ghc-8.2.0.20170507/rts/libHSrts.a(RtsFlags.o):
In function `copyArg':
rts/RtsFlags.c:1912:0: error:
warning: warning: strcpy() is almost always misused, please use
strlcpy()
/usr/local/lib/libgmp.so.10.0: warning: warning: vsprintf() is often
misused, please use vsnprintf()
/usr/local/build/karel/ghc-8.2.1-rc2/lib/ghc-8.2.0.20170507/rts/libHSrts.a(RtsUtils.o):
In function `showStgWord64':
rts/RtsUtils.c:220:0: error:
warning: warning: sprintf() is often misused, please use snprintf()
$ ldd HelloWorld
HelloWorld:
StartEnd Type Open Ref GrpRef Name
1116e270 1116e29e7000 exe 20 0 HelloWorld
1119d555b000 1119d585a000 rlib 01 0
/usr/local/lib/libiconv.so.6.0
1119b2138000 1119b23af000 rlib 01 0
/usr/local/lib/libgmp.so.10.0
11195fd4e000 11195ff75000 rlib 01 0
/usr/lib/libm.so.10.0
11197e36b000 11197e573000 rlib 01 0
/usr/local/lib/libffi.so.1.2
111950004000 111950213000 rlib 02 0
/usr/lib/libpthread.so.23.0
1119addd3000 1119ae09e000 rlib 01 0
/usr/lib/libc.so.89.4
111980e0 111980e0 rtld 01 0
/usr/libexec/ld.so
$ ./HelloWorld
Hello world!$
so if you like you can give it a try on your OpenBSD. If you are using
latest 6.1 please make sure you build and test on wxallowed mount:
$ pwd
/usr/local/build/karel/ghc-8.2.0.20170507
$ mount
/dev/sd1a on / type ffs (local)
/dev/sd1d on /usr/local type ffs (local, nodev, wxallowed)
otherwise you would get strange "No permission error" while executing
any GHC generated executable including tests run by ./configure. I.e.
OpenBSD starts to be more picky about programs which execute code from
writeable memory page and such security sinners need to be run from
wxallowed paths only. Matthias Killian (cced) has done some work on GHC
to fix that but IIRC he hit the wall somewhere in rts (IIRC) so nothing
from this yet.
Thanks,
Karel
___
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs