From patchwork Tue Sep 10 12:22:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 826979 Delivered-To: patch@linaro.org Received: by 2002:adf:ab1c:0:b0:367:895a:4699 with SMTP id q28csp274901wrc; Tue, 10 Sep 2024 05:23:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU6tSWWAuMkundvoD3ObMKFO1YXT9kMXqQZ6RwZSu/3ooYKEb4XIvsTdF7EAwdzvQvi+EOr5Q==@linaro.org X-Google-Smtp-Source: AGHT+IFd2DLtmrIGXZCZ4oVIUaegJ6Z3bl8o9nFYzMamO5X8IPPo92AYVJMQRBWwpbI/FafWIEvx X-Received: by 2002:a05:6214:2c01:b0:6c3:55c4:cc1c with SMTP id 6a1803df08f44-6c5282fd513mr142901976d6.1.1725971032929; Tue, 10 Sep 2024 05:23:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725971032; cv=pass; d=google.com; s=arc-20240605; b=URa7yor42tZbhVs/rro4BEuqWh4AAN5JhqFIMd2t0DO7oBqR/9WpccmJmXuF9Pyewm QtGcAwFmSn4re+rK58RI19PcADrSdx9hgB4Oqpyq2Mot5lVTefLksyFlsWUUS7RaeKzA R+W0TNfBst/fQiS7olcx4YkzoVcyGibryszi8eiCtfoHKsQut/vq1zB5z1+RbMra2+ue 9+aMO1hxS1kCF8iicmIxdAC2NEInXfT9UA2gbZqqES8xsvAKxH7rf3oQuuer7dfCGId+ vDFeqyzn1+oen5Br3pqjWQsLOZYlXtpQiIGHduMYW37aBEeIN/qgbedyV8juD6BfOgb1 PZFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=kK3of1X1Xqj2Q9vO53pAHy1UkKqvv0iqc5jfIrNPr0g=; fh=GNAnomGb44Vc67//YEj4j5r10Zx6jLxEj1JVNOU+ZEM=; b=N/FFDm+qLIeYWfg68LRArWbyZGH7mtaXJen6Gxie4NgwG7Q2wuXo6kQZj6WhO56/u8 5dvDM6w+YR95jYJNdIX//nHO7RSAc1qEsNxOLHqowBI2ph6ERPf0PcmJdERxuXWjlatX LrptCuu2Dl8TKy0SJD8ORvx05dZlKGFXcBJ2+Zl1+SRCTbjgsIigby5xGxUE/+Cl6D99 sSe/9P5MeukdNx85+iK25ykFsQSoFLE6EyithMN89aSDIc2B8IEb/jtYQ9X6yUsZy8pM Dkc49L3sdgX+mKWLJo8gsJjyP9GIFg9v/CqCaQLcWhLWetKOVP0NhxKkgWD+LmzXO+MR gukg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=diDLd2ST; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id 6a1803df08f44-6c534781479si78040666d6.328.2024.09.10.05.23.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 05:23:52 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=diDLd2ST; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 876E3385DDC8 for ; Tue, 10 Sep 2024 12:23:52 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 970AB3858403 for ; Tue, 10 Sep 2024 12:22:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 970AB3858403 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 970AB3858403 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::632 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725970981; cv=none; b=j1dQbbN7X/8dyYROuR7TvaGSxuUcSb2Ts/ZJB+sUmguCy62NShBbxwLd5OmJ0waQhpLfSoJXzNHMSTrcrSC++ySnpaT0I4jAZYr2pf5/2HdAHt0t428UGGmlKb88XGDDQ+p6kkIXne4J9IPOxASaRVVN8gIjCmRo8e6I3+hiOSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725970981; c=relaxed/simple; bh=XOZhhVcIDVolyKKCyWXIkgINfjrOXbYRD3XgdWMiYAY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=iEKDEwOjg8hdZETd94AbHbDGpfelSQYR+92gvGI2zhbwQ6RkYn8oPZaTPIXPeYYOtPW3R+nZ/i3NCX+DMHS/iGYEbjhcvQd28CsNSOMye6n6rrV+diWS2zOPC+b+SfLlFQbJnHCwLXcGlXmLirlisNMx4qbXhOsg+Fvl76rQd4o= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-205722ba00cso46524145ad.0 for ; Tue, 10 Sep 2024 05:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725970977; x=1726575777; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kK3of1X1Xqj2Q9vO53pAHy1UkKqvv0iqc5jfIrNPr0g=; b=diDLd2STo0tIBIfMnwTp77zsxXOUrZQ5DcF7eb+xZeIB5nivvP5TkpfN/maOJWB381 S+UIikXCRuOGktxj2ut+ByaJJvWy72d4VzX3FvquL7Bgcg8c+kUoXiwEAJx2ZXLtngO2 4agLtmvWNWAq0jmO4Yn3mCNUZ/hOIrWiWazEZhi3hXXjVcPX/hgnkduEooYB2UJAJLFo rc6wXvunNPYJ4o+OKtKAArxJi/shft0lgvAIB6eCTR+h8JHBmc+1hKJ42Cr0Jvci+Bu8 JXAFdR84DOdEsVZZKRjwzzYoHsopfCmgV7nVcpzFAuUmEWCpPU6BB1e8jiN8LQF5lXm7 W9+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725970977; x=1726575777; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kK3of1X1Xqj2Q9vO53pAHy1UkKqvv0iqc5jfIrNPr0g=; b=LiMv4NxIJMvJGpYMOGIFW6xQK9WRVoch28pWTKZzVTBHDsoOsDQdTeOQ7tWMh2ZcdG a4pRpSMcPUh3Dv7t9+37+m6gmxO+8ADk2cRcmgQ/i1+wG73iDmepBuZt/PTnAvnhuxPJ J0zPPm10KLco/2HsCmatwz1yjD9GKuEJf+P/Qb0Kwjs8+b0UJ6s5+l5jhstOyeyhlfgO ErXmI0zQYK4P95cv1CkDC/GqBKjrY4SKav5g8eEsEIFQ0VeXkm2XNNclgsJezEoeLiFi m4L0KaGM3G9J+iduS1K45TgIyjCXCTdDpmhXXRG16ezlJ2AdmX51j+AMOHlx9gHWzA3l oXJg== X-Gm-Message-State: AOJu0Yw8OvIqLcw37zfGO6ZIquUdRU+UzAEPXs9NfJUrAwGCxpDE4cV8 rFFH8wxesqnEmlAtTWqRnZQO2DC8sUoA8utBmH5WOq1gstT8Fs06sSGtNyAxfiLMDV0CJs9TFcN u X-Received: by 2002:a17:90b:164c:b0:2d3:cd5c:15bb with SMTP id 98e67ed59e1d1-2dad5181bf3mr12808075a91.25.1725970976997; Tue, 10 Sep 2024 05:22:56 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:80ff:f471:9688:94c:da67]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2db6dca2773sm552804a91.1.2024.09.10.05.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 05:22:56 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Simon Chopin Subject: [PATCH 3/3] Disable _TIME_BITS if the compiler defaults to it Date: Tue, 10 Sep 2024 09:22:19 -0300 Message-ID: <20240910122244.1995107-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240910122244.1995107-1-adhemerval.zanella@linaro.org> References: <20240910122244.1995107-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patch=linaro.org@sourceware.org Even though building glibc with 64 bit time_t flags is not supported, and the usual way is to patch the build system to avoid it; some systems do enable it by default, and it increases the requirements to build glibc in such cases (it also does not help newcomers when trying to build glibc). The conform namespace and linknamespace tests also do not expect that flag to be set by default, so disable it as well. Checked with a build/check for major ABI and some (i386, arm, mipsel, hppa) with a toolchain that has LFS flags by default. --- Makeconfig | 3 +++ configure | 30 ++++++++++++++++++++++++++++++ configure.ac | 11 +++++++++++ conform/Makefile | 2 +- 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/Makeconfig b/Makeconfig index c0c89e6685..a0abc2239b 100644 --- a/Makeconfig +++ b/Makeconfig @@ -1014,6 +1014,9 @@ endif # Filter out LFS flags if compiler defines it by default. +cflags += $(no-file-offset-bits-source) +# Filter out 64 bit time_t flags if compiler defines it by default. ++cflags += $(no-time-bits-source) + # Each sysdeps directory can contain header files that both will be # used to compile and will be installed. Each can also contain an # include/ subdirectory, whose header files will be used to compile diff --git a/configure b/configure index 5b9cc51067..9c0c0dce03 100755 --- a/configure +++ b/configure @@ -635,6 +635,7 @@ libc_cv_gcc_unwind_find_fde libc_extra_cppflags libc_extra_cflags libc_cv_cxx_thread_local +no_time_bits_source no_file_offset_bits_source fortify_source no_fortify_source @@ -7815,6 +7816,35 @@ fi config_vars="$config_vars no-file-offset-bits-source = $no_file_offset_bits_source" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#ifndef _TIME_BITS +# error _TIME_BITS not defined +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + libc_cv_compiler_default_time_bits=yes +else case e in #( + e) libc_cv_compiler_default_time_bits=no ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext +if test "$libc_cv_compiler_default_time_bits" = yes +then : + no_time_bits_source="-U_TIME_BITS" +fi + +config_vars="$config_vars +no-time-bits-source = $no_time_bits_source" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the assembler requires one version per symbol" >&5 printf %s "checking whether the assembler requires one version per symbol... " >&6; } diff --git a/configure.ac b/configure.ac index 160c863416..d5a00461ff 100644 --- a/configure.ac +++ b/configure.ac @@ -1576,6 +1576,17 @@ AS_IF([test "$libc_cv_compiler_default_file_offset_bits" = yes], AC_SUBST(no_file_offset_bits_source) LIBC_CONFIG_VAR([no-file-offset-bits-source], [$no_file_offset_bits_source]) +dnl Check if compiler define _TIME_BITS by default +AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[ +#ifndef _TIME_BITS +# error _TIME_BITS not defined +#endif]])], + [libc_cv_compiler_default_time_bits=yes], + [libc_cv_compiler_default_time_bits=no]) +AS_IF([test "$libc_cv_compiler_default_time_bits" = yes], + [no_time_bits_source="-U_TIME_BITS"]) +AC_SUBST(no_time_bits_source) +LIBC_CONFIG_VAR([no-time-bits-source], [$no_time_bits_source]) dnl Starting with binutils 2.35, GAS can attach multiple symbol versions dnl to one symbol (PR 23840). diff --git a/conform/Makefile b/conform/Makefile index 50293a195b..57a1f5b546 100644 --- a/conform/Makefile +++ b/conform/Makefile @@ -372,7 +372,7 @@ test-xfail-UNIX98/ndbm.h/conform = yes test-xfail-XOPEN2K/ndbm.h/conform = yes test-xfail-XOPEN2K8/ndbm.h/conform = yes -conformtest-cc-flags = -I../include $(+sysdep-includes) $(sysincludes) -I.. $(no-file-offset-bits-source) +conformtest-cc-flags = -I../include $(+sysdep-includes) $(sysincludes) -I.. $(no-file-offset-bits-source) $(no-time-bits-source) # conformtest-xfail-conds may be set by a sysdeps Makefile fragment to # a list of conditions that are considered to be true when encountered # in xfail[cond]- lines in test expectations.