From patchwork Mon Feb 16 01:34:49 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1881 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205732; bh=ojTn5dp5Q7kW9WGP2BO6vN6Bppn+479H+9vi1hvlEpc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pUVCtxOlf0tmH2vkqXyP0znHaBJIjWKydT3XVW4HMjwV5UlmXQjRcuCSPBt/DvnUg Zb8YymJ1drd2XauP2cLO40I/z4YIoP4N6awoBeuORrfLhgm3TBPTiTzC+UTierMzPQ /MU8aL0KCSCH6hXScAGzXJyyoISz/PvbexTKfy0Wy3+3EjZIwSYxjRARyRIRBjvOT6 tqclHtAoi6HJ1d0heq9ubMTMpTmOSfAmH5zPqxSaHlSnSploUzjD8S79DsteIwO3ot SqEdU9CjX9TyYDjlS+zW9iABuZN+rgOtZgd4AZmF31nTaDlYkgNaV438Gw4p7xerEo D5Lo5gmFIoPzA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1AE4669BD1 for ; Sun, 15 Feb 2026 18:35:32 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id LMOrJodgirbJ for ; Sun, 15 Feb 2026 18:35:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205732; bh=ojTn5dp5Q7kW9WGP2BO6vN6Bppn+479H+9vi1hvlEpc=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pUVCtxOlf0tmH2vkqXyP0znHaBJIjWKydT3XVW4HMjwV5UlmXQjRcuCSPBt/DvnUg Zb8YymJ1drd2XauP2cLO40I/z4YIoP4N6awoBeuORrfLhgm3TBPTiTzC+UTierMzPQ /MU8aL0KCSCH6hXScAGzXJyyoISz/PvbexTKfy0Wy3+3EjZIwSYxjRARyRIRBjvOT6 tqclHtAoi6HJ1d0heq9ubMTMpTmOSfAmH5zPqxSaHlSnSploUzjD8S79DsteIwO3ot SqEdU9CjX9TyYDjlS+zW9iABuZN+rgOtZgd4AZmF31nTaDlYkgNaV438Gw4p7xerEo D5Lo5gmFIoPzA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 07CB869BCE for ; Sun, 15 Feb 2026 18:35:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205730; bh=wRVMMBnUNIcGvs/FSEfxxdWk8XLVHzqrKshpRnnbeMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O/3QS77WLISKMbuRkwoGwg5VkPN2Zg60BicAWNNSycLJ+b2PO3f1OqfgOrL76wMl9 nPdyCMsyN7uWuPvw44duXfcrlD9tk0QKj0GVpxF/tAC3uFEHhCaIjFIGm4jBUSdul5 koESMQzR1nRbu+uxJPAUl2kDlH0ncYz3LpI1EavgcabRuFz4hzQdduBcnguMS7e5j/ Btqv6KYr1wv7Jfrkrgkw2cAzr+w0YExG2fr8O+NllEcMl5DzPIGC0Mh9NpbV4jb0dG 8sTrpwVKow2+0PoCSNoWpbJ01rW772TShJ1gSTbpnBJomjpLS+2CMe6gnSzCfmOB1u v5NDRMifHmr5Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3D9B269AD9; Sun, 15 Feb 2026 18:35:30 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id CYCXprUuOmrY; Sun, 15 Feb 2026 18:35:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205726; bh=bK4mrSqSVrP5C5Klh82rxNIYEtbeoH47BoTBXLefC4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FBQXBa19XjVCrH+/Xw9ma7owwXsybuMPm3KnOesR3s1Ahhmr6UbdHgibAGIc3k2Ab dyunEA0eeYUJkNQ95nEOgANF6c2wVWgfqu0U69zIzZPDKTPGyLOVNmGhx8QuLtC+lE OSSY8I6MDmttZdEVS18PqjYsZBv3+IOQkopuBucaIBMkpgM08YpIlXw+ZrvClyHT/L rzV1wz5hxpFvub+RVLuAQIIh2FGqG7k9CXDfAi1aA6UkjDzZ5xb6s0iyg+M/OtoXXG N444Wgz4UYBwGNSq5AHsTtRLtLsKtsEXg/8vgDX6J0LBQ5nczZHe4iMjE3jJi99s0K sJpS2AO5tHQlA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DD25469BCE; Sun, 15 Feb 2026 18:35:25 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 15 Feb 2026 18:34:49 -0700 Message-ID: <20260216013511.4079770-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260216013511.4079770-1-sjg@u-boot.org> References: <20260216013511.4079770-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ETUWTDFUI2HXYBMSXRCAP3LZGSSPWE3K X-Message-ID-Hash: ETUWTDFUI2HXYBMSXRCAP3LZGSSPWE3K X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 6" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/17] ulib: Skip empty archives in build_api.py objcopy step List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When CONFIG_ULIB is enabled for cross-compiled EFI builds, some built-in.o archives are empty (e.g. arch/riscv/cpu/generic/built-in.o for efi-riscv_app64). The objcopy --redefine-sym command fails on empty files. Skip them by checking the file size before calling objcopy, producing an empty output file to keep the archive list consistent. Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- scripts/build_api.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/build_api.py b/scripts/build_api.py index aa8b4f16a1a..a82cd83503c 100755 --- a/scripts/build_api.py +++ b/scripts/build_api.py @@ -356,6 +356,12 @@ class SymbolRedefiner: Returns: bool: True if file was modified, False otherwise """ + # Skip empty archives (objcopy cannot process them) + if os.path.getsize(path) == 0: + with open(outfile, 'wb'): + pass + return False + # Always run objcopy to apply redefinitions self.redefine_file(path, outfile)