Project

General

Profile

Bug #16784

Compiling with --enable-load-relative and "musl-gcc -static" yields "negative string size (or size too big) (ArgumentError)"

Added by runlevel5 (Trung Le) 8 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.6p146 (2020-03-31 revision 67876) [powerpc64le-linux-musl]
[ruby-core:97874]

Description

$ uname -ar
Linux localhost 5.4.27-0-lts #1-Alpine SMP Mon, 23 Mar 2020 18:15:20 UTC ppc64le Linux

$ gcc --version
gcc (Alpine 9.2.0) 9.2.0
Copyright (C) 2019 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.

$ apk info musl
musl-1.1.24-r2 description:
the musl c library (libc) implementation

ruby-2.6.6> CC="gcc -static" ./configure --enable-load-relative

Configuration summary for ruby version 2.6.6

   * Installation prefix: /usr/local
   * exec prefix:         ${prefix}
   * arch:                powerpc64le-linux-musl
   * site arch:           ${arch}
   * RUBY_BASE_NAME:      ruby
   * ruby lib prefix:     ${libdir}/${RUBY_BASE_NAME}
   * site libraries path: ${rubylibprefix}/${sitearch}
   * vendor path:         ${rubylibprefix}/vendor_ruby
   * target OS:           linux-musl
   * compiler:            gcc -static
   * with pthread:        yes
   * enable shared libs:  no
   * dynamic library ext: so
   * CFLAGS:              ${optflags} ${debugflags} ${warnflags}
   * LDFLAGS:             -L. -fstack-protector-strong -rdynamic \
                          -Wl,-export-dynamic
   * DLDFLAGS:            -Wl,--compress-debug-sections=zlib
   * optflags:            -O3
   * debugflags:          -ggdb3
   * warnflags:           -Wall -Wextra -Wdeclaration-after-statement \
                          -Wdeprecated-declarations -Wduplicated-cond \
                          -Wimplicit-function-declaration -Wimplicit-int \
                          -Wmisleading-indentation -Wpointer-arith \
                          -Wrestrict -Wwrite-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
   * strip command:       strip -S -x
   * install doc:         yes
   * JIT support:         yes
   * man page type:       man


ruby-2.6.6> make
...
building rb_mjit_header.h
linking miniruby
rb_mjit_header.h updated
generating encdb.h
building .ext/include/powerpc64le-linux-musl/rb_mjit_min_header-2.6.6.h
./miniruby -I./lib -I. -I.ext/common  ./tool/transform_mjit_header.rb "gcc -static " rb_mjit_header.h .ext/include/powerpc64le-linux-musl/rb_mjit_min_header-2.6.6.h
Traceback (most recent call last):
Traceback (most recent call last):
./miniruby: negative string size (or size too big) (ArgumentError)
./miniruby: negative string size (or size too big) (ArgumentError)
make: *** [uncommon.mk:781: .rbconfig.time] Error 1
make: *** Waiting for unfinished jobs....
make: *** [uncommon.mk:233: .ext/include/powerpc64le-linux-musl/rb_mjit_min_header-2.6.6.h] Error 1
Traceback (most recent call last):
./miniruby: negative string size (or size too big) (ArgumentError)
make: *** [uncommon.mk:1033: encdb.h] Error 1

ruby-2.6.6> ./miniruby
./miniruby: negative string size (or size too big) (ArgumentError)

Seems to me the miniruby binary is not correctly compiled if CC is musl-gcc -static (static linking) and --enable-load-relative option is enabled.

No data to display

Also available in: Atom PDF