GHC 8.2.1-rc2 source tarball availability

Karel Gardas karel.gardas at centrum.cz
Sun May 14 21:11:07 UTC 2017


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=<path>; 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:
         Start            End              Type Open Ref GrpRef Name
         00001116e2700000 00001116e29e7000 exe  2    0   0      HelloWorld
         00001119d555b000 00001119d585a000 rlib 0    1   0 
/usr/local/lib/libiconv.so.6.0
         00001119b2138000 00001119b23af000 rlib 0    1   0 
/usr/local/lib/libgmp.so.10.0
         000011195fd4e000 000011195ff75000 rlib 0    1   0 
/usr/lib/libm.so.10.0
         000011197e36b000 000011197e573000 rlib 0    1   0 
/usr/local/lib/libffi.so.1.2
         0000111950004000 0000111950213000 rlib 0    2   0 
/usr/lib/libpthread.so.23.0
         00001119addd3000 00001119ae09e000 rlib 0    1   0 
/usr/lib/libc.so.89.4
         0000111980e00000 0000111980e00000 rtld 0    1   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



More information about the ghc-devs mailing list