From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by sourceware.org (Postfix) with ESMTPS id AF5A63858D28 for ; Sat, 29 Jan 2022 03:01:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AF5A63858D28 Received: by mail-pj1-x1034.google.com with SMTP id b1-20020a17090a990100b001b14bd47532so8209519pjp.0 for ; Fri, 28 Jan 2022 19:01:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jw8dAM0XTOdxvopzwvkPokm6Ahm+K+JTWlsPP2FeAFo=; b=FEW+fW/CqwjL8WJ9FIVlBP1sZJtMkDxbhYl1+sp3F+ViWaImvYuHuh+v6GkJpox3/d oxSg1Gckxgj9tKGS3u7T37Yv5GFV9EOKOoMNuso7jSaOhPmjSStloUkI3K8b0468NUb9 Gf/G9QB3NPDSfWeBrId4xvs5ljluPhD2OAjYUItkBqjEelu7QC0bWQGm77kjlw9w8Ws2 RFzY4PnY91psELzJuBPPifp3rYadprq7PiOnZFdH1GSeIl4/2BjF15gK4vFQJqB9X2lq xbafcCxWQL/mgkz6u3hQX4f/ikze917gQ6VxLMTz7UKrxOvZgvJNTgsqZb93lFYDIyu4 7FWQ== X-Gm-Message-State: AOAM533T/sIKHtDXCo0vQyeZHS5/6cRgmcnYL5YD0HPeQb6Bk6DY/jdP 3MQWxIOeKE8szRsO64L63PzbWvy28VXory5xOKOzbiXqBHc= X-Google-Smtp-Source: ABdhPJw4vCBmXGvL4xB8xmQmh7CqWBybBso5piysYeCkJyL5ZoSIiNVFFDVfvGkNfMuXcAjxYtmhYoThn5178w8zSe0= X-Received: by 2002:a17:903:2350:: with SMTP id c16mr11626925plh.4.1643425292646; Fri, 28 Jan 2022 19:01:32 -0800 (PST) MIME-Version: 1.0 References: <20220129023727.1496360-1-andrew@ziglang.org> In-Reply-To: <20220129023727.1496360-1-andrew@ziglang.org> From: "H.J. Lu" Date: Fri, 28 Jan 2022 19:00:56 -0800 Message-ID: Subject: Re: [PATCH] features: version-gate _DYNAMIC_STACK_SIZE_SOURCE To: Andrew Kelley Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3027.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2022 03:01:35 -0000 On Fri, Jan 28, 2022 at 6:38 PM Andrew Kelley wrote: > > Without this patch, software compiled against glibc 2.34 headers but > then executed on a system with an older glibc version will attempt to > invoke `sysconf(_SC_SIGSTKSZ)` when MINSIGSTKSZ or SIGSTKSZ are used. On > glibcs older than 2.34, this will return -1 (with an errno of EINVAL), > effectively causing MINSIGSTKSZ and SIGSTKSZ to have the value of -1. > > This patch version-gates the _DYNAMIC_STACK_SIZE_SOURCE preprocessor > definition so that this problem cannot occur. > > Downstream patch: > https://github.com/ziglang/zig/commit/39083c31a550ed80f369f60d35791e98904b8096 > --- > include/features.h | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/include/features.h b/include/features.h > index ab2b2caac4..77a8f8cc32 100644 > --- a/include/features.h > +++ b/include/features.h > @@ -220,8 +220,10 @@ > # define _DEFAULT_SOURCE 1 > # undef _ATFILE_SOURCE > # define _ATFILE_SOURCE 1 > -# undef _DYNAMIC_STACK_SIZE_SOURCE > -# define _DYNAMIC_STACK_SIZE_SOURCE 1 > +# if __GNUC_PREREQ (2,34) > +# undef _DYNAMIC_STACK_SIZE_SOURCE > +# define _DYNAMIC_STACK_SIZE_SOURCE 1 You are changing a glibc 2.35 header file. Isn't __GNUC_PREREQ (2,34) always true? Am I missing something? > +# endif > #endif > > /* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, > -- > 2.33.1 > -- H.J.