From patchwork Thu Mar 28 07:25:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1917175 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V4w7Z1K7Mz1yWr for ; Thu, 28 Mar 2024 18:26:01 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rpk8y-0006YS-UP; Thu, 28 Mar 2024 07:25:49 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rpk8f-0006WH-B0 for fwts-devel@lists.ubuntu.com; Thu, 28 Mar 2024 07:25:29 +0000 Received: from canonical.com (unknown [10.101.194.165]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 8C03D3F105 for ; Thu, 28 Mar 2024 07:25:28 +0000 (UTC) From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] lib: fwts_acpi_tables: fix the build fail on armhf Date: Thu, 28 Mar 2024 15:25:24 +0800 Message-Id: <20240328072524.31699-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" BugLink: https://bugs.launchpad.net/fwts/+bug/2059390 Currently, the update glib to libglib2.0-0t64 on armhf, causes pointer-to-int-cast error, it seems build failed with _FILE_OFFSET_BITS=64 on 32-bit. fwts_acpi_tables.c:173:30: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 173 | if ((mem = fwts_mmap((off_t)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED) fwts_acpi_tables.c:486:53: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 486 | fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(off_t)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE); change the off_t to long int to fix this, let's see if any update for this. Signed-off-by: Ivan Hu --- src/lib/src/fwts_acpi_tables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index e215f493..46a7ade1 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -170,7 +170,7 @@ static fwts_acpi_table_rsdp *fwts_acpi_get_rsdp(fwts_framework *fw, void *addr, return NULL; } - if ((mem = fwts_mmap((off_t)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED) + if ((mem = fwts_mmap((long int)addr, sizeof(fwts_acpi_table_rsdp))) == FWTS_MAP_FAILED) return NULL; if (fwts_safe_memcpy(rsdp, mem, sizeof(fwts_acpi_table_rsdp)) != FWTS_OK) { @@ -483,7 +483,7 @@ static int fwts_acpi_load_tables_from_firmware(fwts_framework *fw) if ((rsdp = fwts_acpi_get_rsdp(fw, rsdp_addr, &rsdp_len)) == NULL) return FWTS_ERROR; - fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(off_t)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE); + fwts_acpi_add_table("RSDP", rsdp, (uint64_t)(long int)rsdp_addr, rsdp_len, FWTS_ACPI_TABLE_FROM_FIRMWARE); /* Load any tables from XSDT if it's valid */ if (rsdp->xsdt_address) {