Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update luajit to luajit2 #433

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions third_party/luajit/luajit/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.relver export-subst
3 changes: 3 additions & 0 deletions third_party/luajit/luajit/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
*.dmp
*.swp
.tags
*~
tags
*.swo
1 change: 1 addition & 0 deletions third_party/luajit/luajit/.relver
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$Format:%ct$
61 changes: 61 additions & 0 deletions third_party/luajit/luajit/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
sudo: required
dist: bionic

branches:
only:
- "v2.1-agentzh"

os: linux
arch:
- amd64
- arm64
- s390x

language: c

compiler:
- gcc

addons:
apt:
packages:
- axel
- cpanminus
- libtest-base-perl
- libtext-diff-perl
- libtest-longstring-perl
- liblist-moreutils-perl
- libparallel-forkmanager-perl
- libgd-dev
- libmpc-dev
- build-essential
- libgtk2.0-dev
- valgrind

env:
global:
- JOBS=3
- LUAJIT_PREFIX=/opt/luajit21
- LUAJIT_SYSM_PREFIX=/opt/luajit21-sysm
- LUAJIT_COMMON_XCFLAGS="-DLUA_USE_APICHECK -DLUA_USE_ASSERT -DLUAJIT_NUMMODE=2 -O1"
- LUAJIT_COMMON_XCFLAGS=$( [ ${TRAVIS_CPU_ARCH} == "amd64" ] && echo "$LUAJIT_COMMON_XCFLAGS -msse4.2" || echo "$LUAJIT_COMMON_XCFLAGS" )

matrix:
- LUAJIT_XCFLAGS="$LUAJIT_COMMON_XCFLAGS"
- LUAJIT_XCFLAGS="-DLUAJIT_ENABLE_LUA52COMPAT $LUAJIT_COMMON_XCFLAGS" LUA52=1
- LUAJIT_XCFLAGS="-DLUAJIT_USE_VALGRIND -DLUAJIT_USE_SYSMALLOC -DLUAJIT_ENABLE_LUA52COMPAT $LUAJIT_COMMON_XCFLAGS" LUA52=1 FLAGS=$( [ ${TRAVIS_CPU_ARCH} != "s390x" ] && echo '-v' )
- LUAJIT_XCFLAGS="-DLUAJIT_DISABLE_GC64 -DLUAJIT_ENABLE_LUA52COMPAT $LUAJIT_COMMON_XCFLAGS" LUA52=1

install:
- git clone https://github.com/openresty/luajit2-test-suite.git ../luajit2-test-suite

script:
- echo ${LUAJIT_COMMON_XCFLAGS}
- valgrind --version
- /usr/bin/env perl $(command -v cpanm) --sudo --notest IPC::Run3 Test::Base Test::LongString Parallel::ForkManager > build.log 2>&1 || (cat build.log && exit 1)
- cd ../luajit2
- make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS="$LUAJIT_XCFLAGS" > build.log 2>&1 || (cat build.log && exit 1)
- sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1)
- if [ ${TRAVIS_CPU_ARCH} == "amd64" ]; then PATH=/opt/luajit21/bin:$PATH prove -I. t; fi
- cd ../luajit2-test-suite
- ./run-tests -j 1 $FLAGS $LUAJIT_PREFIX
6 changes: 5 additions & 1 deletion third_party/luajit/luajit/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
===============================================================================
LuaJIT -- a Just-In-Time Compiler for Lua. https://luajit.org/

Copyright (C) 2005-2022 Mike Pall. All rights reserved.
Copyright (C) 2005-2023 Mike Pall. All rights reserved.

Copyright (C) 2017-2018 Yichun Zhang. All rights reserved.

Copyright (C) 2017-2018 OpenResty Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
45 changes: 24 additions & 21 deletions third_party/luajit/luajit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@
# For MSVC, please follow the instructions given in src/msvcbuild.bat.
# For MinGW and Cygwin, cd to src and run make with the Makefile there.
#
# Copyright (C) 2005-2022 Mike Pall. See Copyright Notice in luajit.h
# Copyright (C) 2005-2023 Mike Pall. See Copyright Notice in luajit.h
##############################################################################

MAJVER= 2
MINVER= 1
RELVER= 0
PREREL= -beta3
VERSION= $(MAJVER).$(MINVER).$(RELVER)$(PREREL)
ABIVER= 5.1

# LuaJIT uses rolling releases. The release version is based on the time of
# the latest git commit. The 'git' command must be available during the build.
RELVER= $(shell cat src/luajit_relver.txt 2>/dev/null || : )
# Note: setting it with := doesn't work, since it will change during the build.

MMVERSION= $(MAJVER).$(MINVER)
VERSION= $(MMVERSION).$(RELVER)

##############################################################################
#
# Change the installation path as needed. This automatically adjusts
Expand All @@ -33,10 +38,10 @@ DPREFIX= $(DESTDIR)$(PREFIX)
INSTALL_BIN= $(DPREFIX)/bin
INSTALL_LIB= $(DPREFIX)/$(MULTILIB)
INSTALL_SHARE= $(DPREFIX)/share
INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MAJVER).$(MINVER)
INSTALL_DEFINC= $(DPREFIX)/include/luajit-$(MMVERSION)
INSTALL_INC= $(INSTALL_DEFINC)

INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(VERSION)
INSTALL_LJLIBD= $(INSTALL_SHARE)/luajit-$(MMVERSION)
INSTALL_JITLIB= $(INSTALL_LJLIBD)/jit
INSTALL_LMODD= $(INSTALL_SHARE)/lua
INSTALL_LMOD= $(INSTALL_LMODD)/$(ABIVER)
Expand All @@ -50,10 +55,10 @@ INSTALL_TSYMNAME= luajit
INSTALL_ANAME= libluajit-$(ABIVER).a
INSTALL_SOSHORT1= libluajit-$(ABIVER).so
INSTALL_SOSHORT2= libluajit-$(ABIVER).so.$(MAJVER)
INSTALL_SONAME= $(INSTALL_SOSHORT2).$(MINVER).$(RELVER)
INSTALL_SONAME= libluajit-$(ABIVER).so.$(VERSION)
INSTALL_DYLIBSHORT1= libluajit-$(ABIVER).dylib
INSTALL_DYLIBSHORT2= libluajit-$(ABIVER).$(MAJVER).dylib
INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).$(MINVER).$(RELVER).dylib
INSTALL_DYLIBNAME= libluajit-$(ABIVER).$(VERSION).dylib
INSTALL_PCNAME= luajit.pc

INSTALL_STATIC= $(INSTALL_LIB)/$(INSTALL_ANAME)
Expand All @@ -78,7 +83,8 @@ INSTALL_F= install -m 0644
UNINSTALL= $(RM)
LDCONFIG= ldconfig -n 2>/dev/null
SED_PC= sed -e "s|^prefix=.*|prefix=$(PREFIX)|" \
-e "s|^multilib=.*|multilib=$(MULTILIB)|"
-e "s|^multilib=.*|multilib=$(MULTILIB)|" \
-e "s|^relver=.*|relver=$(RELVER)|"
ifneq ($(INSTALL_DEFINC),$(INSTALL_INC))
SED_PC+= -e "s|^includedir=.*|includedir=$(INSTALL_INC)|"
endif
Expand All @@ -92,7 +98,9 @@ FILES_INC= lua.h lualib.h lauxlib.h luaconf.h lua.hpp luajit.h
FILES_JITLIB= bc.lua bcsave.lua dump.lua p.lua v.lua zone.lua \
dis_x86.lua dis_x64.lua dis_arm.lua dis_arm64.lua \
dis_arm64be.lua dis_ppc.lua dis_mips.lua dis_mipsel.lua \
dis_mips64.lua dis_mips64el.lua vmdef.lua
dis_mips64.lua dis_mips64el.lua \
dis_mips64r6.lua dis_mips64r6el.lua \
vmdef.lua

ifeq (,$(findstring Windows,$(OS)))
HOST_SYS:= $(shell uname -s)
Expand All @@ -113,9 +121,9 @@ endif
INSTALL_DEP= src/luajit

default all $(INSTALL_DEP):
@echo "==== Building LuaJIT $(VERSION) ===="
@echo "==== Building LuaJIT $(MMVERSION) ===="
$(MAKE) -C src
@echo "==== Successfully built LuaJIT $(VERSION) ===="
@echo "==== Successfully built LuaJIT $(MMVERSION) ===="

install: $(INSTALL_DEP)
@echo "==== Installing LuaJIT $(VERSION) to $(PREFIX) ===="
Expand All @@ -134,18 +142,12 @@ install: $(INSTALL_DEP)
$(RM) $(FILE_PC).tmp
cd src && $(INSTALL_F) $(FILES_INC) $(INSTALL_INC)
cd src/jit && $(INSTALL_F) $(FILES_JITLIB) $(INSTALL_JITLIB)
$(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)
@echo "==== Successfully installed LuaJIT $(VERSION) to $(PREFIX) ===="
@echo ""
@echo "Note: the development releases deliberately do NOT install a symlink for luajit"
@echo "You can do this now by running this command (with sudo):"
@echo ""
@echo " $(SYMLINK) $(INSTALL_TNAME) $(INSTALL_TSYM)"
@echo ""


uninstall:
@echo "==== Uninstalling LuaJIT $(VERSION) from $(PREFIX) ===="
$(UNINSTALL) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)
$(UNINSTALL) $(INSTALL_TSYM) $(INSTALL_T) $(INSTALL_STATIC) $(INSTALL_DYN) $(INSTALL_SHORT1) $(INSTALL_SHORT2) $(INSTALL_MAN)/$(FILE_MAN) $(INSTALL_PC)
for file in $(FILES_JITLIB); do \
$(UNINSTALL) $(INSTALL_JITLIB)/$$file; \
done
Expand All @@ -159,8 +161,9 @@ uninstall:
##############################################################################

amalg:
@echo "Building LuaJIT $(VERSION)"
@echo "==== Building LuaJIT $(MMVERSION) (amalgamation) ===="
$(MAKE) -C src amalg
@echo "==== Successfully built LuaJIT $(MMVERSION) (amalgamation) ===="

clean:
$(MAKE) -C src clean
Expand Down
6 changes: 3 additions & 3 deletions third_party/luajit/luajit/README
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
README for LuaJIT 2.1.0-beta3
-----------------------------
README for LuaJIT 2.1
---------------------

LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language.

Project Homepage: https://luajit.org/

LuaJIT is Copyright (C) 2005-2022 Mike Pall.
LuaJIT is Copyright (C) 2005-2023 Mike Pall.
LuaJIT is free software, released under the MIT license.
See full Copyright Notice in the COPYRIGHT file or in luajit.h.

Expand Down
Loading