Module: Rubycc
- Defined in:
- lib/rubygems_plugin.rb,
lib/rubycc.rb,
lib/rubycc/type.rb,
lib/rubycc/ir/ir.rb,
lib/rubycc/doctor.rb,
lib/rubycc/driver.rb,
lib/rubycc/version.rb,
lib/rubycc/compiler.rb,
lib/rubycc/front/ast.rb,
lib/rubycc/mkmf_shim.rb,
lib/rubycc/rmake/cli.rb,
lib/rubycc/doctor/cli.rb,
lib/rubycc/front/lexer.rb,
lib/rubycc/front/token.rb,
lib/rubycc/link/errors.rb,
lib/rubycc/pkgconf/cli.rb,
lib/rubycc/rmake/model.rb,
lib/rubycc/front/parser.rb,
lib/rubycc/ir/generator.rb,
lib/rubycc/rmake/errors.rb,
lib/rubycc/rmake/parser.rb,
lib/rubycc/compile_error.rb,
lib/rubycc/pkgconf/model.rb,
lib/rubycc/backend/x86_64.rb,
lib/rubycc/doctor/builder.rb,
lib/rubycc/doctor/fetcher.rb,
lib/rubycc/doctor/gemfile.rb,
lib/rubycc/pkgconf/errors.rb,
lib/rubycc/pkgconf/parser.rb,
lib/rubycc/rmake/executor.rb,
lib/rubycc/rmake/expander.rb,
lib/rubycc/rmake/makefile.rb,
lib/rubycc/backend/aarch64.rb,
lib/rubycc/pkgconf/resolver.rb,
lib/rubycc/ir/call_convention.rb,
lib/rubycc/link/shared_linker.rb,
lib/rubycc/objfile/ar_archive.rb,
lib/rubycc/objfile/elf_reader.rb,
lib/rubycc/objfile/elf_writer.rb,
lib/rubycc/preprocess/scanner.rb,
lib/rubycc/front/lexeme_reader.rb,
lib/rubycc/link/compat_runtime.rb,
lib/rubycc/link/partial_linker.rb,
lib/rubycc/pkgconf/search_path.rb,
lib/rubycc/preprocess/pp_token.rb,
lib/rubycc/doctor/verified_gems.rb,
lib/rubycc/link/library_resolver.rb,
lib/rubycc/link/executable_linker.rb,
lib/rubycc/preprocess/preprocessor.rb,
lib/rubycc/front/constant_evaluator.rb,
lib/rubycc/preprocess/glibc_version.rb,
lib/rubycc/front/initializer_resolver.rb,
lib/rubycc/objfile/relocatable_writer.rb,
lib/rubycc/pkgconf/system_path_filter.rb,
lib/rubycc/preprocess/token_converter.rb,
lib/rubycc/preprocess/constant_expression.rb
Overview
The mkmf integration shim: requiring this file (before require "mkmf")
reroutes every conftest command mkmf issues — compile, link, preprocess — to
rubycc, without patching mkmf itself. mkmf builds its probe commands out of a
handful of RbConfig keys ($(CC), $(LDSHARED), $(CPP), $(PKG_CONFIG))
and runs them through system(env, *command), so replacing just those keys
with the rubycc executables makes have_header, have_func, have_library,
try_compile/try_link/try_run, check_sizeof and the rest resolve
against rubycc's own compiler and linker. mkmf.log stays untouched — mkmf
writes it — so the log's format (the "checked program was:" sections, the
echoed command lines) is the genuine article.
Two RbConfig hashes are rewritten: CONFIG, which mkmf merges into every
conftest command's expansion context, and MAKEFILE_CONFIG, which the generated
Makefile's CC = …/LDSHARED = … assignments are drawn from — so both the
probe phase and the eventual build route through rubycc. The change is
in-process only (no file on disk is modified) and idempotent: requiring the
shim twice is a no-op.
The rubycc executables shebang-launch require "rubycc", which needs the
repository's lib/ on the load path when rubycc is run from a checkout rather
than an installed gem. The shim prepends that directory to RUBYLIB so the
value propagates to the child processes mkmf spawns.
Defined Under Namespace
Modules: Backend, Doctor, Front, GemPlugin, IR, Link, MkmfShim, ObjFile, Pkgconf, Preprocess, Rmake, Type Classes: CompileError, Compiler, Driver, Error
Constant Summary collapse
- VERSION =
"1.0.0"