summaryrefslogtreecommitdiff
path: root/dln.c
AgeCommit message (Collapse)Author
2022-02-22[Feature #18249] Implement ABI checkingPeter Zhu
Header file include/ruby/internal/abi.h contains RUBY_ABI_VERSION which is the ABI version. This value should be bumped whenever an ABI incompatible change is introduced. When loading dynamic libraries, Ruby will compare its own `ruby_abi_version` and the `ruby_abi_version` of the loaded library. If these two values don't match it will raise a `LoadError`. This feature can also be turned off by setting the environment variable `RUBY_RUBY_ABI_CHECK=0`. This feature will prevent cases where previously installed native gems fail in unexpected ways due to incompatibility of changes in header files. This will force the developer to recompile their gems to use the same header files as the built Ruby. In Ruby, the ABI version is exposed through `RbConfig::CONFIG["ruby_abi_version"]`. Notes: Merged: https://github.com/ruby/ruby/pull/5474
2022-02-18Remove unused function declaration in dln.cPeter Zhu
getenv is no longer used in dln.c.
2022-02-17Refine the load error messageNobuyoshi Nakada
Show the linked ruby library name when failed to load extension built against different ruby library. Notes: Merged: https://github.com/ruby/ruby/pull/5564
2022-02-17Check running macOS version at runtimeNobuyoshi Nakada
2022-01-20Fix warningsKazuhiro NISHIYAMA
``` compiling ..../ruby/ruby/dln.c ..../ruby/ruby/dln.c:108:1: warning: unused function 'init_funcname_len' [-Wunused-function] init_funcname_len(const char **file) ^ ..../ruby/ruby/dln.c:122:19: warning: unused variable 'funcname_prefix' [-Wunused-const-variable] static const char funcname_prefix[sizeof(FUNCNAME_PREFIX) - 1] = FUNCNAME_PREFIX; ^ 2 warnings generated. ```
2022-01-19Refactor dln_load into dln_open and dln_symPeter Zhu
Refactor dln_load into dln_open and dln_sym to simplify the code for Windows and platforms that have dlopen. Notes: Merged: https://github.com/ruby/ruby/pull/5459
2022-01-18[Feature #18491] Drop support for HP-UXPeter Zhu
IA64 support was dropped in ticket #15894, so we can drop support for HP-UX. Notes: Merged: https://github.com/ruby/ruby/pull/5457
2022-01-14Drop support for OSX 10.3 and earlierPeter Zhu
dlopen was introduced in OSX 10.4, which was released in 2005. OSX 10.3 was EOL in 2007. Notes: Merged: https://github.com/ruby/ruby/pull/5440
2021-12-17dln.c: refine preprocessor conditions by USE_DLN_DLOPEN and _WIN32Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5284
2021-09-10dln.c: add missing dependency卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/4815
2021-05-07Protoized old pre-ANSI K&R style declarations and definitionsNobuyoshi Nakada
2021-03-24Removed dln_a_outNobuyoshi Nakada
a.out format is considered extinct nowadays. Notes: Merged: https://github.com/ruby/ruby/pull/4317 Merged-By: nobu <nobu@ruby-lang.org>
2021-03-24Fixed compilation errors when USE_DLN_A_OUTNobuyoshi Nakada
2020-05-11sed -i 's|ruby/impl|ruby/internal|'卜部昌平
To fix build failures. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-05-11sed -i s|ruby/3|ruby/impl|g卜部昌平
This shall fix compile errors. Notes: Merged: https://github.com/ruby/ruby/pull/3079
2020-04-08Merge pull request #2991 from shyouhei/ruby.h卜部昌平
Split ruby.h Notes: Merged-By: shyouhei <shyouhei@ruby-lang.org>
2020-02-07more on NULL versus functions.卜部昌平
Function pointers are not void*. See also ce4ea956d24eab5089a143bba38126f2b11b55b6 8427fca49bd85205f5a8766292dd893f003c0e48
2019-12-26decouple internal.h headers卜部昌平
Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies). Notes: Merged: https://github.com/ruby/ruby/pull/2711
2019-06-19Remove IA64 support.Samuel Williams
2018-07-30reduce copy & pasteshyouhei
We see several occurrence of "diagnostic push/pop" so why not make them macros. Tested on GCC8 / Clang 6. Note that ruby.h is intentionally left untouched because we don't want to introduce new public macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-09constifiednobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-03dln.c: dln_incompatible_library_pnobu
* dln.c (dln_incompatible_library_p): renamed as the error message with dln prefix, since it is not bound to xmalloc restrictively. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-03dln.c: xmalloc_mismatch_p with dlopennobu
* dln.c (xmalloc_mismatch_p): define only when using dlopen, otherwise dlsym is not available too, and should be used then. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-02include missing headershyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-02comparing function pointer versus void* is a GCCismshyouhei
However dlsym() requires such feature so this function is non- portable by nature. Cannot but suppress warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-26get rid of strcpynobu
* addr2line.c (follow_debuglink): insert global_debug_dir by using memmove instead of copying to temporary buffer. * dln.c (dln_load): use memcpy with the known length instead of strcpy. * gc.c (rb_gc_unprotect_logging): use strdup instead of malloc and strcpy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19dln.c: raise LoadErrornobu
* dln.c (dln_load): raise LoadError instead of fatal error on recent OSX, dlclose seems fixed in El Capitan or later. [ruby-core:78200] [Bug #12956] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-07dln.c: move error message definitionnobu
* dln.c (dln_load): move the definition of incompatible library version error message to be shared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-24Drop support for BeOSnobu
* beos: Drop support for BeOS now that Haiku is stable. [Fix GH-1112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-23Haiku now best effort supportnobu
* configure.in: remove obsolete workarounds for Haiku. * dln.c, file.c, io.c: remove obsolete Haiku workarounds. * thread_pthread.c: add stack bounds detection for Haiku. * signal.c: get stack pointer from signal context on Haiku. [ruby-core:67923] [Bug #10811] [Fix GH-1109] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18* dln.c: remove defined(__WATCOMC__).kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18* numeric.c: Good-by Borland-C.kosaki
* include/ruby/backward/rubyio.h: ditto. * include/ruby/backward/st.h: ditto. * include/ruby/backward/util.h: ditto. * include/ruby/backward/rubysig.h: ditto. * include/ruby/backward/classext.h: ditto. * dln.c: ditto. * gc.c: ditto. * win32/resource.rb: ditto. * win32/dir.h: ditto. * ext/tk/tcltklib.c: ditto. * NEWS: announce that Borland-C is no longer supported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-18* dln.c: simplify #ifdef. _WIN32 and __CYGWIN__ are exclusive.kosaki
see include/ruby/defines.h * gc.c: ditto. * ext/sdbm/_sdbm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-01dln.c: fix EXTERNAL_PREFIXnobu
* configure.in (EXPORT_PREFIX): revert r50410. * dln.c (EXTERNAL_PREFIX): define by predefined macros. configured EXPORT_PREFIX is different thing. * win32/Makefile.sub: r50414-50415. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-01dln.c: raise fatalnobu
* dln.c (dln_load): raise fatal error on OSX not other extension libraries to refer different libruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-01dln.c: check incompatible librubynobu
* dln.c (dln_load): check if a different libruby is loaded by the extension library, and then bail out to get rid of very frequent reported stale bug reports. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-01dln.c: use EXPORT_PREFIXnobu
* configure.in (EXPORT_PREFIX): define exported symbol prefix string in config.h. * dln.c (FUNCNAME_PREFIX): use configured EXPORT_PREFIX, not hardcoded condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-11Merges a patch form naclports.yugui
* configure.in (RUBY_NACL and others): Supports PNaCl. * dln.c: replace the old hacky dynamic loading over HTTP with nacl_io. * file.c: tenatively use access(2) instead of eaccess. (rb_file_load_ok): weaken with attribute but not by postprocess. * io.c (socket.h): now NaCl has socket.h (flock): disable here instead of nacl/ioctl.h * nacl/GNUmakefile.in (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY): respect path to them if they are absolute. This helps naclports to build ruby in their source tree. (PROGRAM_NMF, .SUFFIXES): support .pnexe for PNaCl. (ruby.o, file.o): move the hack to attributes in ruby.c and file.c * nacl/ioctl.h: removed. move the hack to io.c. * nacl/nacl-config.rb: support arm, pnacl and others. * nacl/pepper_main.c: support build in a naclports tree. * ruby.c (rb_load_file): weaken with attribute but not by postprocess. The patch is by sbc@google.com and the Native Client Authors. It is available at: * https://chromium.googlesource.com/external/naclports.git/+/873ca4910a5f9d4206306aacb4ed79c587c6a5f3/ports/ruby/nacl.patch git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-04* symbian/*: removed Symbian support.hsbt
[Feature #10199][ruby-core:64725] * dln.c: ditto. * include/ruby/defines.h: ditto. * thread_pthread.c: ditto. * vm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-05configure.in, missing.h: jemalloc manglingnobu
* configure.in (with-jemalloc): also check for header, for ABIs which JEMALLOC_MANGLE is needed, i.e., Mach-O and PE-COFF platforms. [ruby-core:62939] [Feature #9113] * include/ruby/missing.h: include alternative malloc header to replace memory management functions. * dln.c, io.c, parse.y, st.c: undef malloc family before re-definition to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-05dln.c: non-ascii path on Windowsnobu
* dln.c (dln_load): use wchar version to load a library in non-ascii path on Windows. based on the patch by Bugra Barin <bugrabarin AT hotmail.com> in [ruby-core:61845]. [Bug #9699] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-27adjust indent and stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-27use strlcatnobu
* addr2line.c (follow_debuglink): use strlcat instead of strncat. * dln.c (aix_loaderror): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01adjust style.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-09* dln.c: Simplify and make consistent an ifdef for Mac OS X.kosaki
* ext/socket/rubysocket.h: ditto. * ext/tk/stubs.c: ditto. * io.c: ditto. * process.c: ditto. * signal.c: ditto. * vm_dump.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-17Imports Ruby's port to NativeClient (a.k.a NaCl).yugui
Patch by Google Inc. [ruby-core:45073]. * configure.in (RUBY_NACL): New M4 func to configure variables for NaCl. (RUBY_NACL_CHECK_PEPPER_TYPES): New M4 func to check the old names of Pepper interface types. (BTESTRUBY): New variable to specify which ruby should be run on "make btest". NaCl can run the built binary by sel_ldr, but it need rbconfig.rb. So this variable is distinguished from $MINIRUBY. * thread_pthread.c: Disabled some features on NaCl. * io.c: ditto. * process.c: ditto. * signal.c: ditto. * file.c: ditto. * missing/flock.c: ditto. * nacl/pepper_main.c: An example implementation of Pepper application that embeds Ruby. * nacl/example.html: An example of web page that uses the Pepper application. * nacl/nacl-config.rb: Detects variants of NaCl SDK. * nacl/GNUmakefile.in: Makefile template for NaCl specific build process. * nacl/package.rb: script for packaging a NaCl-Ruby embedding application. * nacl/reate_nmf.rb: Wrapper script of create_nmf.py * dln.c (dln_load): Added a hack to call on NaCl. * util.c (ruby_getcwd): Path to the current directort is not available on NaCl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-17* dln.c (rb_w32_check_imported): skip ordinal entries. based on anobu
patch by phasis68 (Heesob Park) at [ruby-core:44381]. [ruby-core:44371][Bug #6303] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-16* dln.c (rb_w32_check_imported): skip ordinal entries. patched bynobu
phasis68 (Heesob Park) at [ruby-core:44381]. [Bug #6303] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-25* include/ruby/defines.h: use "__sparc" instead of "sparc" andakr
"__sparc__". * dln.c: ditto. [ruby-dev:44694] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24* io.c: use "__sun" instead of "sun" to detect SunOS.akr
* dln.c: ditto. * cont.c: ditto. * ext/sdbm/_sdbm.c: ditto. [ruby-dev:44693] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e