Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing OpenBSD support #375

Closed
jpellegrini opened this issue May 12, 2022 · 6 comments · Fixed by #376
Closed

Missing OpenBSD support #375

jpellegrini opened this issue May 12, 2022 · 6 comments · Fixed by #376

Comments

@jpellegrini
Copy link
Contributor

jpellegrini commented May 12, 2022

@egallesio -- this is fixed by PR #376

When compiling under OpenBSD, the .so files for SRFIs are not generated.

openbsd$ ls -l lib/srfi/*.so
ls: lib/srfi/*.so: No such file or directory

This is what I did to compile for OpenBSD:

$ export AUTOMAKE_VERSION=1.16
$ export AUTOCONF_VERSION=2.69
$ autoreconf
$ ./configure CFLAGS="-g -Wall -O2" CC=egcc
$ gmake
# gmake install
$ gmake test
@jpellegrini
Copy link
Contributor Author

Ah. The $(SO) variable is being translated into the empty string on OpenBSD! This is the cause of the problem:

egcc -g -Wall -O2   -I../../src -I/usr/local/include  -c -o 132.o 132.c
:   132. 132.o 
../../utils/tmpcomp -o 95.ostk 95.stk
egcc -g -Wall -O2   -I../../src -I/usr/local/include  -c -o 25.o 25.c
:   25. 25.o 

@jpellegrini
Copy link
Contributor Author

Same seems to happen with clang.

@jpellegrini
Copy link
Contributor Author

It's ld not being called?

In Linux:

../../utils/tmpcomp -C -o 25-incl.c 25.stk
gcc -g -O0 -Wall  -fpic -nostdlib -I../../src   -c -o 25.o 25.c
ld -shared -o  25.so 25.o 

OpenBSD:

../../utils/tmpcomp -C -o 25-incl.c 25.stk
clang -g -Wall -O2   -I../../src -I/usr/local/include -I../../gmp -c -o 25.o 25.c
:   25. 25.o 

@jpellegrini
Copy link
Contributor Author

Yes.
In srfi/Makefile,

Linux:

SH_LIB_SUFFIX = so
SH_LOADER = ld
SH_LOAD_FLAGS = -shared -o
SH_MAIN_LOAD_FLAGS = -rdynamic
SH_SUFFIX = so

OpenBSD:

SH_LIB_SUFFIX =
SH_LOADER = :
SH_LOAD_FLAGS =
SH_MAIN_LOAD_FLAGS =
SH_SUFFIX =

Interesting - FreeBSD correctly sets the variables. And loads SRFIs 25, 132 etc without problems.

@jpellegrini
Copy link
Contributor Author

I got STklos to compile and pass all tests in OpenBSD (the problem was just that OpenBSD was missing in utils/shlib-options; I'll include this in the OpenBSD PR (#376 )

@jpellegrini jpellegrini changed the title OpenBSD: shared objects not being produced Missing OpenBSD support May 13, 2022
@jpellegrini
Copy link
Contributor Author

PR #376 now adds support for OpenBSD. For STklos to run ok on OpenBSD only one thingis missing: SRFI 144 (see #374 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant