summaryrefslogtreecommitdiff
path: root/dln.c
Commit message (Collapse)AuthorAgeFilesLines
* Update dln.c to fix error output from `dln_open()`drew-wells2023-03-211-0/+6
| | | | | `libruby_name` gets trashed by `dlclose(handle)`, so output the "linked to incompatible ... " error before calling `dlclose(handle)`.
* Fix and improve coroutines for Darwin (macOS) ppc/ppc64. (#5975)Sergey Fedorov2022-10-191-1/+5
|
* Fix possible use of undefined macros on very old macOS [ci skip]Nobuyoshi Nakada2022-10-171-4/+4
|
* Expand tabs [ci skip]Takashi Kokubun2022-07-211-77/+77
| | | | [Misc #18891]
* Show ABI incompatible binary pathNobuyoshi Nakada2022-07-171-1/+1
|
* [Bug #18879] Fix macOS version detectionsNobuyoshi Nakada2022-06-271-4/+15
| | | | | | macOS's AvailabilityMacros.h does not contain macros for future versions. If a version macro is not defined, consider only earlier versions to be targeted.
* Only define RUBY_DLN_CHECK_ABI when supportedPeter Zhu2022-03-011-2/+2
|
* ABI checking is not supported on WindowsPeter Zhu2022-03-011-1/+1
|
* dln.c: suppress unused function 'abi_check_enabled_p' warning for wasiYuta Saito2022-03-011-1/+1
|
* [Feature #18249] Implement ABI checkingPeter Zhu2022-02-221-0/+17
| | | | | | | | | | | | | | | | | | | | 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"]`.
* Remove unused function declaration in dln.cPeter Zhu2022-02-181-4/+0
| | | | getenv is no longer used in dln.c.
* Refine the load error messageNobuyoshi Nakada2022-02-171-5/+27
| | | | | Show the linked ruby library name when failed to load extension built against different ruby library.
* Check running macOS version at runtimeNobuyoshi Nakada2022-02-171-8/+27
|
* Fix warningsKazuhiro NISHIYAMA2022-01-201-0/+2
| | | | | | | | | | | | | ``` 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. ```
* Refactor dln_load into dln_open and dln_symPeter Zhu2022-01-191-76/+81
| | | | | Refactor dln_load into dln_open and dln_sym to simplify the code for Windows and platforms that have dlopen.
* [Feature #18491] Drop support for HP-UXPeter Zhu2022-01-181-31/+0
| | | | | IA64 support was dropped in ticket #15894, so we can drop support for HP-UX.
* Drop support for OSX 10.3 and earlierPeter Zhu2022-01-141-54/+2
| | | | | dlopen was introduced in OSX 10.4, which was released in 2005. OSX 10.3 was EOL in 2007.
* dln.c: refine preprocessor conditions by USE_DLN_DLOPEN and _WIN32Nobuyoshi Nakada2021-12-171-5/+3
|
* dln.c: add missing dependency卜部昌平2021-09-101-0/+1
|
* Protoized old pre-ANSI K&R style declarations and definitionsNobuyoshi Nakada2021-05-071-8/+8
|
* Removed dln_a_outNobuyoshi Nakada2021-03-241-1001/+1
| | | a.out format is considered extinct nowadays.
* Fixed compilation errors when USE_DLN_A_OUTNobuyoshi Nakada2021-03-241-37/+66
|
* sed -i 's|ruby/impl|ruby/internal|'卜部昌平2020-05-111-1/+1
| | | | To fix build failures.
* sed -i s|ruby/3|ruby/impl|g卜部昌平2020-05-111-1/+1
| | | | This shall fix compile errors.
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-081-1/+1
| | | Split ruby.h
* more on NULL versus functions.卜部昌平2020-02-071-1/+2
| | | | | | Function pointers are not void*. See also ce4ea956d24eab5089a143bba38126f2b11b55b6 8427fca49bd85205f5a8766292dd893f003c0e48
* decouple internal.h headers卜部昌平2019-12-261-0/+2
| | | | | | | | | | | | | | | | | | 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).
* Remove IA64 support.Samuel Williams2019-06-191-2/+2
|
* reduce copy & pasteshyouhei2018-07-301-11/+4
| | | | | | | | | | | 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
* constifiednobu2018-01-091-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dln.c: dln_incompatible_library_pnobu2018-01-031-5/+3
| | | | | | | * 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
* dln.c: xmalloc_mismatch_p with dlopennobu2018-01-031-1/+3
| | | | | | | * 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
* include missing headershyouhei2018-01-021-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* comparing function pointer versus void* is a GCCismshyouhei2018-01-021-2/+22
| | | | | | | 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
* get rid of strcpynobu2016-12-261-2/+2
| | | | | | | | | | | | | * 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
* dln.c: raise LoadErrornobu2016-11-191-1/+3
| | | | | | | | * 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
* dln.c: move error message definitionnobu2016-04-071-2/+4
| | | | | | | * 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
* Drop support for BeOSnobu2015-11-241-52/+0
| | | | | | | * 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
* Haiku now best effort supportnobu2015-11-231-3/+3
| | | | | | | | | | * 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
* * dln.c: remove defined(__WATCOMC__).kosaki2015-10-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c: Good-by Borland-C.kosaki2015-10-181-1/+1
| | | | | | | | | | | | | | | | * 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
* * dln.c: simplify #ifdef. _WIN32 and __CYGWIN__ are exclusive.kosaki2015-10-181-3/+3
| | | | | | | | 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
* dln.c: fix EXTERNAL_PREFIXnobu2015-05-011-2/+7
| | | | | | | | | | | * 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
* dln.c: raise fatalnobu2015-05-011-2/+4
| | | | | | | * 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
* dln.c: check incompatible librubynobu2015-05-011-0/+15
| | | | | | | | * 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
* dln.c: use EXPORT_PREFIXnobu2015-05-011-7/+1
| | | | | | | | | | * 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
* Merges a patch form naclports.yugui2014-10-111-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | * 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
* * symbian/*: removed Symbian support.hsbt2014-09-041-5/+0
| | | | | | | | | | [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
* configure.in, missing.h: jemalloc manglingnobu2014-06-051-0/+1
| | | | | | | | | | | | * 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
* dln.c: non-ascii path on Windowsnobu2014-04-051-5/+10
| | | | | | | | * 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