ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "rhenium (Kazuki Yamaguchi)" <noreply@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:109976] [Ruby master Bug#9760] mkmf does not allow for linking against custom libraries when a system library is present
Date: Wed, 21 Sep 2022 10:56:27 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-99226.20220921105627.8057@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-9760.20140419221547.8057@ruby-lang.org

Issue #9760 has been updated by rhenium (Kazuki Yamaguchi).


This is still an issue in the current master (e.g., https://github.com/ruby/openssl/issues/545).

If I understand correctly, mkmf.rb prepends libruby's path solely to prevent picking up a wrong libruby. Since the exact path of the correct libruby is known, I wonder if it's possible for mkmf.rb to just use it instead of the `-L[...] -lruby` combo to achieve the same thing.

BTW, Python 3.8 made an interesting change in https://bugs.python.org/issue21536: if the platform allows, extensions don't link to libpython (don't use `-lpythonX.Y`) and leave symbols unresolved until at runtime.

----------------------------------------
Bug #9760: mkmf does not allow for linking against custom libraries when a system library is present
https://bugs.ruby-lang.org/issues/9760#change-99226

* Author: zanegray (Andrew DeMaria)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED
----------------------------------------
Hi,

Hopefully the title is not confusing, but the short story is that mkmf outputs a makefile that first searches the default lib path before searching any user provided lib paths. This is not an issue until one tries to link against an included library whose version is different than a preexisting system library.

The issue cropped up while trying to install the rugged gem (libgit2 wrapper) and a full dialog on the issue can be found on github https://github.com/libgit2/rugged/issues/351.

I was able to fix the issue with the attached patch (https://github.com/muff1nman/ruby/commit/a0c8bc32cfc11e61c5b9703bff243934c6509210)

---Files--------------------------------
fix_default_libpath.diff (1.2 KB)
early-libdir.patch (1.24 KB)


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

           reply	other threads:[~2022-09-21 10:56 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <redmine.issue-9760.20140419221547.8057@ruby-lang.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-99226.20220921105627.8057@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).