Skip to content

Commit 7271374

Browse files
committed
Add script to make compat53 header generation reproducible
1 parent 3968c17 commit 7271374

5 files changed

Lines changed: 15 additions & 12 deletions

File tree

luas/generate_compat53_headers.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
xxd -i ./lua-compat-5.3/compat53/file_mt.lua ./lua-compat-headers/compat53_file_mt.h
2+
xxd -i ./lua-compat-5.3/compat53/init.lua ./lua-compat-headers/compat53_init.h
3+
xxd -i ./lua-compat-5.3/compat53/module.lua ./lua-compat-headers/compat53_module.h

luas/lua-compat-headers/compat53_file_mt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unsigned char lua_compat_5_3_compat53_file_mt_lua[] = {
1+
unsigned char __lua_compat_5_3_compat53_file_mt_lua[] = {
22
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6c, 0x75, 0x61, 0x5f, 0x76, 0x65,
33
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x5f, 0x56, 0x45, 0x52,
44
0x53, 0x49, 0x4f, 0x4e, 0x3a, 0x73, 0x75, 0x62, 0x28, 0x2d, 0x33, 0x29,
@@ -163,4 +163,4 @@ unsigned char lua_compat_5_3_compat53_file_mt_lua[] = {
163163
0x6e, 0x64, 0x0a, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d,
164164
0x0a
165165
};
166-
unsigned int lua_compat_5_3_compat53_file_mt_lua_len = 1945;
166+
unsigned int __lua_compat_5_3_compat53_file_mt_lua_len = 1945;

luas/lua-compat-headers/compat53_init.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unsigned char lua_compat_5_3_compat53_init_lua[] = {
1+
unsigned char __lua_compat_5_3_compat53_init_lua[] = {
22
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6c, 0x75, 0x61, 0x5f, 0x76, 0x65,
33
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x5f, 0x56, 0x45, 0x52,
44
0x53, 0x49, 0x4f, 0x4e, 0x3a, 0x73, 0x75, 0x62, 0x28, 0x2d, 0x33, 0x29,
@@ -997,4 +997,4 @@ unsigned char lua_compat_5_3_compat53_init_lua[] = {
997997
0x74, 0x6f, 0x70, 0x3d, 0x33, 0x20, 0x73, 0x68, 0x69, 0x66, 0x74, 0x77,
998998
0x69, 0x64, 0x74, 0x68, 0x3d, 0x33, 0x20, 0x3a, 0x0a
999999
};
1000-
unsigned int lua_compat_5_3_compat53_init_lua_len = 11961;
1000+
unsigned int __lua_compat_5_3_compat53_init_lua_len = 11961;

luas/lua-compat-headers/compat53_module.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unsigned char lua_compat_5_3_compat53_module_lua[] = {
1+
unsigned char __lua_compat_5_3_compat53_module_lua[] = {
22
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x5f, 0x47, 0x2c, 0x20, 0x5f, 0x56,
33
0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x20, 0x3d, 0x20, 0x5f, 0x47, 0x2c,
44
0x20, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x0a, 0x6c, 0x6f,
@@ -2340,4 +2340,4 @@ unsigned char lua_compat_5_3_compat53_module_lua[] = {
23402340
0x73, 0x68, 0x69, 0x66, 0x74, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x33,
23412341
0x20, 0x3a, 0x0a
23422342
};
2343-
unsigned int lua_compat_5_3_compat53_module_lua_len = 28071;
2343+
unsigned int __lua_compat_5_3_compat53_module_lua_len = 28071;

luas/luajit.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ static void preload_compat53(lua_State *L) {
3939
lua_getglobal(L, "package");
4040
lua_getfield(L, -1, "preload");
4141

42-
luaL_loadbuffer(L, (const char*)lua_compat_5_3_compat53_init_lua,
43-
lua_compat_5_3_compat53_init_lua_len, "compat53");
42+
luaL_loadbuffer(L, (const char*)__lua_compat_5_3_compat53_init_lua,
43+
__lua_compat_5_3_compat53_init_lua_len, "compat53");
4444
lua_setfield(L, -2, "compat53");
4545

46-
luaL_loadbuffer(L, (const char*)lua_compat_5_3_compat53_module_lua,
47-
lua_compat_5_3_compat53_module_lua_len, "compat53.module");
46+
luaL_loadbuffer(L, (const char*)__lua_compat_5_3_compat53_module_lua,
47+
__lua_compat_5_3_compat53_module_lua_len, "compat53.module");
4848
lua_setfield(L, -2, "compat53.module");
4949

50-
luaL_loadbuffer(L, (const char*)lua_compat_5_3_compat53_file_mt_lua,
51-
lua_compat_5_3_compat53_file_mt_lua_len, "compat53.file_mt");
50+
luaL_loadbuffer(L, (const char*)__lua_compat_5_3_compat53_file_mt_lua,
51+
__lua_compat_5_3_compat53_file_mt_lua_len, "compat53.file_mt");
5252
lua_setfield(L, -2, "compat53.file_mt");
5353

5454
lua_pop(L, 2);

0 commit comments

Comments
 (0)