[#104740] [Ruby master Feature#18057] Introduce Array#average — ggmichaelgo@...

Issue #18057 has been reported by ggmichaelgo (Michael Go).

14 messages 2021/08/02

[#104774] [Ruby master Bug#18061] Execshield test: libruby.so.N.N.N: FAIL: property-note test because no .note.gnu.property section found — jaruga@...

Issue #18061 has been reported by jaruga (Jun Aruga).

48 messages 2021/08/04

[#104780] [Ruby master Bug#18062] Ruby with enabled LTO segfaults during build — v.ondruch@...

Issue #18062 has been reported by vo.x (Vit Ondruch).

30 messages 2021/08/05

[#104831] [Ruby master Bug#18066] Load did_you_mean eve/error_highlight even with --disable-gems — v.ondruch@...

Issue #18066 has been reported by vo.x (Vit Ondruch).

10 messages 2021/08/07

[#104851] [Ruby master Bug#18073] test/ruby/test_jit.rb: failures "error: invalid use of '__builtin_va_arg_pack ()'" on Ruby 2.7.4 on gcc 4.8.5 on RHEL7 — jaruga@...

Issue #18073 has been reported by jaruga (Jun Aruga).

14 messages 2021/08/09

[#104927] [Ruby master Bug#18077] Marshal.dump(closed_io) raises IOError instead of TypeError — "larskanis (Lars Kanis)" <noreply@...>

Issue #18077 has been reported by larskanis (Lars Kanis).

10 messages 2021/08/16

[#104960] [Ruby master Feature#18083] Capture error in ensure block. — "ioquatix (Samuel Williams)" <noreply@...>

Issue #18083 has been reported by ioquatix (Samuel Williams).

32 messages 2021/08/18

[#105021] [Ruby master Misc#18122] DevelopersMeeting20210916Japan — "mame (Yusuke Endoh)" <noreply@...>

Issue #18122 has been reported by mame (Yusuke Endoh).

12 messages 2021/08/20

[#105069] [Ruby master Bug#18133] LTO: TestGCCompact#test_ast_compacts segfaults on i686 — "vo.x (Vit Ondruch)" <noreply@...>

Issue #18133 has been reported by vo.x (Vit Ondruch).

25 messages 2021/08/25

[#105077] [Ruby master Feature#18136] take_while_after — "zverok (Victor Shepelev)" <noreply@...>

Issue #18136 has been reported by zverok (Victor Shepelev).

21 messages 2021/08/27

[ruby-core:104922] [Ruby master Bug#18000] have_library doesn't work when ruby is compiled with --disable-shared --disable-install-static-library

From: XrXr@...
Date: 2021-08-14 19:36:15 UTC
List: ruby-core #104922
Issue #18000 has been updated by alanwu (Alan Wu).


No objection from me to drop support for the `--disable-shared
--disable-install-static-library` config. I agree with Jean that it's an
improvement to give a clear message and fail fast.

> With that combination, shouldn't we drop the header files too?

If we are keen on supporting that config, it should be possible to add
special handling to `have_func` and other `mkmf` methods to work without
libruby. On glibc platforms at least, this could be done by building the test
program as a shared library, and then using dlopen(3) with `RTLD_NOW` to check
if every symbol resolves. The test program would still need the headers.
This testing process is similar to how Ruby would require the extension
once it's built, so maybe in some ways it's also a more accurate test.

It's already possible today to build an extension without libruby using
only the headers. Here's a small demo for it:

```ruby
# A small demo for building an extension against a Ruby built with
# --disable-shared without libruby.
require 'rbconfig'

config = RbConfig::CONFIG
hdr_dir = config['rubyhdrdir']
arch_hdr_dir = config['rubyarchhdrdir']
# Note how this doesn't link against libruby at all
compile_command = "cc -shared -fpic -o ext.so -I #{hdr_dir} -I #{arch_hdr_dir} ext.c"

File.write("ext.c", <<~EOM)
#include <ruby/ruby.h>

void
Init_ext(void)
{
    // Using two Ruby symbols. The static Ruby executable export these.
    rb_raise(rb_eRuntimeError, "hello from ext");
}
EOM

puts " Enabled shared: #{config['ENABLE_SHARED']}"
puts "Compile command: #{compile_command}"

system(compile_command)

require_relative 'ext'
```

Adding support takes more effort than rejecting the config outright of
course. Another easy option is making `mkmf` error on that config.
We could still leave the headers for people that want to build
extensions without `mkmf`. Maybe there are users writing extensions
in languages not supported by `mkmf`.


----------------------------------------
Bug #18000: have_library doesn't work when ruby is compiled with --disable-shared --disable-install-static-library
https://bugs.ruby-lang.org/issues/18000#change-93289

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Related [Feature #12845] 

If you compile ruby with `--disable-shared --disable-install-static-library`, then many C-extension won't compile anymore. For instance `RedCloth`

```ruby
# extconf.rb
require 'mkmf'
CONFIG['warnflags'].gsub!(/-Wshorten-64-to-32/, '') if CONFIG['warnflags']
$CFLAGS << ' -O0 -Wall ' if CONFIG['CC'] =~ /gcc/
dir_config("redcloth_scan")
have_library("c", "main")
create_makefile("redcloth_scan")
```

```
#mkmf.log 

"gcc -o conftest -I/usr/local/include/ruby-3.1.0/x86_64-linux -I/usr/local/include/ruby-3.1.0/ruby/backward -I/usr/local/include/ruby-3.1.0 -I. -I/usr/local/include    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -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 -Wundef -O0 -Wall  conftest.c  -L. -L/usr/local/lib -Wl,-rpath,/usr/local/lib -L. -L/usr/local/lib  -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lruby-static -lz -lpthread -lrt -lrt -lgmp -ldl -lcrypt -lm
    -lm   -lc"
/usr/bin/ld: cannot find -lruby-static
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */
```

We'd like to use both flags, the first because it provide a small performance improvement, the second because `libruby-static.a` is enormous (up to 120MiB on debug builds).

@alanwu says it's theoretically possible to compile with just the headers.

---Files--------------------------------
no-static-no-shared.diff (2.55 KB)
rb_prefix_hack.diff (1.76 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next