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

configure.ac has two operating systems hard-coded, posix-clocks-foo.scm related? #72

Closed
gdt opened this issue Nov 23, 2022 · 4 comments
Closed

Comments

@gdt
Copy link

gdt commented Nov 23, 2022

Trying to build/test #53 on NetBSD, I got an error:

gmake: *** No rule to make target 'fibers/posix-clocks-.scm', needed by 'fibers/posix-clocks.scm'.  Stop.

because of Makefile's

fibers/posix-clocks.scm: Makefile fibers/posix-clocks-$(PLATFORM).scm
        ln -sf $(abs_top_srcdir)/fibers/posix-clocks-$(PLATFORM).scm $(abs_top_builddir)/fibers/posix-clocks.scm

I then found in configure.ac:

# Detect the target system                                                                                                                                                    
case "$host_os" in
    linux*)
        build_linux=yes
        PLATFORM=linux
        ;;
    darwin*)
        build_darwin=yes
        PLATFORM=darwin
        ;;
esac

I don't understand why this exists; I'm guessing that despite posix-clocks-foo starting with posix, it might use beyond-posix features? I would hope that we can end up with a build that works on pretty much any modern posixy system without per-platform code, but it looks like this is ffi glue code and needs to know types (which are left unspecified by posix).

@gdt gdt changed the title configure.ac has two operating systems hard-coded configure.ac has two operating systems hard-coded, posix-clocks-foo.scm related? Nov 23, 2022
@gdt
Copy link
Author

gdt commented Nov 23, 2022

In posix-clocks-common, (define clockid-t int32) but clockid_t on NetBSD is int, as far as I can tell from headers. My impression is that POSIX tends to require these types to be "an integral type". On most CPU architectures, that works out to be the same, but e.g. alpha is ILP64. This is just an aside; I don't think it's causing the affinity trouble.

/usr/include/sys/types.h:typedef        _BSD_CLOCKID_T_         clockid_t;
/usr/include/sys/common_ansi.h:#define  _BSD_CLOCKID_T_         int             /* clockid_t */

@gdt
Copy link
Author

gdt commented Nov 23, 2022

posix-clocks-common.scm analysis:

                NetBSD          fibers
clockid_t       int             int32
time_t          int64_t         long
pid_t           int32_t         int
pthread_t       void*           unsigned long
s_timespec      time_t/long     time_t/long

NetBSD pthread_t is really a pointer to struct.

@aconchillo
Copy link
Collaborator

@gdt I believe we should be OK closing this issue now, right?

@gdt
Copy link
Author

gdt commented Dec 24, 2022

I think it's ok, and things have certainly changed. So I will hit close and start over if I find anything else. Thanks for all the fixes

@gdt gdt closed this as completed Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants