ruby-packer
ruby-packer copied to clipboard
Does not work on Ubuntu 20.10, with ruby 2.7.1p83
I'm sure I've followed instructions. Issue with Stable and Unstable, and I can't see what problem is.
$lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.10 Release: 20.10 Codename: groovy
$ruby --version ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux-gnu]
$./rubyc --version 2.7.1.dev
$./rubyc
<<<Truncated>>>
/usr/bin/ld: /usr/bin/ld: ./libgdbmapp.a(parseopt.o):/tmp/rubyc/gdbm/src/parseopt.c:256: multiple definition of `parseopt_program_args'; ./libgdbmapp.a(parseopt.o):/tmp/rubyc/gdbm/src/parseopt.c:256: multiple definition of `parseopt_program_args'; gdbm_dump.o:/tmp/rubyc/gdbm/src/gdbm_dump.c:23: first defined here
/usr/bin/ld: ./libgdbmapp.a(parseopt.o):/tmp/rubyc/gdbm/src/parseopt.c:255: multiple definition of `parseopt_program_doc'; gdbm_dump.o:/tmp/rubyc/gdbm/src/gdbm_dump.c:22: first defined here
gdbm_load.o:/tmp/rubyc/gdbm/src/gdbm_load.c:33: first defined here
/usr/bin/ld: ./libgdbmapp.a(parseopt.o):/tmp/rubyc/gdbm/src/parseopt.c:255: multiple definition of `parseopt_program_doc'; gdbm_load.o:/tmp/rubyc/gdbm/src/gdbm_load.c:32: first defined here
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:637: gdbm_load] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:633: gdbm_dump] Error 1
make[3]: Leaving directory '/tmp/rubyc/gdbm/src'
make[2]: *** [Makefile:483: all] Error 2
make[2]: Leaving directory '/tmp/rubyc/gdbm/src'
make[1]: *** [Makefile:456: all-recursive] Error 1
make[1]: Leaving directory '/tmp/rubyc/gdbm'
make: *** [Makefile:387: all] Error 2
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"true", "CFLAGS"=>" -DRUBY_DEBUG -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe ", "LDFLAGS"=>""}, "make -j6"]
@jradxl Although I'm not a C programmer, I've recently experienced what I believe is the same problem, on another project.
In that case, the problem was the switch from GCC 9 to 10 (Ubuntu 20.04 ships GCC 9.3; 2010 ships GCC 10.2), which disables the so-called "common model".
If the problem is the same, either the flag -fcommon
will fix the problem, or propertly declaring the variable. I'll take a look.
Yes, this is the problem: https://bugs.gentoo.org/705898
@jradxl Can you try to build from my fork/branch, and see if it works (I can't test immediately)? If it does, I'll open a PR.
Repository: https://github.com/saveriomiroddi/ruby-packer-dev.git
Branch: sav/make_gcc_10_compatible
@jradxl Can you rename the title to something like The project fails to compile on GCC 10
? It describes the issue precisely.
Hello, thanks @saveriomiroddi , but alas, I can't get a build of your branch or the main branch.
My failure shown below. This does show on a Google search, but
https://github.com/ruby/ruby/commit/47720e2255f34ecad49763c66a7ea02a55a3f60a
does not fix.
I have bison -V
bison (GNU Bison) 3.7
I may have a missing dependency. I'll keep looking.
compiling parse.c
parse.c: In function 'ruby_yyparse':
parse.c:12323:51: error: macro "yydestruct" passed 5 arguments, but takes just 3
parse.c:12322:11: error: 'yydestruct' undeclared (first use in this function)
/* Return failure if at end of input. */
^
parse.c:12322:11: note: each undeclared identifier is reported only once for each function it appears in
parse.c:12378:65: error: macro "yydestruct" passed 5 arguments, but takes just 3
/* Pop the current state because it cannot handle the error token. */
^
parse.c:12436:47: error: macro "yydestruct" passed 5 arguments, but takes just 3
parse.c:12445:65: error: macro "yydestruct" passed 5 arguments, but takes just 3
/tmp/rubyc/ruby-2.7.1.dev/parse.y: In function 'rb_yytnamerr':
/tmp/rubyc/ruby-2.7.1.dev/parse.y:12744:23: warning: implicit declaration of function 'yystpcpy' [-Wimplicit-function-declaration]
return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
^
/tmp/rubyc/ruby-2.7.1.dev/parse.y:12744:46: error: invalid operands to binary - (have 'int' and 'char *')
return (YYSIZE_T)(yystpcpy(yyres, yystr) - yyres);
^
make: *** [Makefile:421: parse.o] Error 1
make: *** Waiting for unfinished jobs....
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"true", "CFLAGS"=>" -DRUBY_DEBUG -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe -I/tmp/rubyc/ruby-2.7.1.dev -I/tmp/rubyc/local/include -I/tmp/rubyc/local/lib/libffi-3.2.1/include ", "LDFLAGS"=>" -L/tmp/rubyc/local/lib /tmp/rubyc/local/lib/libz.a ", "ENCLOSE_IO_RUBYC_1ST_PASS"=>"true", "ENCLOSE_IO_RUBYC_2ND_PASS"=>nil}, "make -j6"]
rake aborted!
Command failed with status (1): [/home/jradley/.rbenv/versions/2.7.1/bin/ru...]
/home/jradley/Documents2/rubypacker/ruby-packer-dev/Rakefile:27:in `block in <top (required)>'
/home/jradley/.rbenv/versions/2.7.1/bin/bundle:23:in `load'
/home/jradley/.rbenv/versions/2.7.1/bin/bundle:23:in `<main>'
Tasks: TOP => rubyc
(See full trace by running task with --trace)
@jradxl I think that it's the issue you've likely read (https://bugs.ruby-lang.org/issues/17106), and on my system, where the compilation fails, my Bison version is indeed older (3.5.1).
Note that in the issue, they mention that a certain commit (b971bad49b) fixes is on 2.7, however, I've checked the Ruby repo history, and it's included in Ruby 2.7.2. Try with that!
Any resolution to this?
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:637: gdbm_load] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [Makefile:633: gdbm_dump] Error 1
make[3]: Leaving directory '/tmp/rubyc/gdbm/src'
make[2]: *** [Makefile:483: all] Error 2
make[2]: Leaving directory '/tmp/rubyc/gdbm/src'
make[1]: *** [Makefile:456: all-recursive] Error 1
make[1]: Leaving directory '/tmp/rubyc/gdbm'
make: *** [Makefile:387: all] Error 2
Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"true", "CFLAGS"=>" -DRUBY_DEBUG -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe ", "LDFLAGS"=>""}, "make -j12"]
ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-linux-gnu]
./rubyc -v
2.7.1.dev
bison -V
bison (GNU Bison) 3.7.6
Any resolution to this?
collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status make[3]: *** [Makefile:637: gdbm_load] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: *** [Makefile:633: gdbm_dump] Error 1 make[3]: Leaving directory '/tmp/rubyc/gdbm/src' make[2]: *** [Makefile:483: all] Error 2 make[2]: Leaving directory '/tmp/rubyc/gdbm/src' make[1]: *** [Makefile:456: all-recursive] Error 1 make[1]: Leaving directory '/tmp/rubyc/gdbm' make: *** [Makefile:387: all] Error 2 Failed running [{"CI"=>"true", "ENCLOSE_IO_USE_ORIGINAL_RUBY"=>"true", "CFLAGS"=>" -DRUBY_DEBUG -fPIC -O3 -fno-fast-math -ggdb3 -Os -fdata-sections -ffunction-sections -pipe ", "LDFLAGS"=>""}, "make -j12"] ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-linux-gnu] ./rubyc -v 2.7.1.dev bison -V bison (GNU Bison) 3.7.6
Hello!
Based on your error log, it seems to be different from the other two problems in this issue. The log posted actually doesn't have much information about the exact error.
It's almost identical output to the first post. What else can I provide you to get past this? Is my Ruby version too recent? I don´t know where to go from here :-(
Hello!
Based on your error log, it seems to be different from the other two problems in this issue. The log posted actually doesn't have much information about the exact error.
Re-submitted as new issue.