From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id D921C6F3C7; Fri, 26 Mar 2021 14:01:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D921C6F3C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616756509; bh=GFHShHUeDN/cDELr+A7y1f8TGfIHIBuYV3diMTwtW5M=; h=In-Reply-To:Date:References:To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Ox7T6fdoTQ+uYIFsCWDhz8bkjgpW5UpFY2pXedThSwCMRAFK6T96OFizW1lkptB4Z nqwNb3q9Xvw6x7iOl+0L6MR3GyBHDYKODj3dyBUM3WtOCUGaxU/+z5m376LVNpjTWx E3uK8iiX/jrpXdFYGHNBjGFE98jkPk0SlUoCHpLc= Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id CC2956F3C7 for ; Fri, 26 Mar 2021 14:01:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CC2956F3C7 Received: by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1lPkDr-0002C9-Tn; Fri, 26 Mar 2021 14:01:48 +0300 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) In-Reply-To: Date: Fri, 26 Mar 2021 14:01:46 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <9449408D-55CC-48EF-82EC-B798584C47D5@tarantool.org> References: To: Sergey Kaplun X-Mailer: Apple Mail (2.3654.60.0.2.21) X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9064ADF4728AA0EE9F947F818E4E5150DE0627C7B5DF808F3182A05F538085040241CEBE67D51206E3AF01F80F3D2150CC493F0C844E0070AB8CEA96DB75D7D14 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71BF69A9C8C5AF260EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063700B087299B9BE63E8638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C5DD32608FC869F5D7B8C1744D956CA169E3BB647C0790F8FA471835C12D1D9774AD6D5ED66289B5278DA827A17800CE77A825AB47F0FC8649FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3E97D2AE7161E217F117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947C0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E73589424AA0EF8DE9BAC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A57E361B365CCE8810489235BD29EDAB650ABC2455534B32C5D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34351729636A02D1DE3D286B25BE38EF80528BAF45CEC52DE53FF2B17137AEDB89CDC22BBED1CFEB3B1D7E09C32AA3244C3540E21B24D21220431459E6449931054DBEAD0ED6C55A80FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojapPp7P/VpAieahw9QlZ1sQ== X-Mailru-Sender: 3B9A0136629DC912F4AABCEFC589C81EA21359B3BFA20A1BD8FBB3A1D3579D8D1F51AE7C4DEFF4A1AD07DD1419AC565FA614486B47F28B67C5E079CCF3B0523AED31B7EB2E253A9E112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 02/30] test: add compiling for C libs from PUC-Rio-Lua5.1 X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Ostanevich via Tarantool-patches Reply-To: Sergey Ostanevich Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" LGTM. > On 26 Mar 2021, at 10:42, Sergey Kaplun wrote: >=20 > This patch adds commands to create additional LuaC libraries for tests > in . Also, it renames `luaL_reg` to `luaL_Reg` in > and to be consistent with the current LuaJIT's LuaC API. >=20 > Part of tarantool/tarantool#5845 > Part of tarantool/tarantool#4473 > --- > test/PUC-Lua-5.1-tests/CMakeLists.txt | 3 +- > test/PUC-Lua-5.1-tests/libs/CMakeLists.txt | 48 +++++++++++++++++++++- > test/PUC-Lua-5.1-tests/libs/lib1.c | 2 +- > test/PUC-Lua-5.1-tests/libs/lib2.c | 2 +- > 4 files changed, 51 insertions(+), 4 deletions(-) >=20 > diff --git a/test/PUC-Lua-5.1-tests/CMakeLists.txt = b/test/PUC-Lua-5.1-tests/CMakeLists.txt > index 773db0d..3c31aae 100644 > --- a/test/PUC-Lua-5.1-tests/CMakeLists.txt > +++ b/test/PUC-Lua-5.1-tests/CMakeLists.txt > @@ -16,7 +16,8 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) > # variable as proposed in the first case. > set(LUA_PATH "?\;${CMAKE_CURRENT_SOURCE_DIR}/?.lua") >=20 > -# Set PUC-Lua-5.1-tests-prepare target that creates > +# Set PUC-Lua-5.1-tests-prepare target that contains rules > +# for libraries compilation and creates > # subdirectory. > add_subdirectory(libs) >=20 > diff --git a/test/PUC-Lua-5.1-tests/libs/CMakeLists.txt = b/test/PUC-Lua-5.1-tests/libs/CMakeLists.txt > index f24e7f3..aa64a44 100644 > --- a/test/PUC-Lua-5.1-tests/libs/CMakeLists.txt > +++ b/test/PUC-Lua-5.1-tests/libs/CMakeLists.txt > @@ -4,11 +4,57 @@ > # See the rationale in the root CMakeLists.txt. > cmake_minimum_required(VERSION 3.1 FATAL_ERROR) >=20 > +# Build additional C libraries for tests. > +macro(BuildTestCLib lib sources) > + add_library(${lib} SHARED EXCLUDE_FROM_ALL ${sources}) > + target_include_directories(${lib} PRIVATE > + ${LUAJIT_SOURCE_DIR} > + ) > + set_target_properties(${lib} PROPERTIES > + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" > + PREFIX "" > + ) > + # XXX: The dynamic libraries are loaded with LuaJIT binary and > + # use symbols from it. So it is totally OK to have unresolved > + # symbols at build time. > + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") > + set_target_properties(${lib} PROPERTIES > + LINK_FLAGS "-undefined dynamic_lookup" > + ) > + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") > + # XXX: This is necessary mostly for openSUSE builds, see also > + # https://bugzilla.suse.com/show_bug.cgi?id=3D1012388. > + # Just strip out the linker flag to suppress this linker > + # option. > + string(REPLACE "-Wl,--no-undefined" "" > + CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}" > + ) > + endif() > + list(APPEND TESTLIBS ${lib}) > +endmacro() > + > +BuildTestCLib(lib1 lib1.c) > +BuildTestCLib(lib11 lib1.c lib11.c) > +BuildTestCLib(lib2 lib2.c) > +BuildTestCLib(lib21 lib2.c lib21.c) > + > +# Create exact copy of the lib2 library for tests in attrib.lua. > +set(LIB2ORIG = "${CMAKE_CURRENT_BINARY_DIR}/lib2${CMAKE_SHARED_LIBRARY_SUFFIX}") > +set(LIB2COPY = "${CMAKE_CURRENT_BINARY_DIR}/-lib2${CMAKE_SHARED_LIBRARY_SUFFIX}") > +add_custom_command( > + OUTPUT ${LIB2COPY} > + COMMENT "Copying lib2 to -lib2 for PUC-Rio Lua 5.1 tests" > + COMMAND ${CMAKE_COMMAND} -E copy ${LIB2ORIG} ${LIB2COPY} > + DEPENDS ${TESTLIBS} > + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} > +) > +list(APPEND TESTLIBS ${LIB2COPY}) > + > # The original tarball contains subdirectory "libs" with an empty > # subdirectory "libs/P1", to be used by tests. > # Instead of tracking empty directory with some anchor-file for > # git, create this directory via CMake. > -add_custom_target(PUC-Lua-5.1-tests-prepare) > +add_custom_target(PUC-Lua-5.1-tests-prepare DEPENDS ${TESTLIBS}) > add_custom_command(TARGET PUC-Lua-5.1-tests-prepare > COMMENT "Create directory for PUC-Rio Lua 5.1 tests" > COMMAND ${CMAKE_COMMAND} -E make_directory P1 > diff --git a/test/PUC-Lua-5.1-tests/libs/lib1.c = b/test/PUC-Lua-5.1-tests/libs/lib1.c > index 812bb9a..22fe6de 100644 > --- a/test/PUC-Lua-5.1-tests/libs/lib1.c > +++ b/test/PUC-Lua-5.1-tests/libs/lib1.c > @@ -14,7 +14,7 @@ static int id (lua_State *L) { > } >=20 >=20 > -static const struct luaL_reg funcs[] =3D { > +static const struct luaL_Reg funcs[] =3D { > {"id", id}, > {NULL, NULL} > }; > diff --git a/test/PUC-Lua-5.1-tests/libs/lib2.c = b/test/PUC-Lua-5.1-tests/libs/lib2.c > index 9972cbe..876a212 100644 > --- a/test/PUC-Lua-5.1-tests/libs/lib2.c > +++ b/test/PUC-Lua-5.1-tests/libs/lib2.c > @@ -12,7 +12,7 @@ static int id (lua_State *L) { > } >=20 >=20 > -static const struct luaL_reg funcs[] =3D { > +static const struct luaL_Reg funcs[] =3D { > {"id", id}, > {NULL, NULL} > }; > --=20 > 2.31.0 >=20