Feature #4946

Building libruby-static.a with option nodynamic and --with-static-link-ext doesn't disable dlopen

Added by Alex Young about 4 years ago. Updated almost 3 years ago.

[ruby-core:37676]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada

Description

I uncomment option nodynamic in ext/Setup and run ./configure --with-static-link-ext, then make libruby-static.a

I then compile this:

/* trial.c */
#include "ruby.h"
int main(){
ruby_init();
return 0;
}

like so:

gcc -c trial.c -o trial.o -Iruby-1.9.2-p180/include -Iruby-1.9.2-p180/.ext/include/i686-linux
gcc -static trial.o -Lruby-1.9.2-p180 -lruby-static -lpthread -lrt -ldl -lcrypt -lm -o trial

And I see this warning:

ruby-1.9.2-p180/libruby-static.a(dln.o): In function `dln_load':
/home/alex/projects/scratch/ruby/ruby-1.9.2-p180/dln.c:1276: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

I specifically do not want any run-time code loading capability, but I can see no documented way to disable dlopen; is there any way to silence this warning?

Associated revisions

Revision 37821
Added by Nobuyoshi Nakada almost 3 years ago

configure.in: --disable-dln

  • configure.in (--disable-dln): option to disable dynamic linking feature. [Feature #4946]

Revision 37821
Added by Nobuyoshi Nakada almost 3 years ago

configure.in: --disable-dln

  • configure.in (--disable-dln): option to disable dynamic linking feature. [Feature #4946]

History

#1 Updated by Nobuyoshi Nakada about 4 years ago

  • Tracker changed from Bug to Feature

There is no way to disable dynamic loading now.
--with-static-linked-ext just let all bundled extension libraries linked statically.

#2 Updated by Yui NARUSE about 4 years ago

  • Target version changed from 1.9.2 to 2.0.0

#3 Updated by Yusuke Endoh over 3 years ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada
  • Priority changed from Normal to 3

#4 Updated by Nobuyoshi Nakada almost 3 years ago

  • Status changed from Assigned to Feedback

Can't you disable it with the following?
ac_cv_func_dlopen=no configure

#5 Updated by Nobuyoshi Nakada almost 3 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r37821.
Alex, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


configure.in: --disable-dln

  • configure.in (--disable-dln): option to disable dynamic linking feature. [Feature #4946]

Also available in: Atom PDF