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

gem update issues on PCLinuxOS #2009

Closed
jzakiya opened this issue May 14, 2020 · 15 comments
Closed

gem update issues on PCLinuxOS #2009

jzakiya opened this issue May 14, 2020 · 15 comments
Assignees

Comments

@jzakiya
Copy link

jzakiya commented May 14, 2020

rvm 1.29.10; Truffleruby 20.0.0; Linux Kernel 5.5.17

truffleruby 20.0.0, like ruby 2.6.5, GraalVM CE Native [x86_64-linux]
➜  ~ gem update
Updating installed gems
Updating bigdecimal
Building native extensions. This could take a while...
ERROR:  Error installing bigdecimal:
        ERROR: Failed to build gem native extension.

    current directory: /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/bigdecimal-2.0.0/ext/bigdecimal
/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby -I /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri -r ./siteconf20200513-31632-iustqv.rb extconf.rb
checking RUBY_BIGDECIMAL_VERSION... 2.0.0
checking for labs() in stdlib.h... /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:504:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

Contents of mkmftmp1.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31724 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */



        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:596:in `try_link0'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:614:in `try_link'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:826:in `try_func'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1113:in `block in have_func'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1003:in `block in checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block (2 levels) in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:388:in `postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1002:in `checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1112:in `have_func'
        from extconf.rb:31:in `<main>'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby

Contents of mkmf.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31724 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */


To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/bigdecimal-2.0.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/bigdecimal-2.0.0 for inspection.
Results logged to /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/bigdecimal-2.0.0/gem_make.out
Updating csv
Fetching csv-3.1.3.gem
Successfully installed csv-3.1.3
Parsing documentation for csv-3.1.3
Installing ri documentation for csv-3.1.3
Installing darkfish documentation for csv-3.1.3
Done installing documentation for csv after 4 seconds
Parsing documentation for csv-3.1.3
Done installing documentation for csv after 0 seconds
Updating date
Building native extensions. This could take a while...
ERROR:  Error installing date:
        ERROR: Failed to build gem native extension.

    current directory: /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/date-3.0.0/ext/date
/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby -I /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri -r ./siteconf20200513-31632-atgrj7.rb extconf.rb
checking for timezone in time.h... /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:504:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

Contents of mkmftmp1.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31756 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */



        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:629:in `block in try_compile'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:578:in `with_werror'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:629:in `try_compile'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:846:in `try_var'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1135:in `block in have_var'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1003:in `block in checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block (2 levels) in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:388:in `postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1002:in `checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1134:in `have_var'
        from extconf.rb:6:in `<main>'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby

Contents of mkmf.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31756 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */


To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/date-3.0.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/date-3.0.0 for inspection.
Results logged to /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/date-3.0.0/gem_make.out
Updating dbm
Building native extensions. This could take a while...
ERROR:  Error installing dbm:
        ERROR: Failed to build gem native extension.

    current directory: /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/dbm-1.1.0/ext/dbm
/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby -I /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri -r ./siteconf20200513-31632-b6ih0i.rb extconf.rb
checking for DBM in ndbm.h... /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:504:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

Contents of mkmftmp1.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31772 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */



        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:629:in `block in try_compile'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:578:in `with_werror'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:629:in `try_compile'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1260:in `try_type'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1288:in `block in have_type'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1003:in `block in checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block (2 levels) in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:388:in `postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1002:in `checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1287:in `have_type'
        from extconf.rb:142:in `db_check2'
        from extconf.rb:54:in `db_check'
        from extconf.rb:267:in `block (2 levels) in <main>'
        from extconf.rb:267:in `block in any?'
        from extconf.rb:267:in `each'
        from extconf.rb:267:in `any?'
        from extconf.rb:267:in `block in <main>'
        from extconf.rb:267:in `block in any?'
        from extconf.rb:267:in `each'
        from extconf.rb:267:in `any?'
        from extconf.rb:267:in `<main>'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby
        --with-dbm-dir
        --without-dbm-dir
        --with-dbm-include
        --without-dbm-include=${dbm-dir}/include
        --with-dbm-lib
        --without-dbm-lib=${dbm-dir}/lib
        --with-dbm-type
        --without-dbm-type

Contents of mkmf.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31772 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */


To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/dbm-1.1.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/dbm-1.1.0 for inspection.
Results logged to /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/dbm-1.1.0/gem_make.out
Updating etc
Building native extensions. This could take a while...
ERROR:  Error installing etc:
        ERROR: Failed to build gem native extension.

    current directory: /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/etc-1.1.0/ext/etc
/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby -I /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri -r ./siteconf20200513-31632-d6zxc4.rb extconf.rb
checking for sys/utsname.h... /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:504:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

Contents of mkmftmp1.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31797 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */



        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:645:in `try_cpp'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1153:in `block in have_header'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1003:in `block in checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block (2 levels) in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:388:in `postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1002:in `checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1152:in `have_header'
        from extconf.rb:6:in `block in <main>'
        from extconf.rb:5:in `each'
        from extconf.rb:5:in `<main>'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby

Contents of mkmf.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31797 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */


To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/etc-1.1.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/etc-1.1.0 for inspection.
Results logged to /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/etc-1.1.0/gem_make.out
Updating gdbm
Building native extensions. This could take a while...
ERROR:  Error installing gdbm:
        ERROR: Failed to build gem native extension.

    current directory: /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/gdbm-2.1.0/ext/gdbm
/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby -I /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri -r ./siteconf20200513-31632-sjj325.rb extconf.rb
checking for gdbm_open() in -lgdbm... /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:504:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

Contents of mkmftmp1.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31813 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */



        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:596:in `try_link0'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:614:in `try_link'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:826:in `try_func'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1060:in `block in have_library'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1003:in `block in checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block (2 levels) in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:388:in `postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1002:in `checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1055:in `have_library'
        from extconf.rb:5:in `<main>'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby
        --with-gdbm-dir
        --without-gdbm-dir
        --with-gdbm-include
        --without-gdbm-include=${gdbm-dir}/include
        --with-gdbm-lib
        --without-gdbm-lib=${gdbm-dir}/lib
        --with-gdbmlib
        --without-gdbmlib

Contents of mkmf.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31813 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */


To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/gdbm-2.1.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/gdbm-2.1.0 for inspection.
Results logged to /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/gdbm-2.1.0/gem_make.out
Updating irb
Fetching irb-1.2.4.gem
Successfully installed irb-1.2.4
Parsing documentation for irb-1.2.4
Installing ri documentation for irb-1.2.4
Installing darkfish documentation for irb-1.2.4
Done installing documentation for irb after 7 seconds
Parsing documentation for irb-1.2.4
Done installing documentation for irb after 3 seconds
Updating json
Building native extensions. This could take a while...
ERROR:  Error installing json:
        ERROR: Failed to build gem native extension.

    current directory: /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/json-2.3.0/ext/json/ext/generator
/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby -I /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri -r ./siteconf20200513-31632-iof8v5.rb extconf.rb
creating Makefile

current directory: /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/json-2.3.0/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/json-2.3.0/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.so
ld.lld: error: cannot open crtbeginS.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtendS.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:639: generator.so] Error 1

make failed, exit code 2

Gem files will remain installed in /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/json-2.3.0 for inspection.
Results logged to /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/json-2.3.0/gem_make.out
Updating matrix
Fetching matrix-0.3.0.gem
Successfully installed matrix-0.3.0
Parsing documentation for matrix-0.3.0
Installing ri documentation for matrix-0.3.0
Installing darkfish documentation for matrix-0.3.0
Done installing documentation for matrix after 3 seconds
Parsing documentation for matrix-0.3.0
Done installing documentation for matrix after 0 seconds
Updating openssl
Fetching openssl-2.2.0.gem
Building native extensions. This could take a while...
ERROR:  Error installing openssl:
        ERROR: Failed to build gem native extension.

    current directory: /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/openssl-2.2.0/ext/openssl
/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby -I /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri -r ./siteconf20200513-31632-cqziol.rb extconf.rb
checking for t_open() in -lnsl... /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:504:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

Contents of mkmftmp1.log:
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31892 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */



        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:596:in `try_link0'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:614:in `try_link'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:826:in `try_func'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1060:in `block in have_library'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1003:in `block in checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block (2 levels) in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:392:in `block in postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:353:in `open'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:388:in `postpone'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1002:in `checking_for'
        from /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/mri/mkmf.rb:1055:in `have_library'
        from extconf.rb:30:in `<main>'
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/bin/truffleruby
        --with-openssl-dir
        --without-openssl-dir
        --with-openssl-include
        --without-openssl-include=${openssl-dir}/include
        --with-openssl-lib
        --without-openssl-lib=${openssl-dir}/lib
        --with-kerberos-dir
        --without-kerberos-dir
        --with-kerberos-include
        --without-kerberos-include=${kerberos-dir}/include
        --with-kerberos-lib
        --without-kerberos-lib=${kerberos-dir}/lib
        --with-debug
        --without-debug
        --enable-debug
        --disable-debug
        --with-nsllib
        --without-nsllib

Contents of mkmf.log:
=== OpenSSL for Ruby configurator ===
=== Checking for system dependent stuff... ===
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
"/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/bin/graalvm-native-clang -o conftest -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include/ruby/backward -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext/include -I.      -Wimplicit-function-declaration -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-format-invalid-specifier -Wno-format-extra-args -ferror-limit=500 conftest.c  -L. -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib  -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib     -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -rpath /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/cext -ltruffleruby -lpolyglot-mock   "
Process failed: #<Process::Status: pid 31892 exit 1>
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */


To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/openssl-2.2.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/jzakiya/.rvm/gems/truffleruby-20.0.0/gems/openssl-2.2.0 for inspection.
Results logged to /home/jzakiya/.rvm/gems/truffleruby-20.0.0/extensions/x86_64-linux/20.0.0/openssl-2.2.0/gem_make.out
Updating pry
Fetching pry-0.13.1.gem
Successfully installed pry-0.13.1
Parsing documentation for pry-0.13.1
Installing ri documentation for pry-0.13.1
Installing darkfish documentation for pry-0.13.1
Done installing documentation for pry after 11 seconds
Parsing documentation for pry-0.13.1
Done installing documentation for pry after 5 seconds
Updating pry-doc
Fetching pry-doc-1.1.0.gem
Successfully installed pry-doc-1.1.0
Parsing documentation for pry-doc-1.1.0
Installing ri documentation for pry-doc-1.1.0
Installing darkfish documentation for pry-doc-1.1.0
Done installing documentation for pry-doc after 36 seconds
Parsing documentation for pry-doc-1.1.0
Done installing documentation for pry-doc after 1 seconds
Updating rake
Fetching rake-13.0.1.gem
Successfully installed rake-13.0.1
Parsing documentation for rake-13.0.1
Installing ri documentation for rake-13.0.1
Installing darkfish documentation for rake-13.0.1
Done installing documentation for rake after 2 seconds
Parsing documentation for rake-13.0.1
Done installing documentation for rake after 4 seconds
Updating rdoc
Fetching rdoc-6.2.1.gem
Successfully installed rdoc-6.2.1
Parsing documentation for rdoc-6.2.1
Installing ri documentation for rdoc-6.2.1
Installing darkfish documentation for rdoc-6.2.1
ERROR:  While executing gem ... (RDoc::Error)
    error generating index.html: unexpected return (LocalJumpError)
➜  ~ 
@eregon
Copy link
Member

eregon commented May 14, 2020

As the log says:

You have to install development tools first.

See https://github.com/oracle/truffleruby/blob/master/README.md#dependencies
and in particular https://github.com/oracle/truffleruby/blob/master/doc/user/installing-llvm.md
It seems you're missing gcc in this case.

The LocalJumpError in RDoc is a different issue, could you report that separately?

@eregon
Copy link
Member

eregon commented May 14, 2020

Reopening since apparently installing gcc wasn't enough for you.
This is probably a distribution-specific issue then.
What's your package manager?

Can you try to find what installs crtbegin.o: and /usr/lib/libgcc_s.so.1//usr/lib64/libgcc_s.so.1 for your distribution?
For other distributions, that's part of the gcc package.

To debug this you can try compiling a C hello world with the clang shown by

$ truffleruby -e 'puts RbConfig::CONFIG["CC"]'

Maybe installing clang/llvm on your system might help to install crtbegin.o: and /usr/lib/libgcc_s.so.1.

@eregon eregon reopened this May 14, 2020
@eregon
Copy link
Member

eregon commented May 14, 2020

Note that bigdecimal doesn't compile on TruffleRuby 20.0.0, but it should on truffleruby-head.

@jzakiya
Copy link
Author

jzakiya commented May 15, 2020

I used rvm-1.29.10 to install truffleruby rvm install truffleruby-20.0.0.
Every other Ruby has installed with no problem, and update gems.
If there is some missing build tool then it's a build issue with rvm not detecting at build time.

@eregon
Copy link
Member

eregon commented May 15, 2020

Every other Ruby has installed with no problem, and update gems.

That seems slightly too general. JRuby certainly cannot install or update the bigdecimal gem for instance.

gem update (all) is not guaranteed to work, since it also considers default gems which might have a different implementation than the upstream gems (i.e., they're still part of stdlib).
Is there a specific reason you want to update all known gems, including default gems?

If there is some missing build tool then it's a build issue with rvm not detecting at build time.

Maybe in the end we add an extra dependency in rvm for your distribution.
Anyway, we need to figure out what that is.
Please answer my questions to progress on that.

@eregon eregon changed the title gem update issues gem update issues on PCLinuxOS May 15, 2020
@eregon
Copy link
Member

eregon commented May 15, 2020

To help debug this, it would be useful if you can share the output of:

gcc -v hello.c
clang -v hello.c
$(truffleruby -e 'puts RbConfig::CONFIG["CC"]') -v hello.c

with hello.c being:

#include <stdio.h>

int main(int argc, char const *argv[]) {
  puts("Hello World");
  return 0;
}

@jzakiya
Copy link
Author

jzakiya commented May 15, 2020

I use Zsh.

➜  ~ cat hello.c 
#include <stdio.h>

int main(int argc, char const *argv[]) {
  puts("Hello World");
  return 0;
}
➜  

gcc 9.3.0

➜  ~ gcc -v hello.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/lto-wrapper
Target: x86_64-mandriva-linux-gnu
Configured with: ../configure --prefix=/usr --libexecdir=/usr/lib --with-slibdir=/lib64 --with-pkgversion='PCLinuxOS 9.3.0-1pclos2020' --with-bugurl=https://pclinuxos.com/ --mandir=/usr/share/man --infodir=/usr/share/info --enable-checking=release --enable-languages=c,c++,ada,fortran,objc,obj-c++ --enable-linker-build-id --build=x86_64-mandriva-linux-gnu --host=x86_64-mandriva-linux-gnu --with-cpu=generic --with-system-zlib --enable-threads=posix --with-linker-hash-style=gnu --enable-shared --enable-long-long --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --enable-ssp --disable-libssp --disable-libffi --disable-werror --with-isl --with-python-dir=/lib/python3.6/site-packages --enable-lto
Thread model: posix
gcc version 9.3.0 (PCLinuxOS 9.3.0-1pclos2020) 
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/cc1 -quiet -v hello.c -quiet -dumpbase hello.c -mtune=generic -march=x86-64 -auxbase hello -version -o /tmp//ccg9BKgu.s
GNU C17 (PCLinuxOS 9.3.0-1pclos2020) version 9.3.0 (x86_64-mandriva-linux-gnu)
        compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../../x86_64-mandriva-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/include
 /usr/local/include
 /usr/include
End of search list.
GNU C17 (PCLinuxOS 9.3.0-1pclos2020) version 9.3.0 (x86_64-mandriva-linux-gnu)
        compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.16.1-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 511d191b311cf5549363a9bd6761cdbc
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 as -v --64 -o /tmp//cczsgTUr.o /tmp//ccg9BKgu.s
GNU assembler version 2.34 (x86_64-mandriva-linux-gnu) using BFD version (GNU Binutils) 2.34
COMPILER_PATH=/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/:/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/:/usr/lib/gcc/x86_64-mandriva-linux-gnu/:/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/:/usr/lib/gcc/x86_64-mandriva-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/:/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/collect2 -plugin /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp//ccBuT6Xs.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../../lib64/crti.o /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/crtbegin.o -L/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0 -L/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../.. /tmp//cczsgTUr.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/crtend.o /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../../lib64/crtn.o
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
➜  ~ 

clang 8.0.1

➜  ~ clang -v hello.c
clang version 8.0.1 ( 8.0.1-1pclos2019)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/4.5.2
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/4.7.2
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/4.9.2
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/7.2.1
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/7.3.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/8.3.1
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.2.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-mandriva-linux-gnu/4.5.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-mandriva-linux-gnu/4.7.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-mandriva-linux-gnu/4.9.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-mandriva-linux-gnu/7.2.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-mandriva-linux-gnu/7.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-mandriva-linux-gnu/8.3.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.2.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-mandriva-linux-gnu/9.3.0
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.3.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 "/usr/bin/clang-8" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib64/clang/8.0.1 -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/8.0.1/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /home/jzakiya -ferror-limit 19 -fmessage-length 149 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-07d914.o -x c hello.c -faddrsig
clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib64/clang/8.0.1/include
 /include
 /usr/include
End of search list.
 "/usr/bin/ld" --hash-style=gnu --no-add-needed --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../../lib64/crt1.o /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../../lib64/crti.o /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/crtbegin.o -L/usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.3.0 -L/usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../../lib64 -L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../.. -L/usr/bin/../lib -L/lib -L/usr/lib /tmp/hello-07d914.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/crtend.o /usr/bin/../lib/gcc/x86_64-mandriva-linux-gnu/9.3.0/../../../../lib64/crtn.o
➜  ~ 

truffleuby 20.0.0

➜  ~ rvm use truffleruby
Warning! PATH is not properly set up, /home/jzakiya/.rvm/gems/ruby-2.7.1/bin is not at first place.
         Usually this is caused by shell initialization files. Search for PATH=... entries.
         You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
         To fix it temporarily in this shell session run: rvm use ruby-2.7.1
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
Using /home/jzakiya/.rvm/gems/truffleruby-20.0.0
➜  ~ (truffleruby -e 'puts RbConfig::CONFIG["CC"]') -v hello.c
zsh: parse error near `-v'
➜  ~

@eregon
Copy link
Member

eregon commented May 15, 2020

Thanks, the last command fails because you need the $ included:
$(truffleruby -e 'puts RbConfig::CONFIG["CC"]') -v hello.c

@jzakiya
Copy link
Author

jzakiya commented May 15, 2020

➜  ~ $(truffleruby -e 'puts RbConfig::CONFIG["CC"]') -v hello.c
GraalVM wrapper script for clang
GraalVM version: 20.0.0
running: /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/llvm-toolchain/bin/clang -flto=full -g -O1 -I/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/include -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib -fuse-ld=/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/llvm-toolchain/bin/ld.lld -Wl,--mllvm=-lto-embed-bitcode,--lto-O0 -v hello.c
clang version 9.0.0 (GraalVM.org llvmorg-9.0.0-4-g9cf46c329d-bgf06552bd84 9cf46c329d6c0640038501b17ed763a5acb5b23c)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/llvm-toolchain/bin
 "/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/llvm-toolchain/bin/clang-9" -cc1 -triple x86_64-unknown-linux-gnu -emit-llvm-bc -flto=full -flto-unit -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.c -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -momit-leaf-frame-pointer -v -resource-dir /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/llvm-toolchain/lib/clang/9.0.0 -I /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/include -internal-isystem /usr/local/include -internal-isystem /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/llvm-toolchain/lib/clang/9.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O1 -fdebug-compilation-dir /home/jzakiya -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o /tmp/hello-f96c9f.o -x c hello.c
clang -cc1 version 9.0.0 based upon LLVM 9.0.0-4-g9cf46c329d-bgf06552bd84 default target x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/include
 /usr/local/include
 /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/llvm-toolchain/lib/clang/9.0.0/include
 /include
 /usr/include
End of search list.
 "/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/llvm-toolchain/bin/ld.lld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o crtbegin.o -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/sulong/native/lib -L/lib/../lib64 -L/usr/lib/../lib64 -L/home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/llvm-toolchain/bin/../lib -L/lib -L/usr/lib -plugin /home/jzakiya/.rvm/rubies/truffleruby-20.0.0/lib/llvm-toolchain/bin/../lib/LLVMgold.so -plugin-opt=mcpu=x86-64 -plugin-opt=O1 --mllvm=-lto-embed-bitcode --lto-O0 /tmp/hello-f96c9f.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed crtend.o /usr/lib/../lib64/crtn.o
ld.lld: error: cannot open crtbegin.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc
ld.lld: error: cannot open crtend.o: No such file or directory
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

@eregon
Copy link
Member

eregon commented May 15, 2020

@zapster Could you take a look?

@zapster
Copy link
Member

zapster commented May 18, 2020

Hello @jzakiya, thanks for all the infos so far.
It seems like the toolchain used by truffleruby uses different library search paths than the installed clang. To help us diagnose this further, could you please post the output of

clang --print-search-dirs
$(truffleruby -e 'puts RbConfig::CONFIG["CC"]') --print-search-dirs

as well as

clang -Wl,-verbose hello.c
$(truffleruby -e 'puts RbConfig::CONFIG["CC"]') -Wl,-verbose hello.c

Thank you!

@zapster
Copy link
Member

zapster commented May 18, 2020

Actually, it seems that the missing

Found candidate GCC installation: ...

from the

$(truffleruby -e 'puts RbConfig::CONFIG["CC"]') -v hello.c

is the culprit. For some reason the gcc installations are not detected. This is something we have to look into. You can workaround the issues explicitly set the gcc toolchain:

$(truffleruby -e 'puts RbConfig::CONFIG["CC"]') -v hello.c --rtlib=compiler-rt 

@zapster
Copy link
Member

zapster commented May 18, 2020

I did some more digging and it seems that PCLinuxOS is patching their clang to pick up the gcc installation. (If you are interested in the details, see
cfe-8.0.0-detect-Mageia.patch from the clang source rpm.) Since this patch is not upstream, there is nothing we can do on our side.

Another workaround you can try is to create a symlink that clang will detect by default. As root:

cd /usr/lib/gcc/
ln -s x86_64-mandriva-linux-gnu x86_64-linux-gnu

Hope that helps.

@zapster
Copy link
Member

zapster commented May 18, 2020

To add a bit more background, this is not specific to truffleruby/GraalVM but a general problem of the Linux distribution. If clang is compiled manually without applying the patch it will run into the same issue.

Only the distribution can fix this for real, by either upstreaming their patches to the LLVM project or by adding a symlink so that clang can pick up gcc by default. I suggest filing an issue for PCLinuxOS.

@eregon
Copy link
Member

eregon commented May 18, 2020

I documented the workaround for Mandriva-based distributions in be4c577

@jzakiya Could you report this issue to PCLinuxOS as @zapster suggested?
That is the proper fix, so any clang running on PCLinuxOS would find gcc automatically like on other distributions, without needing the manual symlink workaround.

@eregon eregon closed this as completed May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants