Skip to content

Commit 5d5679d

Browse files
committed
Forward-port macOS LuaJIT port fixes to 2026-07-20_1
Upstream's LuaJIT bump adds vcpkg-ports/ports/luajit/2026-07-20_1 and points the filesystem-registry baseline at it. That directory is byte-identical to 2025-07-24_1 apart from lacking the macOS fixes this fork carries, so they would have silently stopped applying on the next build without any textual merge conflict. Restore all three in the new port: - configure: pin the installed tool symlink via INSTALL_TSYMNAME so it doesn't collide with an existing target on the osx triplet. - configure: restore the executable bit; portfile.cmake file(COPY)s the script into the source tree and the make step invokes it directly. Upstream's own 2025-07-24_1 shipped it 100755. - pob-wide-crt.patch: make _lua_getenvcopy null-safe, since strdup(NULL) on an unset env var is UB, and cast in _lua_getenvfree so free() doesn't discard a const qualifier. Both files are now byte-identical to their 2025-07-24_1 counterparts. Not build-verified: a CMake rebuild is the real test.
1 parent 5676d74 commit 5d5679d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

vcpkg-ports/ports/luajit/2026-07-20_1/configure

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ all:
7777
done
7878
7979
install:
80-
\$(MAKE) install \$(COMMON_OPTIONS)
80+
\$(MAKE) install \$(COMMON_OPTIONS) 'INSTALL_TSYMNAME=luajit-lnk'
8181
for DA in \$(DASM_ARCHS); do \\
8282
mkdir -p "\$\${DESTDIR}\$(BUILDVM_PREFIX)"; \\
8383
install -m 0755 "src/host/buildvm-\$\$DA\$(EXECUTABLE_SUFFIX)" "\$\${DESTDIR}\$(BUILDVM_PREFIX)/buildvm-\$\$DA\$(EXECUTABLE_SUFFIX)" || exit 1 ; \\

vcpkg-ports/ports/luajit/2026-07-20_1/pob-wide-crt.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ index 00000000..72e9ccae
393393
+char* _lua_tmpnam();
394394
+#else
395395
+#define _lua_fopen(path, mode) fopen(path, mode)
396-
+#define _lua_getenvcopy(name) strdup(getenv(name))
397-
+#define _lua_getenvfree(name) free(name)
396+
+#define _lua_getenvcopy(name) ({ char const* _lua_ev = getenv(name); _lua_ev ? strdup(_lua_ev) : (char*)0; })
397+
+#define _lua_getenvfree(name) free((void*)(name))
398398
+#define _lua_remove(path) remove(path)
399399
+#define _lua_rename(oldpath, newpath) rename(oldpath, newpath)
400400
+#define _lua_system(cmd) system(cmd)

0 commit comments

Comments
 (0)