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"]`.
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).
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
* 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): 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
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
* 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 (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
* 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
* 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 (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
* 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:
* 873ca4910a/ports/ruby/nacl.patch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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 (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
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