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 085726FC90; Mon, 26 Sep 2022 18:56:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 085726FC90 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1664207804; bh=g7MZlC9mZbCzKY1nVxwapGWW2tWM1v3zr0FVzLAbL4M=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=NbKk25VC6TrgBWI4l1U9GGdy7c0qGb67ayC1kDfd+2I/Oe92by8y5tr/SpZ6CZ+qd 13kV61hLmnrEi2AU5LARoTqI6BLOrtJqXZLZvVyECvEUiuIT3nBkZW0EUPvULZocd3 S2pm4NvklyLp4x6swMEcTFfk8oYGxX6rnW80Pcn0= Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 2D6306FC90 for ; Mon, 26 Sep 2022 18:55:18 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2D6306FC90 Received: by mail-lf1-f44.google.com with SMTP id s6so11550229lfo.7 for ; Mon, 26 Sep 2022 08:55:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date; bh=LypeAt9oiPk5Kw91q9Rye57BrmHUenWf4NBz0KnzOVE=; b=OQd7B5UzB9nMoSE9XLM2vdubt0Fz8JF5G6Ek7UBipOz1wfsB26bOGzR7a+htHd5Q5R vz86/zVd5fCqzQtOqylsdPF4XhK9dfPzTaAW1UVFwLNtsGum5eMAMa0DLg/DK3gIdJ9I x5cdpqcgJGN7OVdXUhkgcCXUcZE+hmAZE+59YQIDxbEA1Jkefn0dxnpTDJxeshewDzK4 K34JdE4umUJ1G5w0FPa79liPcW08kbx7WnuuhMWvNjpfg/H6KJcVbe9h6v0Ahxtmt5iU ogSeP44C6DPAivUs8VGmb5A/lIsDvpVVc/uX8dLqlD5W+/thI5fG/Uc3NaapBFVIEGzd CRvw== X-Gm-Message-State: ACrzQf3nSb9C9zOZpHOPAlWtZ/7exmBx4n2Jr51nOAS2E8aQJN1nWJ+m C5fWPnWLj5P2NfcSdm7ra6AtYeTmalEF7g== X-Google-Smtp-Source: AMsMyM6EYos6a4szgDEFmwi0hNPjunuarEkzpLmGFYtQ2VoNSZos6SvopgHLSCxHA4u8c7ZA3vLhWw== X-Received: by 2002:ac2:5493:0:b0:498:f55c:7fc7 with SMTP id t19-20020ac25493000000b00498f55c7fc7mr8735192lfk.381.1664207717355; Mon, 26 Sep 2022 08:55:17 -0700 (PDT) Received: from localhost.localdomain (128-69-252-100.broadband.corbina.ru. [128.69.252.100]) by smtp.gmail.com with ESMTPSA id v6-20020a056512348600b0048af9576d30sm2574400lfr.83.2022.09.26.08.55.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 26 Sep 2022 08:55:16 -0700 (PDT) To: tarantool-patches@dev.tarantool.org, sergos@tarantool.org, skaplun@tarantool.org Date: Mon, 26 Sep 2022 18:55:00 +0300 Message-Id: <1d15f0a9f3865b0ec374d66d01f38d055afc9eec.1664207262.git.max.kokryashkin@gmail.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit 3/6] OSX/ARM64: Disable external unwinding for now. 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: Maksim Kokryashkin via Tarantool-patches Reply-To: Maksim Kokryashkin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Mike Pall This reduces functionality, e.g. no handling of on-trace errors. Someone with very deep knowledge about macOS and MACH-O/DWARF stack unwinding internals is needed to fix this. See issue LuaJIT/LuaJIT#698. (cherry picked from commit 27ee3bcd79b12a0c71f00427ee1a2e486c684486) ARM64 interpreter doesn't have unwind info for Mach-O assembler format, which makes unwinding impossible. For more info, see https://github.com/LuaJIT/LuaJIT/issues/698 Maxim Kokryashkin: * added the description for the problem Needed for tarantool/tarantool#6096 Needed for tarantool/tarantool#7230 --- cmake/SetTargetFlags.cmake | 4 +++- src/Makefile.original | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/SetTargetFlags.cmake b/cmake/SetTargetFlags.cmake index a5a3407f..d99e1f9a 100644 --- a/cmake/SetTargetFlags.cmake +++ b/cmake/SetTargetFlags.cmake @@ -16,7 +16,9 @@ LuaJITTestArch(TESTARCH "${TARGET_C_FLAGS}") LuaJITArch(LUAJIT_ARCH "${TESTARCH}") if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - AppendFlags(TARGET_C_FLAGS -DLUAJIT_UNWIND_EXTERNAL) + if(NOT LUAJIT_ARCH STREQUAL "arm64") + AppendFlags(TARGET_C_FLAGS -DLUAJIT_UNWIND_EXTERNAL) + endif() else() string(FIND ${TARGET_C_FLAGS} "LJ_NO_UNWIND 1" UNWIND_POS) if(UNWIND_POS EQUAL -1) diff --git a/src/Makefile.original b/src/Makefile.original index d1373b40..5826a56a 100644 --- a/src/Makefile.original +++ b/src/Makefile.original @@ -325,7 +325,10 @@ ifeq (Darwin,$(TARGET_SYS)) export MACOSX_DEPLOYMENT_TARGET=10.4 endif TARGET_STRIP+= -x - TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL + # Ext. unwinding is broken on OSX/ARM64 until someone finds a fix. See #698. + ifneq (arm64,$(TARGET_LJARCH)) + TARGET_XCFLAGS+= -DLUAJIT_UNWIND_EXTERNAL + endif TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC TARGET_DYNXLDOPTS= TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER) -- 2.32.1 (Apple Git-133)