From patchwork Fri Jan 10 20:44:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1221438 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-517192-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=mTR4TPKn; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I8/MNOgH; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47vZjq4bPGz9sPJ for ; Sat, 11 Jan 2020 07:45:02 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=YszQDoz5aN+Che9Z EBkX+9YMnrYpCrjb7Y6XtL1y+H0pN02J4Y2pxkHIhPk5Ht1nP9Bq5P4UtlcG1zJa 2fJr07Q6trn1YvVHmYoQquHQcyVyFrnVRsO0SrwOHf/IdEiVyZXp7taEiM/FXCxu jlNrbQjhXgo4sr3Fnq5dQ9tU+kw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type :content-transfer-encoding; s=default; bh=7xSk5q1k4+uB6G+e48kFKq dRyPA=; b=mTR4TPKnN60ibJAHp6s+f+hR8Tv9ATqn2nUHt136l9+QQ2zDG7IjIU XkacCW9aShi5S8CY/+k3fMHnYrxnJvaL3eGx4EE9w9qlQWhrKlNUeVHfe6wjSvnh drxVNAIiO/JIs0ALJXHpxO+DRuPTUByXEpl9wjD2FnIAvg6EHkDIk= Received: (qmail 70390 invoked by alias); 10 Jan 2020 20:44:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 70327 invoked by uid 89); 10 Jan 2020 20:44:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Jan 2020 20:44:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578689069; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i4nf0bQDPbjIjX2vpzgmoTMhhf3+z8tY3xx35e3OuhU=; b=I8/MNOgH/rVQLX8SVmqsgHxsdue09Df6bws9P5edGvg5CTX7DXiMh3EQoQzchozVctZZyG 5pGBw/tdZAfpNUZyDflEVC4dDVCAyz8E8TEjevd7G6fmDhp2pJ4zQzewXl17C2KqPwJxan q2enfcJtpAYjLxQHtqYQrD+/UXs+26U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-ijI1MNh9MeOflb7xEbkEtw-1; Fri, 10 Jan 2020 15:44:28 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3C9B4107ACC4 for ; Fri, 10 Jan 2020 20:44:27 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-112.ams2.redhat.com [10.36.116.112]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC0DF5DA60 for ; Fri, 10 Jan 2020 20:44:26 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 00AKiODu000589 for ; Fri, 10 Jan 2020 21:44:25 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 00AKiNhb000588 for gcc-patches@gcc.gnu.org; Fri, 10 Jan 2020 21:44:23 +0100 Date: Fri, 10 Jan 2020 21:44:23 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Fix libgomp build with -D_FORTIFY_SOURCE on older glibcs (PR libgomp/93219) Message-ID: <20200110204423.GA10088@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 User-Agent: Mutt/1.11.3 (2019-02-01) X-Mimecast-Spam-Score: 0 Content-Disposition: inline X-IsSubscribed: yes Hi! Older glibcs used to declare fwrite with -D_FORTIFY_SOURCE{,=2} as warn_unused_result. The following is just an workaround against that, not really using it in the end, but just letting the compiler think we are. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2020-01-10 Jakub Jelinek PR libgomp/93219 * libgomp.h (gomp_print_string): Change return type from void to int. * affinity-fmt.c (gomp_print_string): Likewise. Return true if not all characters have been written. Jakub --- libgomp/libgomp.h.jj 2020-01-01 12:22:44.501317101 +0100 +++ libgomp/libgomp.h 2020-01-10 17:56:35.608708963 +0100 @@ -832,7 +832,7 @@ extern void gomp_display_affinity_place /* affinity-fmt.c */ -extern void gomp_print_string (const char *str, size_t len); +extern bool gomp_print_string (const char *str, size_t len); extern void gomp_set_affinity_format (const char *, size_t); extern void gomp_display_string (char *, size_t, size_t *, const char *, size_t); --- libgomp/affinity-fmt.c.jj 2020-01-01 12:22:44.624315244 +0100 +++ libgomp/affinity-fmt.c 2020-01-10 17:57:39.098773137 +0100 @@ -37,10 +37,10 @@ #include #endif -void +bool gomp_print_string (const char *str, size_t len) { - fwrite (str, 1, len, stderr); + return fwrite (str, 1, len, stderr) != len; } void