From patchwork Fri Jul 19 20:30:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1962617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=R+aGaMrA; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WQhBw389vz1xrQ for ; Sat, 20 Jul 2024 06:30:48 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 43541384609D for ; Fri, 19 Jul 2024 20:30:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by sourceware.org (Postfix) with ESMTPS id CC475385DDC5 for ; Fri, 19 Jul 2024 20:30:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC475385DDC5 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bootlin.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CC475385DDC5 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4b98:dc4:8::229 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721421024; cv=none; b=qIMSFtATq31XJ/79ez61bZt17ozy7V4lM4Dag190nz8xWeXVi6KrDQKuN+ORay0pHjo4Q7AAsRhO972YMG851DV4nMBFFWv5NDuCufU/Rl2/9R/IuqPjoUu4iOSXCqG4uHIqNqqdFAeNSwhtqw2EDPRD07bMTcSXiDkF4FDNDOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721421024; c=relaxed/simple; bh=1dSVBg4/aK/XF/Me5Z1P3leAQMxHvMgUzYn9Ix5usHg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ockkS3od5cXIQi/gEbUqjzOyfZA/NM5oB54H+ZHRtFTPteRkU3ThTYubUTiNcD4Q/OQpYrYvYcDWAE/z8Y0ImnV8XuYTHaJDmuqG/l/LeGJcFiaJYk5f5vmDscz7oMAEN5PZTRv7pF+y6jOoddTgrvuJJ78w0djfF1F64LLv/AM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail.gandi.net (Postfix) with ESMTPA id BE478FF803; Fri, 19 Jul 2024 20:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1721421019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vaJfUc7pO100w/vB6+d3KTmw2mcUXP0iPK/M8T/q2/o=; b=R+aGaMrAPQGn/Uq/ujH8ldRcn7TKshHcBU8oYxBqN8u9FNM8Ov1tb2h3WLC8jGRMDoDuFN i3cstCvDS94zcWxiQvMOQRXCbvZkApLG2vpXCSDMgNbewzlVzEMLS/bwSciXmbjN3kZOMR fohiwu8sWIr4vGPQOy8/5C2ZTmm2YdqfAkA5I1sm2y3+L45PZ0eewf1hTZBqJ/KLREyxcD ZLFg7329rkBFGj1+D8pLxU4VZ8kADqKq5OYkKUYiQaH7RTjTsJ8Y9hgL931hjRweZDASwz Ycs606OI7cu37l7VkCHsxIbk9qtFHDnM8Kjz/xVSVFk7WuSGYS1j6zBfICjNaw== From: Thomas Petazzoni To: gcc-patches@gcc.gnu.org Cc: Thomas Petazzoni Subject: [PATCH] libsanitizer: also undef _TIME_BITS in sanitizer_procmaps_solaris.cpp Date: Fri, 19 Jul 2024 22:30:14 +0200 Message-ID: <20240719203014.2060082-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: thomas.petazzoni@bootlin.com X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Upstream commit https://github.com/llvm/llvm-project/commit/26800a2c7e7996dc773b4e990dd5cca41c45e1a9 of LLVM added a #undef _TIME_BITS in libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp to fix the build on 32-bit Linux platforms that have enabled 64-bit time_t using _TIME_BITS=64. Indeed, _TIME_BITS=64 can only be used when _FILE_OFFSET_BITS=64, but sanitizer_platform_limits_posix.cpp undefines _FILE_OFFSET_BITS before including any header file. To fix this, the upstream fix was to also undef _TIME_BITS. This commit simply does the same in sanitizer_procmaps_solaris.cpp, which also gets compiled under Linux (despite what the file name says). In practice on Linux hosts (where _TIME_BITS=64 matters), sanitizer_procmaps_solaris.cpp will expand to nothing, as pretty much the rest of the file is inside a #ifdef SANITIZER_SOLARIS...#endif. So the #undef _FILE_OFFSET_BITS and #undef _TIME_BITS are only here before including sanitizer_platform.h, which will set the SANITIZER_LINUX/SANITIZER_SOLARIS define depending on the platform. Fixes: armeb-buildroot-linux-gnueabi/sysroot/usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" 26 | # error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64" This change has also been proposed to upstream LLVM: https://github.com/llvm/llvm-project/pull/99699 Signed-off-by: Thomas Petazzoni --- libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp b/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp index eeb49e2afe3..1b23fd4d512 100644 --- a/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp +++ b/libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp @@ -11,6 +11,7 @@ // Before Solaris 11.4, doesn't work in a largefile environment. #undef _FILE_OFFSET_BITS +#undef _TIME_BITS #include "sanitizer_platform.h" #if SANITIZER_SOLARIS # include