"pkg-config --exists libffi" | pkg-config --libs libffi => "-lffi\n" "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lruby-2.5 -lpthread -lgmp -ldl -lcrypt -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return 0; 6: } /* end */ "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lruby-2.5 -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return 0; 6: } /* end */ | pkg-config --cflags-only-I libffi => "\n" | pkg-config --cflags-only-other libffi => "\n" | pkg-config --libs-only-l libffi => "-lffi\n" package configuration for libffi cflags: ldflags: libs: -lffi have_library: checking for ffi_prep_closure_loc() in -lffi... -------------------- yes "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lffi -lruby-2.5 -lffi -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: #include 4: 5: /*top*/ 6: extern int t(void); 7: int main(int argc, char **argv) 8: { 9: if (argc > 1000000) { 10: printf("%p", &t); 11: } 12: 13: return 0; 14: } 15: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_closure_loc; return !p; } /* end */ -------------------- have_func: checking for ffi_prep_cif_var()... -------------------- yes "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lffi -lffi -lruby-2.5 -lffi -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc" conftest.c: In function ‘t’: conftest.c:13:57: error: ‘ffi_prep_cif_var’ undeclared (first use in this function) int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_cif_var; return !p; } ^~~~~~~~~~~~~~~~ conftest.c:13:57: note: each undeclared identifier is reported only once for each function it appears in checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: printf("%p", &t); 9: } 10: 11: return 0; 12: } 13: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_cif_var; return !p; } /* end */ "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lffi -lffi -lruby-2.5 -lffi -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: printf("%p", &t); 9: } 10: 11: return 0; 12: } 13: extern void ffi_prep_cif_var(); 14: int t(void) { ffi_prep_cif_var(); return 0; } /* end */ -------------------- have_func: checking for ffi_raw_call()... -------------------- yes "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lffi -lffi -lruby-2.5 -lffi -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc" conftest.c: In function ‘t’: conftest.c:13:57: error: ‘ffi_raw_call’ undeclared (first use in this function); did you mean ‘rb_proc_call’? int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_raw_call; return !p; } ^~~~~~~~~~~~ rb_proc_call conftest.c:13:57: note: each undeclared identifier is reported only once for each function it appears in checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: printf("%p", &t); 9: } 10: 11: return 0; 12: } 13: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_raw_call; return !p; } /* end */ "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lffi -lffi -lruby-2.5 -lffi -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: printf("%p", &t); 9: } 10: 11: return 0; 12: } 13: extern void ffi_raw_call(); 14: int t(void) { ffi_raw_call(); return 0; } /* end */ -------------------- have_func: checking for ffi_prep_raw_closure()... -------------------- yes "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lffi -lffi -lruby-2.5 -lffi -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc" conftest.c: In function ‘t’: conftest.c:13:57: error: ‘ffi_prep_raw_closure’ undeclared (first use in this function) int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_raw_closure; return !p; } ^~~~~~~~~~~~~~~~~~~~ conftest.c:13:57: note: each undeclared identifier is reported only once for each function it appears in checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: printf("%p", &t); 9: } 10: 11: return 0; 12: } 13: int t(void) { void ((*volatile p)()); p = (void ((*)()))ffi_prep_raw_closure; return !p; } /* end */ "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lffi -lffi -lruby-2.5 -lffi -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: printf("%p", &t); 9: } 10: 11: return 0; 12: } 13: extern void ffi_prep_raw_closure(); 14: int t(void) { ffi_prep_raw_closure(); return 0; } /* end */ -------------------- have_func: checking for rb_gc_mark_movable()... -------------------- no "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lffi -lffi -lruby-2.5 -lffi -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc" conftest.c: In function ‘t’: conftest.c:13:57: error: ‘rb_gc_mark_movable’ undeclared (first use in this function); did you mean ‘rb_gc_mark_maybe’? int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_gc_mark_movable; return !p; } ^~~~~~~~~~~~~~~~~~ rb_gc_mark_maybe conftest.c:13:57: note: each undeclared identifier is reported only once for each function it appears in checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: printf("%p", &t); 9: } 10: 11: return 0; 12: } 13: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_gc_mark_movable; return !p; } /* end */ "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lffi -lffi -lruby-2.5 -lffi -lffi -lpthread -lgmp -ldl -lcrypt -lm -lc" /usr/bin/ld: /tmp/cc5c15WX.o: in function `t': /sdk/clients/client/ruby/vendor/bundle/ruby/2.5.0/gems/ffi-1.16.3/ext/ffi_c/conftest.c:14: undefined reference to `rb_gc_mark_movable' collect2: error: ld returned 1 exit status checked program was: /* begin */ 1: #include "ruby.h" 2: 3: /*top*/ 4: extern int t(void); 5: int main(int argc, char **argv) 6: { 7: if (argc > 1000000) { 8: printf("%p", &t); 9: } 10: 11: return 0; 12: } 13: extern void rb_gc_mark_movable(); 14: int t(void) { rb_gc_mark_movable(); return 0; } /* end */ -------------------- block in append_ldflags: checking for whether -pthread is accepted as LDFLAGS... -------------------- yes "gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.5.0 -I/usr/include/ruby-2.5.0/ruby/backward -I/usr/include/ruby-2.5.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/build/ruby2.5-F4mxqA/ruby2.5-2.5.5=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -lffi -lffi -lruby-2.5 -pthread -lpthread -lgmp -ldl -lcrypt -lm -lc" checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return 0; 6: } /* end */ -------------------- extconf.h is: /* begin */ 1: #ifndef EXTCONF_H 2: #define EXTCONF_H 3: #define HAVE_FFI_PREP_CIF_VAR 1 4: #define HAVE_FFI_RAW_CALL 1 5: #define HAVE_FFI_PREP_RAW_CLOSURE 1 6: #define HAVE_RAW_API 1 7: #endif /* end */