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 0AE886F3C8; Mon, 3 Oct 2022 18:58:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0AE886F3C8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1664812696; bh=rjUrSgiegsIwAFqu5xwtZqez0wuhis8nBk3VC8WC904=; 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=gcoClkurAbG63bOM4zHIIK1i9jBlIAoLvpbo1SsSvoILf1vXHlmSbZSQPWJeNAvKJ pQBn6HSAhA95dhy8IfaO1LX75+Q3t94JFNP0na8fLclbHNn4RBFt0g8WH+vH/nm2w0 Zylwt7z3tnXoSanOZ6F+Z7OkoFn9PbanAPGREbTs= Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [94.100.177.106]) (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 498CA6F3C8 for ; Mon, 3 Oct 2022 18:58:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 498CA6F3C8 Received: by smtp46.i.mail.ru with esmtpa (envelope-from ) id 1ofNpd-0002WY-Go; Mon, 03 Oct 2022 18:58:14 +0300 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) In-Reply-To: <623a3c7c7aa9e8c5a2fdb68384c278825016f72e.1664207262.git.max.kokryashkin@gmail.com> Date: Mon, 3 Oct 2022 18:58:12 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <096AE4C8-D532-47EB-B356-26D1CC10349D@tarantool.org> References: <623a3c7c7aa9e8c5a2fdb68384c278825016f72e.1664207262.git.max.kokryashkin@gmail.com> To: Maksim Kokryashkin X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9EA63AAA3C7549E8E044A37F1F069695FE0848DC8110DC3B100894C459B0CD1B976465080CDB2B303E7A9791E0E0964A021112C9586B2D44EFD3330C560CA6F5B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7A2F2DCC785917A3AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637ED2BA022FBF94AB68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D875B74C5832F2C2AF54E64BD8D9C220DD117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC1D8F55CB9E08B94CA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18F04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE437C869540D2AB0F436E4CC186B5AB2DD8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE32A336C65186350916136E347CC761E07C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947C2D01283D1ACF37BA2E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89F616AD31D0D18CD5C156CCFE7AF13BCA4B5C8C57E37DE458BEDA766A37F9254B7 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D345CB6DE26F16546676A66E8CD82B755D314FA4435225BE649FB6F8F365638899D5D9397DB0A761CDC1D7E09C32AA3244C8B1A14ABF5E3BACAF69193CD5175528AC3B3ADDA61883BB5FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojoN03fZs/02Md0jvdRp+tug== X-Mailru-Sender: 5AA3D5B9D8C486465A7E7C48E78B605D1595DF1702D19A64EC242A9AC065100D38066306E4938E9F60D8632BEC246C7D55B4A2144138A8805FC805B5969CB4993EE16157CC7DAB4272D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/6] OSX: Fix build by hardcoding external frame unwinding. 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: sergos via Tarantool-patches Reply-To: sergos Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the patch! I have two questions below and also there=E2=80=99s no mentioning in the = message that you removes the non-GC64 workflow for the Darwin platform. Why is it = done=20 at all? Previous commit just mentioned that GC64 is enabled by default. Sergos > On 26 Sep 2022, at 18:54, Maksim Kokryashkin = wrote: >=20 > Apparently they can't even get 'grep' right, let alone a keyboard. >=20 > (cherry picked from commit d4a554d6ee1507f7313641b26ed09bf1b518fa1f) >=20 > MacOS uses BSD grep, which is slightly different from GNU grep. > Because of that, the shell script determining whether external > unwinding is possible doesn't work right. >=20 > External unwinding is possible on MacOS, so this patch enables > it by default. >=20 > Maxim Kokryashkin: > * added the description for the problem >=20 > Needed for tarantool/tarantool#6096 > Needed for tarantool/tarantool#7230 > --- > .github/workflows/macos-x86_64.yml | 20 +------------------- > cmake/SetTargetFlags.cmake | 28 ++++++++++++++++------------ > src/Makefile.original | 15 ++++++++------- > 3 files changed, 25 insertions(+), 38 deletions(-) >=20 > diff --git a/.github/workflows/macos-x86_64.yml = b/.github/workflows/macos-x86_64.yml > index 840806e3..dafd1796 100644 > --- a/.github/workflows/macos-x86_64.yml > +++ b/.github/workflows/macos-x86_64.yml > @@ -35,7 +35,7 @@ jobs: > fail-fast: false > matrix: > BUILDTYPE: [Debug, Release] > - GC64: [ON, OFF] > + GC64: ON 1. how is it relvant to grep?? > include: > - BUILDTYPE: Debug > CMAKEFLAGS: -DCMAKE_BUILD_TYPE=3DDebug -DLUA_USE_ASSERT=3DON= -DLUA_USE_APICHECK=3DON > @@ -69,15 +69,6 @@ jobs: > - name: test > run: cmake --build . --parallel --target test >=20 > - test-tarantool-debug-wo-GC64: > - name: Tarantool Debug GC64:OFF > - needs: test-luajit > - uses: = tarantool/tarantool/.github/workflows/luajit-integration.yml@master > - with: > - GC64: OFF > - buildtype: Debug > - host: macos-11 > - revision: ${{ github.sha }} (1) > test-tarantool-debug-w-GC64: > name: Tarantool Debug GC64:ON > needs: test-luajit > @@ -87,15 +78,6 @@ jobs: > buildtype: Debug > host: macos-11 > revision: ${{ github.sha }} > - test-tarantool-release-wo-GC64: > - name: Tarantool Release GC64:OFF > - needs: test-luajit > - uses: = tarantool/tarantool/.github/workflows/luajit-integration.yml@master > - with: > - GC64: OFF > - buildtype: RelWithDebInfo > - host: macos-11 > - revision: ${{ github.sha }} (1) > test-tarantool-release-w-GC64: > name: Tarantool Release GC64:ON > needs: test-luajit > diff --git a/cmake/SetTargetFlags.cmake b/cmake/SetTargetFlags.cmake > index 36896aff..a5a3407f 100644 > --- a/cmake/SetTargetFlags.cmake > +++ b/cmake/SetTargetFlags.cmake > @@ -15,18 +15,22 @@ endif() > LuaJITTestArch(TESTARCH "${TARGET_C_FLAGS}") > LuaJITArch(LUAJIT_ARCH "${TESTARCH}") >=20 > -string(FIND ${TARGET_C_FLAGS} "LJ_NO_UNWIND 1" UNWIND_POS) > -if(UNWIND_POS EQUAL -1) > - execute_process( > - COMMAND bash -c "exec 2>/dev/null; echo 'extern void b(void);int = a(void){b();return 0;}' | ${CMAKE_C_COMPILER} -c -x c - -o tmpunwind.o = && grep -qa -e eh_frame -e __unwind_info tmpunwind.o && echo E; rm -f = tmpunwind.o" 2. I don=E2=80=99t see any changes to the grep operation here and below = - does the cherry-pick message is relevant at all? > - WORKING_DIRECTORY ${LUAJIT_SOURCE_DIR} > - OUTPUT_VARIABLE TESTUNWIND > - RESULT_VARIABLE TESTUNWIND_RC > - ) > - if(TESTUNWIND_RC EQUAL 0) > - string(FIND "${TESTUNWIND}" "E" UNW_TEST_POS) > - if(NOT UNW_TEST_POS EQUAL -1) > - AppendFlags(TARGET_C_FLAGS -DLUAJIT_UNWIND_EXTERNAL) > +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") > + AppendFlags(TARGET_C_FLAGS -DLUAJIT_UNWIND_EXTERNAL) > +else() > + string(FIND ${TARGET_C_FLAGS} "LJ_NO_UNWIND 1" UNWIND_POS) > + if(UNWIND_POS EQUAL -1) > + execute_process( > + COMMAND bash -c "exec 2>/dev/null; echo 'extern void = b(void);int a(void){b();return 0;}' | ${CMAKE_C_COMPILER} -c -x c - -o = tmpunwind.o && grep -qa -e eh_frame -e __unwind_info tmpunwind.o && echo = E; rm -f tmpunwind.o" > + WORKING_DIRECTORY ${LUAJIT_SOURCE_DIR} > + OUTPUT_VARIABLE TESTUNWIND > + RESULT_VARIABLE TESTUNWIND_RC > + ) > + if(TESTUNWIND_RC EQUAL 0) > + string(FIND "${TESTUNWIND}" "E" UNW_TEST_POS) > + if(NOT UNW_TEST_POS EQUAL -1) > + AppendFlags(TARGET_C_FLAGS -DLUAJIT_UNWIND_EXTERNAL) > + endif() > endif() > endif() > endif() > diff --git a/src/Makefile.original b/src/Makefile.original > index c9609700..d1373b40 100644 > --- a/src/Makefile.original > +++ b/src/Makefile.original > @@ -320,18 +320,12 @@ else > ifeq (,$(shell $(TARGET_CC) -o /dev/null -c -x c /dev/null = -fno-stack-protector 2>/dev/null || echo 1)) > TARGET_XCFLAGS+=3D -fno-stack-protector > endif > -ifeq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH))) > - # Find out whether the target toolchain always generates unwind = tables. > - TARGET_TESTUNWIND=3D$(shell exec 2>/dev/null; echo 'extern void = b(void);int a(void){b();return 0;}' | $(TARGET_CC) -c -x c - -o = tmpunwind.o && grep -qa -e eh_frame -e __unwind_info tmpunwind.o && echo = E; rm -f tmpunwind.o) > - ifneq (,$(findstring E,$(TARGET_TESTUNWIND))) > - TARGET_XCFLAGS+=3D -DLUAJIT_UNWIND_EXTERNAL > - endif > -endif > ifeq (Darwin,$(TARGET_SYS)) > ifeq (,$(MACOSX_DEPLOYMENT_TARGET)) > export MACOSX_DEPLOYMENT_TARGET=3D10.4 > endif > TARGET_STRIP+=3D -x > + TARGET_XCFLAGS+=3D -DLUAJIT_UNWIND_EXTERNAL > TARGET_XSHLDFLAGS=3D -dynamiclib -single_module -undefined = dynamic_lookup -fPIC > TARGET_DYNXLDOPTS=3D > TARGET_XSHLDFLAGS+=3D -install_name $(TARGET_DYLIBPATH) = -compatibility_version $(MAJVER).$(MINVER) -current_version = $(MAJVER).$(MINVER).$(RELVER) > @@ -345,6 +339,13 @@ ifeq (iOS,$(TARGET_SYS)) > TARGET_XCFLAGS+=3D -fno-omit-frame-pointer > endif > else > + ifeq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH))) > + # Find out whether the target toolchain always generates unwind = tables. > + TARGET_TESTUNWIND=3D$(shell exec 2>/dev/null; echo 'extern void = b(void);int a(void){b();return 0;}' | $(TARGET_CC) -c -x c - -o = tmpunwind.o && grep -qa -e eh_frame -e __unwind_info tmpunwind.o && echo = E; rm -f tmpunwind.o) > + ifneq (,$(findstring E,$(TARGET_TESTUNWIND))) > + TARGET_XCFLAGS+=3D -DLUAJIT_UNWIND_EXTERNAL > + endif > + endif > ifneq (SunOS,$(TARGET_SYS)) > ifneq (PS3,$(TARGET_SYS)) > TARGET_XLDFLAGS+=3D -Wl,-E > --=20 > 2.32.1 (Apple Git-133) >=20