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 98F5C503767; Mon, 11 Dec 2023 14:27:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 98F5C503767 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1702294024; bh=Pnm7neiMW4M08AAkvwHqIYweEH+9eafb5GYDsmeqPpw=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=lKrkOe0GbocQ3/Oj/8aeOCkiBZ1V1skj8KjELJ6Rgm5UTAb8qo6E3JSsgCqAU5fM7 U/dGyoVbGCd0KgPAYkECOskND0M5nU3oYw9vfSoCBPDZaoYuI7jZegb/zVfJoRWGQ3 EIdDgs2z2KojZ46iTLnDAR+VN2PCQwzzoPv1XFMI= Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 3C237503767 for ; Mon, 11 Dec 2023 14:27:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3C237503767 Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-50be9e6427dso4457649e87.1 for ; Mon, 11 Dec 2023 03:27:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702294022; x=1702898822; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U9Z3lxHyjADAH3sizQsL/DPxtR9cNFpMCfA7/pHAinE=; b=Gz9zS9218jNLbXjsET8CbeQCd0zW96BV7DjZhm+y/LoEJS9neg9P02T7SYF6iPiLEv OVWvPwIiCzgjtxzOhneP4g683blIC10+3jWT26ecpydXZVQjR9W62HQ5oS7OEk0IgvmU wDQoSAxu20WX5ydICAozoXtVKYwdl32wWOMlBMMB4gHhgpuKWGGEqssZPSHiOjucUCmG /WZItQUqMdl6DP2D8YF8jTBjd5QCIM7q3ijROU+GMMSlNNQH1md5jdxcscY5k/GmUb+a KnT1vb9r3zwmSMOi5YortHR8tZZ6SnN9gopAdOqeFZKuzGiZDORg9QNsMIxxYdc/WIMX gmOw== X-Gm-Message-State: AOJu0YzCTc1/dFKXKKr7WM1ZjJ9lf8MJnROBzJ+gxUly/HUe8K5gcE7I DKSjlevD2K0aapx8a3R+43zCPspj7LrOtNpwwn4= X-Google-Smtp-Source: AGHT+IGwn+TOcW6V2Mp7imUM5S5obVHzmDOQinZpAGd5jrOO8BBsANvKkNFJbHHioUnkFeZkELQcjA== X-Received: by 2002:a05:6512:3f2:b0:50b:f15d:1eac with SMTP id n18-20020a05651203f200b0050bf15d1eacmr1762772lfq.4.1702294021877; Mon, 11 Dec 2023 03:27:01 -0800 (PST) Received: from localhost.localdomain ([185.205.79.42]) by smtp.gmail.com with ESMTPSA id b6-20020ac25626000000b0050bf74b0992sm1062475lff.201.2023.12.11.03.27.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 11 Dec 2023 03:27:01 -0800 (PST) To: tarantool-patches@dev.tarantool.org, sergeyb@tarantool.org, skaplun@tarantool.org, m.kokryashkin@tarantool.org Date: Mon, 11 Dec 2023 14:26:55 +0300 Message-Id: <20231211112657.19060-1-max.kokryashkin@gmail.com> X-Mailer: git-send-email 2.39.3 (Apple Git-145) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit] ARM64: Allow building with unwinding disabled. 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 (cherry-picked from commit 5677985dc1f19cf0a67112f4365c7fb79237fa16) Prior to this patch, the LuaJIT build with the `-DLUAJIT_NO_UNWIND=1` option enabled failed on ARM64 because of linker relocation errors related to dwarf-specific code. This patch disables emission of the `.eh_frame` section for builds without unwinding to solve the issue. The `LUAJIT_NO_UNWIND` build option is added to CMakeLists.txt. This patch adds this build flavor to our exotic builds workflow. Maxim Kokryashkin: * added the description for the problem Part of tarantool/tarantool#9145 --- Branch: https://github.com/tarantool/luajit/tree/fckxorg/lj-866-allow-building-with-unwinding-disabled PR: https://github.com/tarantool/tarantool/pull/9463 Issues: https://github.com/tarantool/tarantool/issues/9145 https://github.com/LuaJIT/LuaJIT/issues/866 .github/workflows/exotic-builds-testing.yml | 4 +++- CMakeLists.txt | 5 +++++ src/vm_arm64.dasc | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/exotic-builds-testing.yml b/.github/workflows/exotic-builds-testing.yml index 7c57d238..a9ba5fd5 100644 --- a/.github/workflows/exotic-builds-testing.yml +++ b/.github/workflows/exotic-builds-testing.yml @@ -34,7 +34,7 @@ jobs: BUILDTYPE: [Debug, Release] ARCH: [ARM64, x86_64] GC64: [ON, OFF] - FLAVOR: [checkhook, dualnum, gdbjit, nojit] + FLAVOR: [checkhook, dualnum, gdbjit, nojit, nounwind] include: - BUILDTYPE: Debug CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Debug -DLUA_USE_ASSERT=ON -DLUA_USE_APICHECK=ON @@ -48,6 +48,8 @@ jobs: FLAVORFLAGS: -DLUAJIT_DISABLE_JIT=ON - FLAVOR: gdbjit FLAVORFLAGS: -DLUAJIT_USE_GDBJIT=ON + - FLAVOR: nounwind + FLAVORFLAGS: -DLUAJIT_NO_UNWIND=ON exclude: - ARCH: ARM64 GC64: OFF diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ef10f2f..7f5e2afb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,6 +202,11 @@ if(LUAJIT_DISABLE_UNWIND_JIT) AppendFlags(TARGET_C_FLAGS -DLUAJIT_DISABLE_UNWIND_JIT) endif() +option(LUAJIT_NO_UNWIND "Disable external unwinding.") +if(LUAJIT_NO_UNWIND) + AppendFlags(TARGET_C_FLAGS -DLUAJIT_NO_UNWIND) +endif() + # Disable memory profiler. option(LUAJIT_DISABLE_MEMPROF "LuaJIT memory profiler support" OFF) if(LUAJIT_DISABLE_MEMPROF) diff --git a/src/vm_arm64.dasc b/src/vm_arm64.dasc index 0a12b5b7..1cf1ea51 100644 --- a/src/vm_arm64.dasc +++ b/src/vm_arm64.dasc @@ -3915,6 +3915,7 @@ static void emit_asm_debug(BuildCtx *ctx) "\t.align 3\n" ".LEFDE1:\n\n", (int)ctx->codesz - fcofs); #endif +#if !LJ_NO_UNWIND fprintf(ctx->fp, "\t.section .eh_frame,\"a\",%%progbits\n"); fprintf(ctx->fp, ".Lframe1:\n" @@ -3982,6 +3983,7 @@ static void emit_asm_debug(BuildCtx *ctx) "\t.byte 0x94\n\t.uleb128 4\n" /* offset x20 */ "\t.align 3\n" ".LEFDE3:\n\n", (int)ctx->codesz - fcofs); +#endif #endif break; #if !LJ_NO_UNWIND -- 2.39.3 (Apple Git-145)