compiling 6.12 on OpenBSD

58 views
Skip to first unread message

je...@lisp.sh

unread,
Jan 28, 2018, 2:43:34 AM1/28/18
to Racket Developers
I'd like to use Racket on OpenBSD, but I'm having trouble getting it to compile. I'm working with a stock OpenBSD 6.2 and Racket version 6.12, but the compilation error I've found can be reproduced on several other earlier versions (I tried going back to 6.5). The error arises both with clang and with gcc. I'm working with racket-6.12-src-builtpkgs.tgz (not racket-6.12-src.tgz). The error happens like this:

$ mkdir build
$ cd build
$ ../configure --prefix=/usr/local
[omitting configure output]
$ make
[ omitting lots of output, including some warnings]
ranlib libracket.a
make racketcgc
gcc -I. -I../../racket/include -Wall    -g -O2  -pthread -I/usr/local/include  -DUSE_SENORA_GC  -DINITIAL_COLLECTS_DIRECTORY='"'"`cd ../../racket/../../collects; pwd`"'"' -DINITIAL_CONFIG_DIRECTORY='"'"`cd ../../racket/../..; pwd`/etc"'"' -c ../../racket/main.c -o main.o
gcc -o racketcgc main.o  libracket.a libmzgc.a ../rktio/librktio.a  -pthread -lm  -Wl,--export-dynamic -L/usr/local/lib -pthread -lffi
libracket.a(error.o): In function `make_arity_expect_string':
../../../racket/src/error.c:1432: warning: warning: strcpy() is almost always misused, please use strlcpy()
libracket.a(env.o): In function `local_context':
../../../racket/src/env.c:2429: warning: warning: sprintf() is often misused, please use snprintf()
make mzcomcgc
:
make sysinfercgc
./racketcgc -cqu ../../racket/mksystem.rkt system.rktd "gcc -E -I. -I../../racket/include -I../../racket/src -g -O2  -pthread -I/usr/local/include  -DUSE_SENORA_GC    ../../racket/src/systype.c" "" "./racketcgc" "./racketcgc"
*** Signal SIGSEGV in racket (Makefile:171 'sysinfercgc')
*** Error 1 in racket (Makefile:93 'cgc')
*** Error 1 in racket (Makefile:103 '3m')
*** Error 1 in . (Makefile:58 '3m')
*** Error 1 in /home/vagrant/src/racket/racket-6.12/src/build (Makefile:51 'all')

I can give more output, such as the warnings alluded to above. But before going into detail, I thought I'd ask a more basic question: is OpenBSD on the radar as one of the OSs to support? If not, that's fine (for me, anyway); I'll stop trying to get it to work. But if supporting OpenBSD is intended, then perhaps we can dig into this problem.

(For what it's worth, I've also tried using the latest Racket 7 on OpenBSD, to no avail; the error message is, understandably, different and occurs at a different place.)

Thanks,

Jesse

Philippe Meunier

unread,
Jan 28, 2018, 7:38:15 AM1/28/18
to je...@lisp.sh, Racket Developers
je...@lisp.sh wrote:
>./racketcgc -cqu ../../racket/mksystem.rkt system.rktd "gcc -E -I.
>-I../../racket/include -I../../racket/src -g -O2 -pthread
>-I/usr/local/include -DUSE_SENORA_GC ../../racket/src/systype.c" ""
>"./racketcgc" "./racketcgc"
>*** Signal SIGSEGV in racket (Makefile:171 'sysinfercgc')

Yes, and you got an "mmap W^X violation" message in /var/log/messages at
the same time. See for example
https://www.mail-archive.com/racket...@googlegroups.com/msg32361.html
for the reason.

So you need to do:

$ doas mount -u -o wxallowed /the-filesystem-where-you-are-doing-the-build

then:

$ mkdir build
$ cd build
$ LDFLAGS="-Wl,-z,wxneeded" ../configure plus-whatever-options-you-want
[...]
$ make
[...]
$ make install

You might also want to increase datasize-max and datasize-cur (and create
memoryuse) for "default" in /etc/login.conf to at least a gigabyte. The
default value is 512MB, which may be enough when building starting from the
tar ball (I haven't tried) but becomes a problem if you try to build the
whole thing yourself (the documentation, in particular) starting from
github.com.

Note also that there is a racket package available on OpenBSD, so you could
just try:

$ doas pkg_add racket-minimal

(assuming you have already defined a mirror server location in
/etc/installurl or in your PKG_PATH environment variable). I don't know
whether 'racket-minimal' is the same as what's in the tar ball or not.

Philippe


je...@lisp.sh

unread,
Jan 28, 2018, 7:54:54 AM1/28/18
to Racket Developers
On Sunday, January 28, 2018 at 1:38:15 PM UTC+1, Philippe Meunier wrote:

Note also that there is a racket package available on OpenBSD, so you could
just try:

$ doas pkg_add racket-minimal

(assuming you have already defined a mirror server location in
/etc/installurl or in your PKG_PATH environment variable).  I don't know
whether 'racket-minimal' is the same as what's in the tar ball or not.

Thanks! Embarrassingly, I didn't think to search for "racket-minimal". I assumed, after a failed search for (exactly) "racket" that there was no Racket available at all. Compiling it from scratch isn't needed; the version available (6.10) suits my needs.

Juan Francisco Cantero Hurtado

unread,
Jan 30, 2018, 5:33:40 AM1/30/18
to racke...@googlegroups.com
When you want to search a package in the official repos, use "pkg_info
-Q something".

Don't forget to read the readme included with racket-minimal
(/usr/local/share/doc/pkg-readmes/).


--
Juan Francisco Cantero Hurtado http://juanfra.info

Reply all
Reply to author
Forward
0 new messages