NetBSD 10.1 evbarm (RPI) - unable to compile eventmachine-1.2.7 · Issue #1014 · eventmachine/eventmachine · GitHub
Skip to content

NetBSD 10.1 evbarm (RPI) - unable to compile eventmachine-1.2.7 #1014

Open

Description

@drixter

Hello Team,

Below the result to compile eventmachine-1.2.7 on NetBSD 10.1 evbarm (RPI)
It's faling, any hint to check something more?

gem32 install jekyll bundler eventmachine

[NetBSD-drixter@heaven:~]$ gcc --version
gcc (nb3 20231008) 10.5.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[NetBSD-drixter@heaven:~]$ gem32 --version
3.4.19
[NetBSD-drixter@heaven:~]$ ruby32 --version
ruby 3.2.6 (2024-10-30 revision 63aeb018eb) [aarch64-netbsd]
current directory: /home/users/drixter/gems/gems/eventmachine-1.2.7/ext
/usr/pkg/bin/ruby32 extconf.rb
checking for -lcrypto... yes
checking for -lssl... yes
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for pipe2() in unistd.h... yes
checking for accept4() in sys/socket.h... yes
checking for SOCK_CLOEXEC in sys/socket.h... yes
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for clock_gettime()... yes
checking for CLOCK_MONOTONIC_RAW in time.h... no
checking for CLOCK_MONOTONIC in time.h... yes
CXXFLAGS=-O2 -pthread -I/usr/pkg/include -I/usr/include -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-result -Wno-address
creating Makefile

current directory: /home/users/drixter/gems/gems/eventmachine-1.2.7/ext
make DESTDIR\= sitearchdir\=./.gem.20250113-9327-mavuer sitelibdir\=./.gem.20250113-9327-mavuer clean

current directory: /home/users/drixter/gems/gems/eventmachine-1.2.7/ext
make DESTDIR\= sitearchdir\=./.gem.20250113-9327-mavuer sitelibdir\=./.gem.20250113-9327-mavuer
compiling binder.cpp
compiling cmain.cpp
compiling ed.cpp
compiling em.cpp
In file included from /usr/include/wchar.h:61,
                 from /usr/include/g++/cwchar:44,
                 from /usr/include/g++/bits/postypes.h:40,
                 from /usr/include/g++/iosfwd:40,
                 from /usr/include/g++/ios:38,
                 from /usr/include/g++/ostream:38,
                 from /usr/include/g++/iostream:39,
                 from project.h:25,
                 from em.cpp:23:
em.cpp: In member function 'int EventMachine_t::DetachFD(EventableDescriptor*)':
em.cpp:1511:3: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
 1511 |   EV_SET (&k, ed->GetSocket(), EVFILT_READ | EVFILT_WRITE, EV_DELETE, 0, 0, (intptr_t)ed);
      |   ^~~~~~
em.cpp: In member function 'void EventMachine_t::ArmKqueueWriter(EventableDescriptor*)':
em.cpp:1707:3: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
 1707 |   EV_SET (&k, ed->GetSocket(), EVFILT_WRITE, EV_ADD | EV_ONESHOT, 0, 0, (intptr_t)ed);
      |   ^~~~~~
em.cpp: In member function 'void EventMachine_t::ArmKqueueReader(EventableDescriptor*)':
em.cpp:1735:3: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
 1735 |   EV_SET (&k, ed->GetSocket(), EVFILT_READ, EV_ADD, 0, 0, (intptr_t)ed);
      |   ^~~~~~
*** Error code 1

Stop.
make: stopped in /home/users/drixter/gems/gems/eventmachine-1.2.7/ext

make failed, exit code 1

Activity

  1. changed the title [-]NetBSD 10.1 evbarm (RPI) - uname to compile eventmachine-1.2.7[/-] [+]NetBSD 10.1 evbarm (RPI) - unable to compile eventmachine-1.2.7[/+] on Jan 13, 2025
  2. drixter commented on Jan 13, 2025

    @drixter
    Author

    OK, I've found that there is a patch for that in pkgsrc repository, maybe it's worth to implement it to upstream code:

    $NetBSD: patch-ext_em.cpp,v 1.1 2019/10/08 14:06:43 ryoon Exp $
    
    * Fix build with recent NetBSD 9.99
    
    --- ext/em.cpp.orig     2019-10-08 05:16:57.314742512 +0000
    +++ ext/em.cpp
    @@ -20,6 +20,10 @@ See the file COPYING for complete licens
     // THIS ENTIRE FILE WILL EVENTUALLY BE FOR UNIX BUILDS ONLY.
     //#ifdef OS_UNIX
    
    +#if defined(__NetBSD__)
    +#include <sys/param.h>
    +#endif
    +
     #include "project.h"
    
     /* The numer of max outstanding timers was once a const enum defined in em.h.
    @@ -1507,7 +1511,7 @@ int EventMachine_t::DetachFD (EventableD
            if (Poller == Poller_Kqueue) {
                    // remove any read/write events for this fd
                    struct kevent k;
    -#ifdef __NetBSD__
    +#if defined(__NetBSD__) && __NetBSD_Version__ < 999001500
                    EV_SET (&k, ed->GetSocket(), EVFILT_READ | EVFILT_WRITE, EV_DELETE, 0, 0, (intptr_t)ed);
     #else
                    EV_SET (&k, ed->GetSocket(), EVFILT_READ | EVFILT_WRITE, EV_DELETE, 0, 0, ed);
    @@ -1703,7 +1707,7 @@ void EventMachine_t::ArmKqueueWriter (Ev
                    if (!ed)
                            throw std::runtime_error ("added bad descriptor");
                    struct kevent k;
    -#ifdef __NetBSD__
    +#if defined(__NetBSD__) && __NetBSD_Version__ < 999001500
                    EV_SET (&k, ed->GetSocket(), EVFILT_WRITE, EV_ADD | EV_ONESHOT, 0, 0, (intptr_t)ed);
     #else
                    EV_SET (&k, ed->GetSocket(), EVFILT_WRITE, EV_ADD | EV_ONESHOT, 0, 0, ed);
    @@ -1731,7 +1735,7 @@ void EventMachine_t::ArmKqueueReader (Ev
                    if (!ed)
                            throw std::runtime_error ("added bad descriptor");
                    struct kevent k;
    -#ifdef __NetBSD__
    +#if defined(__NetBSD__) && __NetBSD_Version__ < 999001500
                    EV_SET (&k, ed->GetSocket(), EVFILT_READ, EV_ADD, 0, 0, (intptr_t)ed);
     #else
                    EV_SET (&k, ed->GetSocket(), EVFILT_READ, EV_ADD, 0, 0, ed);
    @@ -1788,7 +1792,7 @@ void EventMachine_t::_AddNewDescriptors(
                            // INCOMPLETE. Some descriptors don't want to be readable.
                            assert (kqfd != -1);
                            struct kevent k;
    -#ifdef __NetBSD__
    +#if defined(__NetBSD__) && __NetBSD_Version__ < 999001500
                            EV_SET (&k, ed->GetSocket(), EVFILT_READ, EV_ADD, 0, 0, (intptr_t)ed);
     #else
                            EV_SET (&k, ed->GetSocket(), EVFILT_READ, EV_ADD, 0, 0, ed);
    
    
  3. nevans commented on Feb 14, 2025

    @nevans
    Contributor

    @drixter I can't easily test NetBSD, but I can easily apply a patch. 😉 Do you wanna test out #1020?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions