[PATCH] Synchronize all file descriptors in sync()

2022-05-13 Thread Sebastian Huber
Synchronize all file descriptors and not just the ones associated with a FILE
object.

Close #4656.
---
 cpukit/libcsupport/src/sync.c | 84 +--
 1 file changed, 12 insertions(+), 72 deletions(-)

diff --git a/cpukit/libcsupport/src/sync.c b/cpukit/libcsupport/src/sync.c
index dc50ae1121..116b22b617 100644
--- a/cpukit/libcsupport/src/sync.c
+++ b/cpukit/libcsupport/src/sync.c
@@ -1,15 +1,15 @@
 /* SPDX-License-Identifier: BSD-2-Clause */
 
 /**
- *  @file
+ * @file
  *
- *  @brief Synchronize Data on Disk with Memory 
- *  @ingroup libcsupport
+ * @ingroup libcsupport
+ *
+ * @brief This source file contains the implementation of sync().
  */
 
 /*
- *  COPYRIGHT (c) 1989-2008.
- *  On-Line Applications Research Corporation (OAR).
+ * Copyright (C) 2022 embedded brains GmbH.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,76 +37,16 @@
 #include "config.h"
 #endif
 
-#include 
 #include 
-#include 
-
-#include 
-#include 
-#include 
 
-/* In Newlib this function is declared in a private header file */
-int _fwalk_reent (struct _reent *, int (*)(struct _reent *, FILE *));
+#include 
 
-static int sync_wrapper(struct _reent *reent, FILE *f)
+void sync( void )
 {
-  int fn = fileno(f);
-
-  (void) reent;
-
-  /*
-   * There is no way to report errors here.  So this is a best-effort approach.
-   */
-  (void) fsync(fn);
-  (void) fdatasync(fn);
-
-  return 0;
-}
-
-/* iterate over all FILE *'s for this thread */
-static bool sync_per_thread(Thread_Control *t, void *arg)
-{
-   struct _reent *current_reent;
-   struct _reent *this_reent;
-
-   /*
-*  The sync_wrapper() function will operate on the current thread's
-*  reent structure so we will temporarily use that.
-*/
-   this_reent = t->libc_reent;
-   if ( this_reent ) {
- Thread_Control *executing = _Thread_Get_executing();
- current_reent = executing->libc_reent;
- executing->libc_reent = this_reent;
- _fwalk_reent (this_reent, sync_wrapper);
- executing->libc_reent = current_reent;
-   }
-
-   return false;
-}
-
-/**
- * This function operates by as follows:
- *for all threads
- *  for all FILE *
- * fsync()
- * fdatasync()
- */
-void sync(void)
-{
-
-  /*
-   *  Walk the one used initially by RTEMS.
-   */
-  _fwalk_reent(_GLOBAL_REENT, sync_wrapper);
-
-  /*
-   *  XXX Do we walk the one used globally by newlib?
-   *  XXX Do we need the RTEMS global one?
-   */
+  uint32_t fd;
 
-  /*
-   *  Now walk all the per-thread reentrancy structures.
-   */
-  rtems_task_iterate(sync_per_thread, NULL);
+  for ( fd = 0; fd < rtems_libio_number_iops; ++fd ) {
+(void) fsync( (int) fd );
+(void) fdatasync( (int) fd );
+  }
 }
-- 
2.35.3

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] ISL, MPC, MPFR: fix configuration issues on ARM64/Darwin host

2022-05-13 Thread Karel Gardas
Sponsored-By:   Precidata
---
 rtems/config/tools/rtems-gcc-12-newlib-head.cfg |  7 +++
 rtems/patches/fix-mac-arm64-isl-config.patch| 12 
 rtems/patches/fix-mac-arm64-mpc-config.patch| 13 +
 rtems/patches/fix-mac-arm64-mpfr-config.patch   | 12 
 4 files changed, 44 insertions(+)
 create mode 100644 rtems/patches/fix-mac-arm64-isl-config.patch
 create mode 100644 rtems/patches/fix-mac-arm64-mpc-config.patch
 create mode 100644 rtems/patches/fix-mac-arm64-mpfr-config.patch

diff --git a/rtems/config/tools/rtems-gcc-12-newlib-head.cfg 
b/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
index 4ea99a0..95b38c6 100644
--- a/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
+++ b/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
@@ -13,6 +13,13 @@
 %patch add newlib -p1 
https://devel.rtems.org/raw-attachment/ticket/4510/0001-aarch64-Add-ILP32-ABI-support-in-assembly-v2.patch
 %hash sha512 0001-aarch64-Add-ILP32-ABI-support-in-assembly-v2.patch 
7ca237eabfd5b382713186e1fc290dfc999a353315795ecb8dd0d22fcd1ab7f5bf31f4329954adab91ad04c100dcac0e86d406fdbce8f82cf9dc23842c88caf6
 
+%patch add isl -p1 file://fix-mac-arm64-isl-config.patch
+%hash sha512 fix-mac-arm64-isl-config.patch 
c07fdb605a6520d194358504731e63b540211ef680383f1ca4ec65b4ac43ae27687534fd7d8196a4dbe83a0ecf2c42a4254c71e609ee484a7614573bc499a2e8
+%patch add mpfr -p1 file://fix-mac-arm64-mpfr-config.patch
+%hash sha512 fix-mac-arm64-mpfr-config.patch 
dc5069df870bd02b7e78ed22c6ad9e9a2bb9ca372ce1a6b7e8fa5b7635dcef35c29f251fe5195c9c2a43513116c12cab1b0e96171cf34bd7fb7d0334c2c740fb
+%patch add mpc -p1 file://fix-mac-arm64-mpc-config.patch
+%hash sha512 fix-mac-arm64-mpc-config.patch 
2849b11e360ea98e0b4d708c67723ad2d6c7bac6d1e469673f408b0111cf0278429e8bc38fd2b7538dc2d5bb0cc430c646a0fa7f0b6b105a0482a5455fadc8b9
+
 %define newlib_version 64b2081
 %define newlib_external 1
 %define newlib_expand_name sourceware-mirror-newlib-cygwin-%{newlib_version}
diff --git a/rtems/patches/fix-mac-arm64-isl-config.patch 
b/rtems/patches/fix-mac-arm64-isl-config.patch
new file mode 100644
index 000..6b8f07d
--- /dev/null
+++ b/rtems/patches/fix-mac-arm64-isl-config.patch
@@ -0,0 +1,12 @@
+--- isl/config.sub.orig2022-05-11 07:19:04.0 +0200
 isl/config.sub 2022-05-11 07:19:26.0 +0200
+@@ -516,6 +516,9 @@
+   basic_machine=m68k-apollo
+   os=-bsd
+   ;;
++  arm64-*)
++  basic_machine=aarch64-`echo "$basic_machine" | sed 
's/^[^-]*-//'`
++  ;;
+   aros)
+   basic_machine=i386-pc
+   os=-aros
diff --git a/rtems/patches/fix-mac-arm64-mpc-config.patch 
b/rtems/patches/fix-mac-arm64-mpc-config.patch
new file mode 100644
index 000..89ea483
--- /dev/null
+++ b/rtems/patches/fix-mac-arm64-mpc-config.patch
@@ -0,0 +1,13 @@
+--- mpc/build-aux/config.sub.orig  2022-05-11 09:20:51.0 +0200
 mpc/build-aux/config.sub   2022-05-11 09:23:47.0 +0200
+@@ -916,6 +916,10 @@
+   cpu=sparc
+   vendor=`echo "$basic_machine" | sed 's/-.*//'`
+   ;;
++  arm64-*)
++  cpu=aarch64
++  vendor=`echo "$basic_machine" | sed 's/-.*//'`
++  ;;
+ 
+   *-*)
+   # shellcheck disable=SC2162
diff --git a/rtems/patches/fix-mac-arm64-mpfr-config.patch 
b/rtems/patches/fix-mac-arm64-mpfr-config.patch
new file mode 100644
index 000..37cec7e
--- /dev/null
+++ b/rtems/patches/fix-mac-arm64-mpfr-config.patch
@@ -0,0 +1,12 @@
+--- mpfr/config.sub.orig   2022-05-11 07:13:02.0 +0200
 mpfr/config.sub2022-05-11 07:14:42.0 +0200
+@@ -516,6 +516,9 @@
+   basic_machine=m68k-apollo
+   os=-bsd
+   ;;
++  arm64-*)
++  basic_machine=aarch64-`echo "$basic_machine" | sed 
's/^[^-]*-//'`
++  ;;
+   aros)
+   basic_machine=i386-pc
+   os=-aros
-- 
2.25.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] ISL, MPC, MPFR: fix configuration issues on ARM64/Darwin host

2022-05-13 Thread Joel Sherrill
We do not put patches in RTEMS repos. File an rtems ticket, attach them,
and reference them from there.

If they are needed upstream, please submit them to the appropriate projects.

Otherwise, I can't test this so don't have much to say. Looks necessary
based on email discussions.

--joel

On Fri, May 13, 2022 at 8:48 AM Karel Gardas 
wrote:

> Sponsored-By:   Precidata
> ---
>  rtems/config/tools/rtems-gcc-12-newlib-head.cfg |  7 +++
>  rtems/patches/fix-mac-arm64-isl-config.patch| 12 
>  rtems/patches/fix-mac-arm64-mpc-config.patch| 13 +
>  rtems/patches/fix-mac-arm64-mpfr-config.patch   | 12 
>  4 files changed, 44 insertions(+)
>  create mode 100644 rtems/patches/fix-mac-arm64-isl-config.patch
>  create mode 100644 rtems/patches/fix-mac-arm64-mpc-config.patch
>  create mode 100644 rtems/patches/fix-mac-arm64-mpfr-config.patch
>
> diff --git a/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
> b/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
> index 4ea99a0..95b38c6 100644
> --- a/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
> +++ b/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
> @@ -13,6 +13,13 @@
>  %patch add newlib -p1
> https://devel.rtems.org/raw-attachment/ticket/4510/0001-aarch64-Add-ILP32-ABI-support-in-assembly-v2.patch
>  %hash sha512 0001-aarch64-Add-ILP32-ABI-support-in-assembly-v2.patch
> 7ca237eabfd5b382713186e1fc290dfc999a353315795ecb8dd0d22fcd1ab7f5bf31f4329954adab91ad04c100dcac0e86d406fdbce8f82cf9dc23842c88caf6
>
> +%patch add isl -p1 file://fix-mac-arm64-isl-config.patch
> +%hash sha512 fix-mac-arm64-isl-config.patch
> c07fdb605a6520d194358504731e63b540211ef680383f1ca4ec65b4ac43ae27687534fd7d8196a4dbe83a0ecf2c42a4254c71e609ee484a7614573bc499a2e8
> +%patch add mpfr -p1 file://fix-mac-arm64-mpfr-config.patch
> +%hash sha512 fix-mac-arm64-mpfr-config.patch
> dc5069df870bd02b7e78ed22c6ad9e9a2bb9ca372ce1a6b7e8fa5b7635dcef35c29f251fe5195c9c2a43513116c12cab1b0e96171cf34bd7fb7d0334c2c740fb
> +%patch add mpc -p1 file://fix-mac-arm64-mpc-config.patch
> +%hash sha512 fix-mac-arm64-mpc-config.patch
> 2849b11e360ea98e0b4d708c67723ad2d6c7bac6d1e469673f408b0111cf0278429e8bc38fd2b7538dc2d5bb0cc430c646a0fa7f0b6b105a0482a5455fadc8b9
> +
>  %define newlib_version 64b2081
>  %define newlib_external 1
>  %define newlib_expand_name
> sourceware-mirror-newlib-cygwin-%{newlib_version}
> diff --git a/rtems/patches/fix-mac-arm64-isl-config.patch
> b/rtems/patches/fix-mac-arm64-isl-config.patch
> new file mode 100644
> index 000..6b8f07d
> --- /dev/null
> +++ b/rtems/patches/fix-mac-arm64-isl-config.patch
> @@ -0,0 +1,12 @@
> +--- isl/config.sub.orig2022-05-11 07:19:04.0 +0200
>  isl/config.sub 2022-05-11 07:19:26.0 +0200
> +@@ -516,6 +516,9 @@
> +   basic_machine=m68k-apollo
> +   os=-bsd
> +   ;;
> ++  arm64-*)
> ++  basic_machine=aarch64-`echo "$basic_machine" | sed
> 's/^[^-]*-//'`
> ++  ;;
> +   aros)
> +   basic_machine=i386-pc
> +   os=-aros
> diff --git a/rtems/patches/fix-mac-arm64-mpc-config.patch
> b/rtems/patches/fix-mac-arm64-mpc-config.patch
> new file mode 100644
> index 000..89ea483
> --- /dev/null
> +++ b/rtems/patches/fix-mac-arm64-mpc-config.patch
> @@ -0,0 +1,13 @@
> +--- mpc/build-aux/config.sub.orig  2022-05-11 09:20:51.0 +0200
>  mpc/build-aux/config.sub   2022-05-11 09:23:47.0 +0200
> +@@ -916,6 +916,10 @@
> +   cpu=sparc
> +   vendor=`echo "$basic_machine" | sed 's/-.*//'`
> +   ;;
> ++  arm64-*)
> ++  cpu=aarch64
> ++  vendor=`echo "$basic_machine" | sed 's/-.*//'`
> ++  ;;
> +
> +   *-*)
> +   # shellcheck disable=SC2162
> diff --git a/rtems/patches/fix-mac-arm64-mpfr-config.patch
> b/rtems/patches/fix-mac-arm64-mpfr-config.patch
> new file mode 100644
> index 000..37cec7e
> --- /dev/null
> +++ b/rtems/patches/fix-mac-arm64-mpfr-config.patch
> @@ -0,0 +1,12 @@
> +--- mpfr/config.sub.orig   2022-05-11 07:13:02.0 +0200
>  mpfr/config.sub2022-05-11 07:14:42.0 +0200
> +@@ -516,6 +516,9 @@
> +   basic_machine=m68k-apollo
> +   os=-bsd
> +   ;;
> ++  arm64-*)
> ++  basic_machine=aarch64-`echo "$basic_machine" | sed
> 's/^[^-]*-//'`
> ++  ;;
> +   aros)
> +   basic_machine=i386-pc
> +   os=-aros
> --
> 2.25.1
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] ISL, MPC, MPFR: fix configuration issues on ARM64/Darwin host

2022-05-13 Thread Karel Gardas


Joel,

I agree that having support upstreamed would be the best option. Due to 
upstream lag behind apple hardware development I'm afraid we would miss 
RTEMS 6 release if we would wait on upstream here, hence apple M1 users 
would not be able to use RTEMS 6.


Hence offered short cut solution, just for RTEMS 6, is to add those 3 
patches and remove them once upstream apply fixes.


I'm just following historic way of doing things in RSB. It still holds 
three patches at least here:


rtems@silence:~/git/rtems/rtems-source-builder-ref$ find . -name '*.diff'
./source-builder/patches/texane-stlink-3494c11-1.diff
./source-builder/patches/texane-stlink-3494c11-2.diff
./source-builder/patches/gcc-4.7.2-arm-eabi-multilib-20121014.diff

The patches accompany patch submitted yesterday for elftoolchain fix 
(sync of libelf config header file with recent FreeBSD version) and make 
RSB working on M1. Tested here, although hardware is here last day then 
it'll be moved out of my reach. Also tested on x64 darwin and ubuntu 20.04.


Thanks,
Karel

On 5/13/22 15:57, Joel Sherrill wrote:
We do not put patches in RTEMS repos. File an rtems ticket, attach them, 
and reference them from there.


If they are needed upstream, please submit them to the appropriate projects.

Otherwise, I can't test this so don't have much to say. Looks necessary 
based on email discussions.


--joel

On Fri, May 13, 2022 at 8:48 AM Karel Gardas  
wrote:


Sponsored-By:   Precidata
---
  rtems/config/tools/rtems-gcc-12-newlib-head.cfg |  7 +++
  rtems/patches/fix-mac-arm64-isl-config.patch    | 12 
  rtems/patches/fix-mac-arm64-mpc-config.patch    | 13 +
  rtems/patches/fix-mac-arm64-mpfr-config.patch   | 12 
  4 files changed, 44 insertions(+)
  create mode 100644 rtems/patches/fix-mac-arm64-isl-config.patch
  create mode 100644 rtems/patches/fix-mac-arm64-mpc-config.patch
  create mode 100644 rtems/patches/fix-mac-arm64-mpfr-config.patch

diff --git a/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
b/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
index 4ea99a0..95b38c6 100644
--- a/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
+++ b/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
@@ -13,6 +13,13 @@
  %patch add newlib -p1

https://devel.rtems.org/raw-attachment/ticket/4510/0001-aarch64-Add-ILP32-ABI-support-in-assembly-v2.patch


  %hash sha512
0001-aarch64-Add-ILP32-ABI-support-in-assembly-v2.patch

7ca237eabfd5b382713186e1fc290dfc999a353315795ecb8dd0d22fcd1ab7f5bf31f4329954adab91ad04c100dcac0e86d406fdbce8f82cf9dc23842c88caf6

+%patch add isl -p1 file://fix-mac-arm64-isl-config.patch
+%hash sha512 fix-mac-arm64-isl-config.patch

c07fdb605a6520d194358504731e63b540211ef680383f1ca4ec65b4ac43ae27687534fd7d8196a4dbe83a0ecf2c42a4254c71e609ee484a7614573bc499a2e8
+%patch add mpfr -p1 file://fix-mac-arm64-mpfr-config.patch
+%hash sha512 fix-mac-arm64-mpfr-config.patch

dc5069df870bd02b7e78ed22c6ad9e9a2bb9ca372ce1a6b7e8fa5b7635dcef35c29f251fe5195c9c2a43513116c12cab1b0e96171cf34bd7fb7d0334c2c740fb
+%patch add mpc -p1 file://fix-mac-arm64-mpc-config.patch
+%hash sha512 fix-mac-arm64-mpc-config.patch

2849b11e360ea98e0b4d708c67723ad2d6c7bac6d1e469673f408b0111cf0278429e8bc38fd2b7538dc2d5bb0cc430c646a0fa7f0b6b105a0482a5455fadc8b9
+
  %define newlib_version 64b2081
  %define newlib_external 1
  %define newlib_expand_name
sourceware-mirror-newlib-cygwin-%{newlib_version}
diff --git a/rtems/patches/fix-mac-arm64-isl-config.patch
b/rtems/patches/fix-mac-arm64-isl-config.patch
new file mode 100644
index 000..6b8f07d
--- /dev/null
+++ b/rtems/patches/fix-mac-arm64-isl-config.patch
@@ -0,0 +1,12 @@
+--- isl/config.sub.orig        2022-05-11 07:19:04.0 +0200
 isl/config.sub     2022-05-11 07:19:26.0 +0200
+@@ -516,6 +516,9 @@
+               basic_machine=m68k-apollo
+               os=-bsd
+               ;;
++      arm64-*)
++              basic_machine=aarch64-`echo "$basic_machine" | sed
's/^[^-]*-//'`
++              ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
diff --git a/rtems/patches/fix-mac-arm64-mpc-config.patch
b/rtems/patches/fix-mac-arm64-mpc-config.patch
new file mode 100644
index 000..89ea483
--- /dev/null
+++ b/rtems/patches/fix-mac-arm64-mpc-config.patch
@@ -0,0 +1,13 @@
+--- mpc/build-aux/config.sub.orig      2022-05-11
09:20:51.0 +0200
 mpc/build-aux/config.sub   2022-05-11 09:23:47.0 +0200
+@@ -916,6 +916,10 @@
+               cpu=sparc
+               vendor=`echo "$basic_machine" | sed 's/-.*//'`
+               ;;
++      arm64-*)
 

Re: [PATCH] ISL, MPC, MPFR: fix configuration issues on ARM64/Darwin host

2022-05-13 Thread Joel Sherrill
On Fri, May 13, 2022, 9:08 AM Karel Gardas  wrote:

>
> Joel,
>
> I agree that having support upstreamed would be the best option. Due to
> upstream lag behind apple hardware development I'm afraid we would miss
> RTEMS 6 release if we would wait on upstream here, hence apple M1 users
> would not be able to use RTEMS 6.
>

Submitting them and then referencing the upstream email, git commit, or
attachment to their ticket.  We don't wait for upstream releases.


> Hence offered short cut solution, just for RTEMS 6, is to add those 3
> patches and remove them once upstream apply fixes.
>
> I'm just following historic way of doing things in RSB. It still holds
> three patches at least here


>
> rtems@silence:~/git/rtems/rtems-source-builder-ref$ find . -name '*.diff'
> ./source-builder/patches/texane-stlink-3494c11-1.diff
> ./source-builder/patches/texane-stlink-3494c11-2.diff
> ./source-builder/patches/gcc-4.7.2-arm-eabi-multilib-20121014.diff
>

Notice 2012 in the name of the last one.

File a ticket on devel.rtems.org and attach the patches. Use the url to
there.


> The patches accompany patch submitted yesterday for elftoolchain fix
> (sync of libelf config header file with recent FreeBSD version) and make
> RSB working on M1. Tested here, although hardware is here last day then
> it'll be moved out of my reach. Also tested on x64 darwin and ubuntu 20.04.
>

I'm not questioning the quality of the work. Just the process. We lost
patches when we dumped them in our repos.


> Thanks,
> Karel
>
> On 5/13/22 15:57, Joel Sherrill wrote:
> > We do not put patches in RTEMS repos. File an rtems ticket, attach them,
> > and reference them from there.
> >
> > If they are needed upstream, please submit them to the appropriate
> projects.
> >
> > Otherwise, I can't test this so don't have much to say. Looks necessary
> > based on email discussions.
> >
> > --joel
> >
> > On Fri, May 13, 2022 at 8:48 AM Karel Gardas 
> > wrote:
> >
> > Sponsored-By:   Precidata
> > ---
> >   rtems/config/tools/rtems-gcc-12-newlib-head.cfg |  7 +++
> >   rtems/patches/fix-mac-arm64-isl-config.patch| 12 
> >   rtems/patches/fix-mac-arm64-mpc-config.patch| 13 +
> >   rtems/patches/fix-mac-arm64-mpfr-config.patch   | 12 
> >   4 files changed, 44 insertions(+)
> >   create mode 100644 rtems/patches/fix-mac-arm64-isl-config.patch
> >   create mode 100644 rtems/patches/fix-mac-arm64-mpc-config.patch
> >   create mode 100644 rtems/patches/fix-mac-arm64-mpfr-config.patch
> >
> > diff --git a/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
> > b/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
> > index 4ea99a0..95b38c6 100644
> > --- a/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
> > +++ b/rtems/config/tools/rtems-gcc-12-newlib-head.cfg
> > @@ -13,6 +13,13 @@
> >   %patch add newlib -p1
> >
> https://devel.rtems.org/raw-attachment/ticket/4510/0001-aarch64-Add-ILP32-ABI-support-in-assembly-v2.patch
> > <
> https://devel.rtems.org/raw-attachment/ticket/4510/0001-aarch64-Add-ILP32-ABI-support-in-assembly-v2.patch
> >
> >   %hash sha512
> > 0001-aarch64-Add-ILP32-ABI-support-in-assembly-v2.patch
> >
>  
> 7ca237eabfd5b382713186e1fc290dfc999a353315795ecb8dd0d22fcd1ab7f5bf31f4329954adab91ad04c100dcac0e86d406fdbce8f82cf9dc23842c88caf6
> >
> > +%patch add isl -p1 file://fix-mac-arm64-isl-config.patch
> > +%hash sha512 fix-mac-arm64-isl-config.patch
> >
>  
> c07fdb605a6520d194358504731e63b540211ef680383f1ca4ec65b4ac43ae27687534fd7d8196a4dbe83a0ecf2c42a4254c71e609ee484a7614573bc499a2e8
> > +%patch add mpfr -p1 file://fix-mac-arm64-mpfr-config.patch
> > +%hash sha512 fix-mac-arm64-mpfr-config.patch
> >
>  
> dc5069df870bd02b7e78ed22c6ad9e9a2bb9ca372ce1a6b7e8fa5b7635dcef35c29f251fe5195c9c2a43513116c12cab1b0e96171cf34bd7fb7d0334c2c740fb
> > +%patch add mpc -p1 file://fix-mac-arm64-mpc-config.patch
> > +%hash sha512 fix-mac-arm64-mpc-config.patch
> >
>  
> 2849b11e360ea98e0b4d708c67723ad2d6c7bac6d1e469673f408b0111cf0278429e8bc38fd2b7538dc2d5bb0cc430c646a0fa7f0b6b105a0482a5455fadc8b9
> > +
> >   %define newlib_version 64b2081
> >   %define newlib_external 1
> >   %define newlib_expand_name
> > sourceware-mirror-newlib-cygwin-%{newlib_version}
> > diff --git a/rtems/patches/fix-mac-arm64-isl-config.patch
> > b/rtems/patches/fix-mac-arm64-isl-config.patch
> > new file mode 100644
> > index 000..6b8f07d
> > --- /dev/null
> > +++ b/rtems/patches/fix-mac-arm64-isl-config.patch
> > @@ -0,0 +1,12 @@
> > +--- isl/config.sub.orig2022-05-11 07:19:04.0 +0200
> >  isl/config.sub 2022-05-11 07:19:26.0 +0200
> > +@@ -516,6 +516,9 @@
> > +   basic_machine=m68k-apollo
> > +   os=-bsd
> > +   ;;
> > ++  arm64-*)
> > ++  basic_machine=aarch64-`echo "$basic_m

Re: [PATCH] ISL, MPC, MPFR: fix configuration issues on ARM64/Darwin host

2022-05-13 Thread Cedric Berger

On 13.05.22 16:25, Joel Sherrill wrote:

On Fri, May 13, 2022, 9:08 AM Karel Gardas  wrote:


Joel,

I agree that having support upstreamed would be the best option. Due to
upstream lag behind apple hardware development I'm afraid we would miss
RTEMS 6 release if we would wait on upstream here, hence apple M1 users
would not be able to use RTEMS 6.


Submitting them and then referencing the upstream email, git commit, or
attachment to their ticket.  We don't wait for upstream releases.


The fixes here are just patches for the autoconf "config.sub" files of 
these 3 projects.


The problem with these projets (isl/mpc/mfpr) is that they have not had 
any releases for 2+ years, before the M1.


#find build . -name config.sub | xargs grep '^timestamp='

[...]mpfr-4.1.0/config.sub:timestamp='2018-02-22'
[...]isl-0.24/config.sub:timestamp='2018-02-22'
[...]mpc-1.2.1/build-aux/config.sub:timestamp='2020-01-01'

The other projects in the tree using autoconf that have been released in 
2021+ compile fine on the M1.


The 3 projects in questions have nothing special to do to get M1 support 
except release a new version with up-to-date autoconf stuff.


Cedric


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] ISL, MPC, MPFR: fix configuration issues on ARM64/Darwin host

2022-05-13 Thread Joel Sherrill
On Fri, May 13, 2022, 9:39 AM Cedric Berger  wrote:

> On 13.05.22 16:25, Joel Sherrill wrote:
> > On Fri, May 13, 2022, 9:08 AM Karel Gardas 
> wrote:
> >
> >> Joel,
> >>
> >> I agree that having support upstreamed would be the best option. Due to
> >> upstream lag behind apple hardware development I'm afraid we would miss
> >> RTEMS 6 release if we would wait on upstream here, hence apple M1 users
> >> would not be able to use RTEMS 6.
> >>
> > Submitting them and then referencing the upstream email, git commit, or
> > attachment to their ticket.  We don't wait for upstream releases.
>
> The fixes here are just patches for the autoconf "config.sub" files of
> these 3 projects.
>
> The problem with these projets (isl/mpc/mfpr) is that they have not had
> any releases for 2+ years, before the M1.
>
> #find build . -name config.sub | xargs grep '^timestamp='
>
> [...]mpfr-4.1.0/config.sub:timestamp='2018-02-22'
> [...]isl-0.24/config.sub:timestamp='2018-02-22'
> [...]mpc-1.2.1/build-aux/config.sub:timestamp='2020-01-01'
>
> The other projects in the tree using autoconf that have been released in
> 2021+ compile fine on the M1.
>
> The 3 projects in questions have nothing special to do to get M1 support
> except release a new version with up-to-date autoconf stuff.
>

I think you are missing my point. I'm not opposed to the patches and
understand the need.

The RTEMS Project tried putting patches in our git repos when the RSB was
new.  It did not improve our diligence in getting them upstream or removing
them from our git when no longer needed. Putting them in tickets at
RTEMS.org or upstream improved how diligent we were about at least putting
the patch into the right hands.

The patches in RTEMS tools and the RSB probably are OBE and should be
removed. The fact they're still present shows how this can turn into a
patch graveyard.

--joel



> Cedric
>
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] ISL, MPC, MPFR: fix configuration issues on ARM64/Darwin host

2022-05-13 Thread Cedric Berger

On 13.05.22 17:25, Joel Sherrill wrote:
I think you are missing my point. I'm not opposed to the patches and 
understand the need.


The RTEMS Project tried putting patches in our git repos when the RSB 
was new.  It did not improve our diligence in getting them upstream or 
removing them from our git when no longer needed. Putting them in 
tickets at RTEMS.org or upstream improved how diligent we were about 
at least putting the patch into the right hands.


Ok, I guess understand the need for a ticket on RTEMS.org.

What I'm not sure is what to do upstream: just open a ticket on 
mpfr/isl/mpc that says "Please unslack and release a new version of your 
code, it doesn't work on the M1"?


Cedric


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] ISL, MPC, MPFR: fix configuration issues on ARM64/Darwin host

2022-05-13 Thread Joel Sherrill
On Fri, May 13, 2022 at 10:42 AM Cedric Berger  wrote:

> On 13.05.22 17:25, Joel Sherrill wrote:
> > I think you are missing my point. I'm not opposed to the patches and
> > understand the need.
> >
> > The RTEMS Project tried putting patches in our git repos when the RSB
> > was new.  It did not improve our diligence in getting them upstream or
> > removing them from our git when no longer needed. Putting them in
> > tickets at RTEMS.org or upstream improved how diligent we were about
> > at least putting the patch into the right hands.
>
> Ok, I guess understand the need for a ticket on RTEMS.org.
>
> What I'm not sure is what to do upstream: just open a ticket on
> mpfr/isl/mpc that says "Please unslack and release a new version of your
> code, it doesn't work on the M1"?
>

lol. Probably just to politely remind them that their releases need a poke.

If it's not fixed in their development source, then that's a big reason to
poke and provide the patch.

But the ticket on our side can give a log of the effort to get it dealt
with
upstream.

This also shows that we need to clean some patches out of the RSB
and RTEMS tools.

Sorry for the lesson in how we have evolved our handling of
patches for upstream projects. It has evolved from back when
the project provided RPMs and they almost never got upstream
to having the RSB and putting them in our repos to now trying to
do the right thing in the beginning and posting them to the project
via their list, a ticket, or via actual merge. If you notice, we have a
pretty tight loop for getting patches into newlib and gcc. binutils
rarely has issues. gdb is slower but we do ok. We've just learned that
if you push on them while working on them, they tend to get merged
so a patch against tool version N is usually obsolete for N+1. The
alternative is updating the patches every release until we do the
right thing.

--joel

>
> Cedric
>
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] ISL, MPC, MPFR: fix configuration issues on ARM64/Darwin host

2022-05-13 Thread Cedric Berger

On 13.05.22 17:55, Joel Sherrill wrote:
On Fri, May 13, 2022 at 10:42 AM Cedric Berger  
wrote:


On 13.05.22 17:25, Joel Sherrill wrote:
> I think you are missing my point. I'm not opposed to the patches
and
> understand the need.
>
> The RTEMS Project tried putting patches in our git repos when
the RSB
> was new.  It did not improve our diligence in getting them
upstream or
> removing them from our git when no longer needed. Putting them in
> tickets at RTEMS.org or upstream improved how diligent we were
about
> at least putting the patch into the right hands.

Ok, I guess understand the need for a ticket on RTEMS.org.

What I'm not sure is what to do upstream: just open a ticket on
mpfr/isl/mpc that says "Please unslack and release a new version
of your
code, it doesn't work on the M1"?


lol. Probably just to politely remind them that their releases need a 
poke.


If it's not fixed in their development source, then that's a big reason to
poke and provide the patch.


It's fixed, basically, for all 3 projects, if they would care to 
regenerate+release:


https://git.savannah.gnu.org/cgit/config.git/commit/?id=3c20dd431e06337a8b49d8bf791a6a19523a34a4

https://git.savannah.gnu.org/cgit/config.git/commit/?id=2593751ef276497e312d7c4ce7fd049614c7bf80

But the ticket on our side can give a log of the effort to get it 
dealt with

upstream.


That makes sense.


This also shows that we need to clean some patches out of the RSB
and RTEMS tools.

Sorry for the lesson in how we have evolved our handling of
patches for upstream projects. It has evolved from back when
the project provided RPMs and they almost never got upstream
to having the RSB and putting them in our repos to now trying to
do the right thing in the beginning and posting them to the project
via their list, a ticket, or via actual merge. If you notice, we have a
pretty tight loop for getting patches into newlib and gcc. binutils
rarely has issues. gdb is slower but we do ok. We've just learned that
if you push on them while working on them, they tend to get merged
so a patch against tool version N is usually obsolete for N+1. The
alternative is updating the patches every release until we do the
right thing.


No probem, I understand and it makes sense to put upstream, but again, 
in that particular case, the real problem (autoconf) is already fixed 
upstream.


Cedric



___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] ISL, MPC, MPFR: fix configuration issues on ARM64/Darwin host

2022-05-13 Thread Sebastian Huber

On 13/05/2022 18:06, Cedric Berger wrote:
No probem, I understand and it makes sense to put upstream, but again, 
in that particular case, the real problem (autoconf) is already fixed 
upstream.


The release managers of ISL, MPC, and MPFR need to know that they have 
to make the next release with an up to date autoconf.


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH rtems-source-builder v1 0/1] Python 2.7 utf8 handling

2022-05-13 Thread Kinsey Moore
I just discovered this when trying to update my CI that was running
Python 2.7. I have since bumped that to Python 3 to avoid the issue, but
the following patch resolves it.


___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH rtems-source-builder v1] source-builder: Handle utf8 in path

2022-05-13 Thread Kinsey Moore
It's possible for an environment to have unicode characters in its
paths. This was recently exposed by the latest newlib update and RSB
fails under Python 2.7 in this situation. This resolves the issue by
ensuring that the paths are encoded and decoded as necessary.

Related issue that caused the change in newlib:
https://github.com/golang/go/issues/27836
---
 source-builder/sb/path.py | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/source-builder/sb/path.py b/source-builder/sb/path.py
index b27cf14..d36e12a 100644
--- a/source-builder/sb/path.py
+++ b/source-builder/sb/path.py
@@ -58,7 +58,7 @@ def host(path):
 
 def shell(path):
 if isinstance(path, bytes):
-path = path.decode('ascii')
+path = path.decode('utf8')
 if path is not None:
 if windows or windows_posix:
 path = path.encode('ascii', 'ignore').decode('ascii')
@@ -189,11 +189,11 @@ def removeall(path):
 # get to the max path length on Windows.
 #
 def _isdir(path):
-hpath = host(path)
+hpath = host(path).encode('utf8')
 return os.path.isdir(hpath) and not os.path.islink(hpath)
 
 def _remove_node(path):
-hpath = host(path)
+hpath = host(path).encode('utf8')
 if not os.path.islink(hpath) and not os.access(hpath, os.W_OK):
 os.chmod(hpath, stat.S_IWUSR)
 if _isdir(path):
@@ -216,7 +216,7 @@ def removeall(path):
 _remove_node(dir)
 
 path = shell(path)
-hpath = host(path)
+hpath = host(path).encode('utf8')
 
 if os.path.exists(hpath):
 _remove(path)
@@ -317,11 +317,11 @@ def get_size(path, depth = -1):
 # get to the max path length on Windows.
 #
 def _isdir(path):
-hpath = host(path)
+hpath = host(path).encode('utf8')
 return os.path.isdir(hpath) and not os.path.islink(hpath)
 
 def _node_size(path):
-hpath = host(path)
+hpath = host(path).encode('utf8')
 size = 0
 if not os.path.islink(hpath):
 size = os.path.getsize(hpath)
@@ -345,7 +345,7 @@ def get_size(path, depth = -1):
 return size
 
 path = shell(path)
-hpath = host(path)
+hpath = host(path).encode('utf8')
 size = 0
 
 if os.path.exists(hpath):
-- 
2.30.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


RSB -- github has removed git protocol support

2022-05-13 Thread Joel Sherrill
Hi

github has disabled the git protocol and wants people to use the https or
ssh protocol. There are a handful of github git:// URLs in the RSB master
and possibly more in the 5 branch. I have no idea right now what the rule
is to convert the URLs from git to https ones.

This is a warning to the community and a plea for help in converting the
URLs.

Thanks.

--joel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel