ruby / fiddle

A libffi wrapper for Ruby.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error compiling on Fedora 33

onefish2 opened this issue · comments

gem update
Updating installed gems
Updating fiddle
Building native extensions. This could take a while...
ERROR:  Error installing fiddle:
	ERROR: Failed to build gem native extension.

    current directory: /home/steve/.gem/ruby/gems/fiddle-1.0.2/ext/fiddle
/usr/bin/ruby -I /usr/share/rubygems -r ./siteconf20201119-21950-1wwqy6q.rb extconf.rb
checking for ffi.h... yes
checking for -lffi... yes
libffi_version: 3.1.0
checking for ffi_prep_cif_var() in ffi.h... yes
checking for sys/mman.h... yes
checking for dlfcn.h... yes
checking for -ldl... yes
checking for dlopen()... yes
checking for dlclose()... yes
checking for dlsym()... yes
checking for dlerror()... yes
checking for FFI_STDCALL in ffi.h... yes
creating Makefile

current directory: /home/steve/.gem/ruby/gems/fiddle-1.0.2/ext/fiddle
make "DESTDIR=" clean
rm -f 
rm -f fiddle.so  *.o  *.bak mkmf.log .*.time

current directory: /home/steve/.gem/ruby/gems/fiddle-1.0.2/ext/fiddle
make "DESTDIR="
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -I -DHAVE_FFI_H -DRUBY_LIBFFI_MODVERSION=3001000 -DHAVE_FFI_PREP_CIF_VAR -DHAVE_SYS_MMAN_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_DLCLOSE -DHAVE_DLSYM -DHAVE_DLERROR -DHAVE_CONST_FFI_STDCALL    -fPIC -O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fPIC  -m64 -o closure.o -c closure.c
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.  -I -DHAVE_FFI_H -DRUBY_LIBFFI_MODVERSION=3001000 -DHAVE_FFI_PREP_CIF_VAR -DHAVE_SYS_MMAN_H -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_DLCLOSE -DHAVE_DLSYM -DHAVE_DLERROR -DHAVE_CONST_FFI_STDCALL    -fPIC -O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fPIC  -m64 -o conversions.o -c conversions.c
In file included from /usr/include/ruby.h:33,
                 from ./fiddle.h:4,
                 from conversions.c:1:
conversions.c: In function ‘rb_fiddle_type_ensure’:
./fiddle.h:130:25: error: ‘SIGNEDNESS_OF_SIZE_T’ undeclared (first use in this function); did you mean ‘SIGNEDNESS_OF_TIME_T’?
  130 | #define TYPE_SIZE_T (-1*SIGNEDNESS_OF_SIZE_T*TYPE_SSIZE_T)
      |                         ^~~~~~~~~~~~~~~~~~~~
conversions.c:89:28: note: in expansion of macro ‘TYPE_SIZE_T’
   89 |             return INT2NUM(TYPE_SIZE_T);
      |                            ^~~~~~~~~~~
./fiddle.h:130:25: note: each undeclared identifier is reported only once for each function it appears in
  130 | #define TYPE_SIZE_T (-1*SIGNEDNESS_OF_SIZE_T*TYPE_SSIZE_T)
      |                         ^~~~~~~~~~~~~~~~~~~~
conversions.c:89:28: note: in expansion of macro ‘TYPE_SIZE_T’
   89 |             return INT2NUM(TYPE_SIZE_T);
      |                            ^~~~~~~~~~~
make: *** [Makefile:246: conversions.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/steve/.gem/ruby/gems/fiddle-1.0.2 for inspection.
Results logged to /home/steve/.gem/ruby/extensions/x86_64-linux/2.7.0/fiddle-1.0.2/gem_make.out
Gems updated: fiddle

Thanks for your report.
Fixed.

Thanks for the quick fix!! Its working now.