Project

General

Profile

Actions

Bug #18072

closed

Build error with "./configure --enable-shared"

Added by jaruga (Jun Aruga) about 3 years ago. Updated about 3 years ago.

Status:
Closed
Target version:
-
[ruby-core:104847]

Description

I just hit the build error by make on my machine Fedora 34 on the latest master 9ed196e4876dd15991feee27e7dce1b67783060f .

$ cat /etc/fedora-release 
Fedora release 34 (Thirty Four)
$ rpm -q gcc
gcc-11.2.1-1.fc34.x86_64
$ gcc --version
gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1)
Copyright (C) 2021 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.

$ autoconf

$ ./configure --enable-shared

$ make
	BASERUBY = /usr/local/ruby-3.0.2/bin/ruby --disable=gems
	CC = gcc
	LD = ld
	LDSHARED = gcc -shared
	CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=duplicated-cond -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=write-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Werror=undef -std=gnu99  -fPIC 
	XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/unicode/13.0.0
	CPPFLAGS =   
	DLDFLAGS = -Wl,--compress-debug-sections=zlib -Wl,-soname,libruby.so.3.1  -fstack-protector-strong  
	SOLIBS = -lz -lpthread -lrt -lrt -lgmp -ldl -lcrypt -lm 
	LANG = en_US.UTF-8
	LC_ALL = en_US.UTF-8
	LC_CTYPE = 
	MFLAGS = 
gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1)
Copyright (C) 2021 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.

compiling ./main.c
...
building rb_mjit_header.h
./miniruby -I./lib -I. -I.ext/common  ./tool/mjit_tabs.rb "" \
  gcc -E -DMJIT_HEADER -P -dD -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=duplicated-cond -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=write-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Werror=undef -std=gnu99  -fPIC  -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/unicode/13.0.0    ./vm.c >rb_mjit_header.h.new
rb_mjit_header.h updated
building .ext/include/x86_64-linux/rb_mjit_min_header-3.1.0.h
./miniruby -I./lib -I. -I.ext/common  ./tool/transform_mjit_header.rb "gcc -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=duplicated-cond -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=write-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Werror=undef -std=gnu99  -fPIC  -w" rb_mjit_header.h .ext/include/x86_64-linux/rb_mjit_min_header-3.1.0.h
transform_mjit_header: making external definition static inline: rb_vm_lvar_exposed, Init_vm_stack_canary, rb_vm_opt_cfunc_p, rb_find_defined_class_by_owner, rb_vm_rewrite_cref, rb_vm_block_ep_update, rb_vm_cref_new_toplevel, rb_vm_frame_block_handler, rb_vm_cframe_keyword_p, rb_vm_ep_local_ep
transform_mjit_header: making declaration static inline: rb_vm_lvar_exposed, Init_vm_stack_canary, rb_vm_rewrite_cref, rb_vm_frame_block_handler, rb_vm_block_ep_update, rb_vm_ep_local_ep
transform_mjit_header: SKIPPED to transform: getlogin_r, pread64, pread, read, bsearch, fread_unlocked, fgets_unlocked, fread, fgets, vdprintf, dprintf, vfprintf, vprintf, printf, fprintf, getline, putchar_unlocked, putc_unlocked, fputc_unlocked, putchar, getchar_unlocked, getc_unlocked, fgetc_unlocked, getchar
ln -sf ../../../.ext/include/x86_64-linux/rb_mjit_min_header-3.1.0.h include/ruby-3.1.0/x86_64-linux/rb_mjit_min_header-3.1.0.h
config.status: creating ruby-runner.h
making mjit_build_dir.so
generating x86_64-linux-fake.rb
x86_64-linux-fake.rb updated
make: Circular spec/ruby/optional/capi/ext/array_spec.c <- exts dependency dropped.
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./x86_64-linux-fake ./spec/mspec/bin/mspec-run -B ./spec/default.mspec  ./spec/ruby/optional/capi/ext/array_spec.c
Could not find spec file ./spec/ruby/optional/capi/ext/array_spec.c
make: *** [defs/gmake.mk:360: spec/ruby/optional/capi/ext/array_spec.c] Error 1

I could build on the master 1cb5a669d39fe741388be7ac45fc88c336b097cf last week.

So, the cause could be a commit between those commits.

$ git diff 1cb5a669d39fe741388be7ac45fc88c336b097cf..9ed196e4876dd15991feee27e7dce1b67783060f

Updated by jaruga (Jun Aruga) about 3 years ago

I see the build error happens on the following commit. While it works on the previous commit. Maybe the commit causes the build error. Do you have any idea to fix it?

Build rubyspec CAPI extensions
https://github.com/ruby/ruby/commit/bda56a03a625793cb3fd110458c3f7323d73705e

Updated by Eregon (Benoit Daloze) about 3 years ago

  • Assignee set to nobu (Nobuyoshi Nakada)

@nobu (Nobuyoshi Nakada) What's the reason to build C API specs extensions eagerly?
Can't we let ruby/spec build them at runtime as normal?

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

jaruga (Jun Aruga) wrote:

make: Circular spec/ruby/optional/capi/ext/array_spec.c <- exts dependency dropped.
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./x86_64-linux-fake ./spec/mspec/bin/mspec-run -B ./spec/default.mspec  ./spec/ruby/optional/capi/ext/array_spec.c
Could not find spec file ./spec/ruby/optional/capi/ext/array_spec.c
make: *** [defs/gmake.mk:360: spec/ruby/optional/capi/ext/array_spec.c] Error 1

The target at defs/gmake.mk:359 is spec/%, seems miss-firing *.c files.
I've missed the in-place build case.

Eregon (Benoit Daloze) wrote in #note-2:

@nobu (Nobuyoshi Nakada) What's the reason to build C API specs extensions eagerly?
Can't we let ruby/spec build them at runtime as normal?

As compilation warnings were discarded and ignored.

Actions #4

Updated by nobu (Nobuyoshi Nakada) about 3 years ago

  • Status changed from Open to Closed

Applied in changeset git|e3dcb6204d66c62aedaf94cac336d93d0275ce2c.


Run only directories or *_spec.rb files only by mspec [Bug #18072]

Not to match *.c files under spec/ruby/optional/capi/ext, in the
case of in-place build.

Actions #5

Updated by jaruga (Jun Aruga) about 3 years ago

  • Subject changed from Build error on Fedora 34 x86_64 to Build error with "./configure --enable-shared"

Updated by jaruga (Jun Aruga) about 3 years ago

Thanks for the fix! I confirmed I was able to build on the latest master.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0