[Tarantool-patches] [PATCH luajit 1/3][v2] Add 'cc' file type for saving bytecode.

Sergey Bronnikov estetus at gmail.com
Thu Nov 9 16:08:11 MSK 2023


From: Mike Pall <mike>

Contributed by Sergey Bronnikov. #1105

(cherry picked from commit e826d0c101d750fac8334d71e221c50d8dbe236c)

The patch adds a file type `cc` that allows exporting byte code directly
to a file with extension `.cc`.

Sergey Bronnikov:
* added the description

Part of tarantool/tarantool#9145
---
 doc/running.html   | 3 ++-
 src/jit/bcsave.lua | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/doc/running.html b/doc/running.html
index 666b0abc..7868efab 100644
--- a/doc/running.html
+++ b/doc/running.html
@@ -124,7 +124,8 @@ file name:
 </p>
 <ul>
 <li><tt>c</tt> — C source file, exported bytecode data.</li>
-<li><tt>h</tt> — C header file, static bytecode data.</li>
+<li><tt>cc</tt> — C++ source file, exported bytecode data.</li>
+<li><tt>h</tt> — C/C++ header file, static bytecode data.</li>
 <li><tt>obj</tt> or <tt>o</tt> — Object file, exported bytecode data
 (OS- and architecture-specific).</li>
 <li><tt>raw</tt> or any other extension — Raw bytecode file (portable).
diff --git a/src/jit/bcsave.lua b/src/jit/bcsave.lua
index 41081184..48b2329c 100644
--- a/src/jit/bcsave.lua
+++ b/src/jit/bcsave.lua
@@ -37,7 +37,7 @@ Save LuaJIT bytecode: luajit -b[options] input output
   --        Stop handling options.
   -         Use stdin as input and/or stdout as output.
 
-File types: c h obj o raw (default)
+File types: c cc h obj o raw (default)
 ]]
   os.exit(1)
 end
@@ -63,7 +63,7 @@ end
 ------------------------------------------------------------------------------
 
 local map_type = {
-  raw = "raw", c = "c", h = "h", o = "obj", obj = "obj",
+  raw = "raw", c = "c", cc = "c", h = "h", o = "obj", obj = "obj",
 }
 
 local map_arch = {
-- 
2.34.1



More information about the Tarantool-patches mailing list