From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by sourceware.org (Postfix) with ESMTPS id 079533858C98 for ; Thu, 4 Apr 2024 14:05:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 079533858C98 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 079533858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::333 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712239555; cv=none; b=R/5NprQNAh7/N0bu0xd10j6drLOXn76wkl0qBUHCl0TE79Di03QRQCLZYBMOZPPdrXQHHBTbcJLydasXDZ/xhkYqWnXp28cCJQquxb4RQAinVrqcyM5t8QcTEz7zbz1014mYdigc3NzoFQ0PFqp/hYNbY/jCgxt+61+alXqgGrg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712239555; c=relaxed/simple; bh=gHRb4Yn+h0JJojQinf0JaNFx9ap/LNy7fbYesr5QH8A=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=FPgyxHB1HlHgyvNiq3RZYyIIN3f4eiAiPhdb7GMveRbfQXXtLIRrFNAUKYU9POjXrjXMs4Rz2o4v0wlOUUnk6HSJf/nZ8J1loyZPh1/4F+ojpsklxP3RWEJEqQsIqf3mFtFQuxUeZE1h7Gcu+1xGHGqyBEbsNTTCuJaX9ADfH5g= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4162ad6453aso4657245e9.0 for ; Thu, 04 Apr 2024 07:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1712239551; x=1712844351; darn=sourceware.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=gQVwihMKthb79r02IbOAvmca5kOyT9bSXIQ475OLR00=; b=PN7UZQVVsIC8+Tbbw8+xPV6sM43OHwAMWoh9LAvzYSuh+ZFnxx1ZFGQVoFVCFPVM8e E0xtBnKkpRUy8EdVydHdBS67jfHijYypLh2xJ3Speu01XaKTrrb32sNHPzUxxPoQHpFF UDGJp+3IjIo4DqzWmpTXekGzN03l3IPbblUpVBtAXIBfAvmakjW+H8F2vYKHTlVJ2s6I XH0GHfB7SAv8dRMKKA5euWcqY6m4G9Ppp4CoV+4puDrF9j3uCKzNVW9ryOt4btg/u2Xh h0qFHJ5jt4nrPYBUsHOSQbBM/4q9mCf2x/6J+WDjsNVLmtDnN1yM5/HBq59lxl8ilnik be2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712239551; x=1712844351; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gQVwihMKthb79r02IbOAvmca5kOyT9bSXIQ475OLR00=; b=rlQ4L73m6K7SnbJ1PSho9uYwcrphXDY0gLcrUFCJx4oqE6nrZCUW9NfhP83VGzKn3c 1aqjfO2ONJrhQqYbbMfmUeekzr5gHi8qtPVpjrxuwPQdU9xrCSSKMZb/U84QvU1TwL4A i2FZEyxbN8KREwwvWAeSyS+BymzXoV5KsY9YQg4i0jhusHiQVIvtczBL+D2WLR4+90y5 36rSNJRnLSylaPdRAVRcbhp2rBPtEh9Q2OPPk7IvE47sUG1VnngUgqIY/om6MuZ5GQcP eFJkFIy8J7XS9XqQsb2fJaLV1/zXh5SYaVmPsO1Rzm6X40dZK2BADuuzS8ISBtjpTwjv kfQw== X-Forwarded-Encrypted: i=1; AJvYcCUW/Osuq3qJ7eNASVVBcyyrPbCEltPz2i/N4Tq8d60FrQyL0RPmBHD9L9yM4P8PbJvkUOzMydndDo10dApH38ghj1DPQjQ= X-Gm-Message-State: AOJu0YzCo05YMgUUGGPYuZ575OFkFKrRFWpMMSoby9XRFP2eK4DojUE0 gFjh5IMWK71enULXyfVD3ajryvivTJElQEegeTXjM2kSnkO4diOUgZyZl/Gn2jTApgG6K4aRFRF ckJE= X-Google-Smtp-Source: AGHT+IHJox5eO/pY/9MKrRsHEl7fBCQowNq7WS3oz+ooEnnTSu95bT0ze2dBV5d1bgAhnHVBgsW+VQ== X-Received: by 2002:a05:600c:998:b0:415:6b9a:326d with SMTP id w24-20020a05600c099800b004156b9a326dmr2215626wmp.4.1712239550586; Thu, 04 Apr 2024 07:05:50 -0700 (PDT) Received: from euler.schwinge.homeip.net (p200300c8b70336000b0134869109dcb1.dip0.t-ipconnect.de. [2003:c8:b703:3600:b01:3486:9109:dcb1]) by smtp.gmail.com with ESMTPSA id ee6-20020a056000210600b00343826878e8sm5894597wrb.38.2024.04.04.07.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 07:05:49 -0700 (PDT) From: Thomas Schwinge To: Andrew Stubbs , newlib@sourceware.org Subject: amdgcn: Implement proper locks: Fix 'newlib/libc/sys/amdgcn/include/sys/lock.h' for C++ (was: [PATCH] amdgcn: Implement proper locks) In-Reply-To: <20240322145330.761851-1-ams@baylibre.com> References: <20240322145330.761851-1-ams@baylibre.com> User-Agent: Notmuch/0.30+8~g47a4bad (https://notmuchmail.org) Emacs/29.2 (x86_64-pc-linux-gnu) Date: Thu, 04 Apr 2024 16:05:47 +0200 Message-ID: <874jchfcjo.fsf@euler.schwinge.ddns.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,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 List-Id: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! On 2024-03-22T14:53:30+0000, Andrew Stubbs wrote: > This should prevent printf output from multiple threads getting garbled. Confirmed, thanks! > I don't know why IO ever worked properly -- probably it was always a bit > broken -- but the GFX11 devices have a different cache architecture and > trying to print from many threads at once corrupted the FILE buffers. > --- /dev/null > +++ b/newlib/libc/sys/amdgcn/include/sys/lock.h > @@ -0,0 +1,39 @@ > +#ifndef __SYS_LOCK_H__ > +#define __SYS_LOCK_H__ > + > +#include > +#include <_ansi.h> > + > +typedef unsigned int _LOCK_T; > +[...] > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* __SYS_LOCK_H__ */ Pushed to main branch commit ed50a50b9b551ed693d28cd458a49e5196d27f06 "amdgcn: Implement proper locks: Fix 'newlib/libc/sys/amdgcn/include/sys/lo= ck.h' for C++", see attached. Gr=C3=BC=C3=9Fe Thomas --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-amdgcn-Implement-proper-locks-Fix-newlib-libc-sys-am.patch >From ed50a50b9b551ed693d28cd458a49e5196d27f06 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 4 Apr 2024 16:01:35 +0200 Subject: [PATCH] amdgcn: Implement proper locks: Fix 'newlib/libc/sys/amdgcn/include/sys/lock.h' for C++ As of commit 7dd4eb1db9e1b1b9f14ef5b743705156e5f370e1 "amdgcn: Implement proper locks", we get, by the thousands, for C++ code: In file included from [...]/newlib/libc/include/stdio.h:60, from [...]: [...]/newlib/libc/include/sys/reent.h:911:1: error: expected declaration before '}' token --- newlib/libc/sys/amdgcn/include/sys/lock.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/newlib/libc/sys/amdgcn/include/sys/lock.h b/newlib/libc/sys/amdgcn/include/sys/lock.h index 0e0e667e5e..1f41cf2f7d 100644 --- a/newlib/libc/sys/amdgcn/include/sys/lock.h +++ b/newlib/libc/sys/amdgcn/include/sys/lock.h @@ -4,6 +4,10 @@ #include #include <_ansi.h> +#ifdef __cplusplus +extern "C" { +#endif + typedef unsigned int _LOCK_T; typedef unsigned int _LOCK_RECURSIVE_T; -- 2.34.1 --=-=-=--