public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD
@ 2024-07-09  6:26 Sebastian Huber
  2024-07-09  6:26 ` [PATCH 1/4] sys/sys: further adoption of SPDX licensing ID tags Sebastian Huber
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Sebastian Huber @ 2024-07-09  6:26 UTC (permalink / raw)
  To: newlib

Konstantin Belousov (1):
  sys/stdatomic.h: be nicer to c++

Pedro F. Giffuni (1):
  sys/sys: further adoption of SPDX licensing ID tags.

Warner Losh (2):
  spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
  sys: Remove $FreeBSD$: two-line .h pattern

 newlib/libc/include/stdatomic.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

-- 
2.35.3


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] sys/sys: further adoption of SPDX licensing ID tags.
  2024-07-09  6:26 [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD Sebastian Huber
@ 2024-07-09  6:26 ` Sebastian Huber
  2024-07-09  6:26 ` [PATCH 2/4] sys/stdatomic.h: be nicer to c++ Sebastian Huber
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Sebastian Huber @ 2024-07-09  6:26 UTC (permalink / raw)
  To: newlib

From: "Pedro F. Giffuni" <pfg@FreeBSD.org>

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
---
 newlib/libc/include/stdatomic.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/newlib/libc/include/stdatomic.h b/newlib/libc/include/stdatomic.h
index d58e795eb..f62ae7b6a 100644
--- a/newlib/libc/include/stdatomic.h
+++ b/newlib/libc/include/stdatomic.h
@@ -1,4 +1,6 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
  * Copyright (c) 2011 Ed Schouten <ed@FreeBSD.org>
  *                    David Chisnall <theraven@FreeBSD.org>
  * All rights reserved.
-- 
2.35.3


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/4] sys/stdatomic.h: be nicer to c++
  2024-07-09  6:26 [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD Sebastian Huber
  2024-07-09  6:26 ` [PATCH 1/4] sys/sys: further adoption of SPDX licensing ID tags Sebastian Huber
@ 2024-07-09  6:26 ` Sebastian Huber
  2024-07-09  6:26 ` [PATCH 3/4] spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD Sebastian Huber
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Sebastian Huber @ 2024-07-09  6:26 UTC (permalink / raw)
  To: newlib

From: Konstantin Belousov <kib@FreeBSD.org>

Use of stdatomic.h is undefined in C++, even the C++ 2020 standard does not
list stdatomic.h as a C library header supported by the language.  More,
there are some subtle differences between the <atomic> C++ header, and
C11+ stdatomic.h provided features.

Nonetheless, it is a quality of the implementation aspect, so let mis-users
mis-use stdatomic.h as they want, by making a compat shim for _Bool.

PR:	262683
Reported by:	yuri
Reviewed by:	dim, emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D34686
---
 newlib/libc/include/stdatomic.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/newlib/libc/include/stdatomic.h b/newlib/libc/include/stdatomic.h
index f62ae7b6a..1acec53c0 100644
--- a/newlib/libc/include/stdatomic.h
+++ b/newlib/libc/include/stdatomic.h
@@ -163,6 +163,11 @@ atomic_signal_fence(memory_order __order __unused)
 #endif
 }
 
+#if defined(__cplusplus) && !defined(_Bool)
+#define	_Bool	bool
+#define	__bool_locally_defined
+#endif
+
 /*
  * 7.17.5 Lock-free property.
  */
@@ -408,4 +413,9 @@ atomic_flag_clear(volatile atomic_flag *__object)
 }
 #endif /* !_KERNEL */
 
+#ifdef __bool_locally_defined
+#undef _Bool
+#undef __bool_locally_defined
+#endif
+
 #endif /* !_STDATOMIC_H_ */
-- 
2.35.3


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/4] spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
  2024-07-09  6:26 [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD Sebastian Huber
  2024-07-09  6:26 ` [PATCH 1/4] sys/sys: further adoption of SPDX licensing ID tags Sebastian Huber
  2024-07-09  6:26 ` [PATCH 2/4] sys/stdatomic.h: be nicer to c++ Sebastian Huber
@ 2024-07-09  6:26 ` Sebastian Huber
  2024-07-09  6:26 ` [PATCH 4/4] sys: Remove $FreeBSD$: two-line .h pattern Sebastian Huber
  2024-07-09 10:33 ` [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD Corinna Vinschen
  4 siblings, 0 replies; 8+ messages in thread
From: Sebastian Huber @ 2024-07-09  6:26 UTC (permalink / raw)
  To: newlib

From: Warner Losh <imp@FreeBSD.org>

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
---
 newlib/libc/include/stdatomic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/include/stdatomic.h b/newlib/libc/include/stdatomic.h
index 1acec53c0..6e435bf21 100644
--- a/newlib/libc/include/stdatomic.h
+++ b/newlib/libc/include/stdatomic.h
@@ -1,5 +1,5 @@
 /*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
  *
  * Copyright (c) 2011 Ed Schouten <ed@FreeBSD.org>
  *                    David Chisnall <theraven@FreeBSD.org>
-- 
2.35.3


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/4] sys: Remove $FreeBSD$: two-line .h pattern
  2024-07-09  6:26 [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD Sebastian Huber
                   ` (2 preceding siblings ...)
  2024-07-09  6:26 ` [PATCH 3/4] spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD Sebastian Huber
@ 2024-07-09  6:26 ` Sebastian Huber
  2024-07-09 10:33 ` [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD Corinna Vinschen
  4 siblings, 0 replies; 8+ messages in thread
From: Sebastian Huber @ 2024-07-09  6:26 UTC (permalink / raw)
  To: newlib

From: Warner Losh <imp@FreeBSD.org>

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
---
 newlib/libc/include/stdatomic.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/newlib/libc/include/stdatomic.h b/newlib/libc/include/stdatomic.h
index 6e435bf21..2bb976f2d 100644
--- a/newlib/libc/include/stdatomic.h
+++ b/newlib/libc/include/stdatomic.h
@@ -25,8 +25,6 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD$
  */
 
 #ifndef _STDATOMIC_H_
-- 
2.35.3


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD
  2024-07-09  6:26 [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD Sebastian Huber
                   ` (3 preceding siblings ...)
  2024-07-09  6:26 ` [PATCH 4/4] sys: Remove $FreeBSD$: two-line .h pattern Sebastian Huber
@ 2024-07-09 10:33 ` Corinna Vinschen
  2024-07-09 16:03   ` brian.inglis
  4 siblings, 1 reply; 8+ messages in thread
From: Corinna Vinschen @ 2024-07-09 10:33 UTC (permalink / raw)
  To: Sebastian Huber; +Cc: newlib

On Jul  9 08:26, Sebastian Huber wrote:
> Konstantin Belousov (1):
>   sys/stdatomic.h: be nicer to c++
> 
> Pedro F. Giffuni (1):
>   sys/sys: further adoption of SPDX licensing ID tags.
> 
> Warner Losh (2):
>   spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
>   sys: Remove $FreeBSD$: two-line .h pattern
> 
>  newlib/libc/include/stdatomic.h | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> -- 
> 2.35.3

LGTM, please push.

Thanks,
Corinna


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD
  2024-07-09 10:33 ` [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD Corinna Vinschen
@ 2024-07-09 16:03   ` brian.inglis
  2024-07-09 18:28     ` Corinna Vinschen
  0 siblings, 1 reply; 8+ messages in thread
From: brian.inglis @ 2024-07-09 16:03 UTC (permalink / raw)
  To: newlib

On 2024-07-09 04:33, Corinna Vinschen wrote:
> On Jul  9 08:26, Sebastian Huber wrote:
>> Konstantin Belousov (1):
>>    sys/stdatomic.h: be nicer to c++
>>
>> Pedro F. Giffuni (1):
>>    sys/sys: further adoption of SPDX licensing ID tags.
>>
>> Warner Losh (2):
>>    spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
>>    sys: Remove $FreeBSD$: two-line .h pattern
>>
>>   newlib/libc/include/stdatomic.h | 14 ++++++++++++--
>>   1 file changed, 12 insertions(+), 2 deletions(-)

Don't you also need to see [PATCH 4/4]?

>>    sys: Remove $FreeBSD$: two-line .h pattern

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD
  2024-07-09 16:03   ` brian.inglis
@ 2024-07-09 18:28     ` Corinna Vinschen
  0 siblings, 0 replies; 8+ messages in thread
From: Corinna Vinschen @ 2024-07-09 18:28 UTC (permalink / raw)
  To: brian.inglis; +Cc: newlib

On Jul  9 10:03, brian.inglis@systematicsw.ab.ca wrote:
> On 2024-07-09 04:33, Corinna Vinschen wrote:
> > On Jul  9 08:26, Sebastian Huber wrote:
> > > Konstantin Belousov (1):
> > >    sys/stdatomic.h: be nicer to c++
> > > 
> > > Pedro F. Giffuni (1):
> > >    sys/sys: further adoption of SPDX licensing ID tags.
> > > 
> > > Warner Losh (2):
> > >    spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
> > >    sys: Remove $FreeBSD$: two-line .h pattern
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	 This one?

> > > 
> > >   newlib/libc/include/stdatomic.h | 14 ++++++++++++--
> > >   1 file changed, 12 insertions(+), 2 deletions(-)
> 
> Don't you also need to see [PATCH 4/4]?
> 
> > >    sys: Remove $FreeBSD$: two-line .h pattern
> 
> -- 
> Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada
> 
> La perfection est atteinte                   Perfection is achieved
> non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
> mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
>                                 -- Antoine de Saint-Exupéry


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-07-09 18:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-09  6:26 [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD Sebastian Huber
2024-07-09  6:26 ` [PATCH 1/4] sys/sys: further adoption of SPDX licensing ID tags Sebastian Huber
2024-07-09  6:26 ` [PATCH 2/4] sys/stdatomic.h: be nicer to c++ Sebastian Huber
2024-07-09  6:26 ` [PATCH 3/4] spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD Sebastian Huber
2024-07-09  6:26 ` [PATCH 4/4] sys: Remove $FreeBSD$: two-line .h pattern Sebastian Huber
2024-07-09 10:33 ` [PATCH 0/4] Synchronize <stdatomic.h> with FreeBSD Corinna Vinschen
2024-07-09 16:03   ` brian.inglis
2024-07-09 18:28     ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).