Project

General

Profile

Actions

Bug #19592

closed

Unable to statically link a single extension in 3.2.x and >=3.1.4

Added by npic1 (Nat Pic1) over 1 year ago. Updated 8 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
[ruby-core:113195]

Description

Hi,
I need to statically link a single extension (not all of them) by adding it to ext/Setup.
This worked until version 3.1.4 and 3.2.x.

It appears that this change broke it:
https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/790cf4b6d0475614afb127b416e87cfa39044d67
https://github.com/ruby/ruby/pull/6756.

I have attached a script to reproduce the issue.

When running the script, ldd fails with:

ext/extinit.o: in function `Init_ext':
extinit.c:(.text+0x10): undefined reference to `ruby_init_ext'

Files

ruby_static_test.sh (1.57 KB) ruby_static_test.sh npic1 (Nat Pic1), 04/12/2023 01:47 PM
Actions #1

Updated by npic1 (Nat Pic1) over 1 year ago

  • Subject changed from Unable to statically link a single extension in 3.2.x and >3.1.4 to Unable to statically link a single extension in 3.2.x and >=3.1.4

Updated by npic1 (Nat Pic1) over 1 year ago

npic1 (Nat Pic1) wrote:

Hi,
I need to statically link a single extension (not all of them) by adding it to ext/Setup.
This worked until version 3.1.4 and 3.2.x.

It appears that this change broke it:
https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/790cf4b6d0475614afb127b416e87cfa39044d67
https://github.com/ruby/ruby/pull/6756.

I have attached a script to reproduce the issue.

When running the script, ldd fails with:

ext/extinit.o: in function `Init_ext':
extinit.c:(.text+0x10): undefined reference to `ruby_init_ext'

cc: @alanwu (Alan Wu)

Actions #3

Updated by alanwu (Alan Wu) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset git|adaff1fc496b6f01fb1c4c812b9b4082618e2f79.


[Bug #19592] Fix ext/Setup support

After 1, using ext/Setup to link some, but not all extensions failed
during linking. I did not know about this option, and had assumed that
only --with-static-linked-ext builds can include statically linked
extensions.

Include the support code for statically linked extensions in all
configurations like before 1. Initialize the table lazily to minimize
footprint on builds that have no statically linked extensions.

Actions #4

Updated by nagachika (Tomoyuki Chikanaga) 8 months ago

  • Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 3.1: REQUIRED, 3.2: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) 8 months ago

  • Backport changed from 3.1: REQUIRED, 3.2: REQUIRED to 3.1: REQUIRED, 3.2: DONE

ruby_3_2 baa5bc16c17e3b4dac7b590ed5d6b7e705535e15 merged revision(s) adaff1fc496b6f01fb1c4c812b9b4082618e2f79.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0