[PATCH 0/1] Implement clockrdlock / clockwrlock and test

2021-10-08 Thread Matt Joyce
Hello,

Please find the attached implementions of pthread_rwlock_clockrdlock
and pthread_rwlock_clockwrlock, two newly added POSIX Issue 8
Standard methods. Also included is the psxrwlock02 test, which is
based on the previously existing test for the rwlock_timed*lock
methods.

Thank you!

Matt Joyce (1):
  Added implementations of the pthread_rwlock_clockrdlock and the
  pthread_rwlock_clockwrlock methods to cpukit/posix/src. Both of
  these methods have been newly added to the POSIX Issue 8 Standard.

 cpukit/posix/src/prwlockclockrdlock.c |  70 ++
 cpukit/posix/src/prwlockclockwrlock.c |  71 ++
 spec/build/testsuites/psxtests/grp.yml|   2 +
 .../build/testsuites/psxtests/psxrwlock02.yml |  22 +
 testsuites/psxtests/Makefile.am   |   9 +
 testsuites/psxtests/configure.ac  |   1 +
 testsuites/psxtests/psxrwlock02/main.c|  55 ++
 testsuites/psxtests/psxrwlock02/test.c| 784 ++
 8 files changed, 1014 insertions(+)
 create mode 100644 cpukit/posix/src/prwlockclockrdlock.c
 create mode 100644 cpukit/posix/src/prwlockclockwrlock.c
 create mode 100644 spec/build/testsuites/psxtests/psxrwlock02.yml
 create mode 100644 testsuites/psxtests/psxrwlock02/main.c
 create mode 100644 testsuites/psxtests/psxrwlock02/test.c

-- 
2.31.1

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


[PATCH 1/1] Implement clockrdlock / clockwrlock and test

2021-10-08 Thread Matt Joyce
Added implementations of the pthread_rwlock_clockrdlock and
the pthread_rwlock_clockwrlock methods to cpukit/posix/src. Both of these
methods have been newly added to the POSIX Issue 8 Standard.

psxrwlock02 test added to testsuites/psxtests to test the newly added
methods.
---
 cpukit/posix/src/prwlockclockrdlock.c |  70 ++
 cpukit/posix/src/prwlockclockwrlock.c |  71 ++
 spec/build/testsuites/psxtests/grp.yml|   2 +
 .../build/testsuites/psxtests/psxrwlock02.yml |  22 +
 testsuites/psxtests/Makefile.am   |   9 +
 testsuites/psxtests/configure.ac  |   1 +
 testsuites/psxtests/psxrwlock02/main.c|  55 ++
 testsuites/psxtests/psxrwlock02/test.c| 750 ++
 8 files changed, 980 insertions(+)
 create mode 100644 cpukit/posix/src/prwlockclockrdlock.c
 create mode 100644 cpukit/posix/src/prwlockclockwrlock.c
 create mode 100644 spec/build/testsuites/psxtests/psxrwlock02.yml
 create mode 100644 testsuites/psxtests/psxrwlock02/main.c
 create mode 100644 testsuites/psxtests/psxrwlock02/test.c

diff --git a/cpukit/posix/src/prwlockclockrdlock.c 
b/cpukit/posix/src/prwlockclockrdlock.c
new file mode 100644
index 00..d7187ebfb7
--- /dev/null
+++ b/cpukit/posix/src/prwlockclockrdlock.c
@@ -0,0 +1,70 @@
+/**
+ * @file
+ *
+ * @ingroup POSIXAPI
+ *
+ * @brief Attempt to Obtain a Read Lock on a RWLock Instance
+ */
+
+/*
+ *  POSIX RWLock Manager -- Attempt to Obtain a Read Lock on a RWLock Instance.
+ *  The timeout is specified by abstime on the clock specified by clock_id.
+ *  
+ *  COPYRIGHT (c) 2021 Matthew Joyce
+ *  COPYRIGHT (c) 1989-2008.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+/* Defining to have access to function prototype in libc/include/pthread.h */
+#define _GNU_SOURCE
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include 
+#include 
+
+/* The POSIX Issue 8 Standard adds pthread_rwlock_clockrdlock */
+int pthread_rwlock_clockrdlock(
+  pthread_rwlock_t  *rwlock,
+  clockid_t clock_id,
+  const struct timespec *abstime
+)
+{
+  POSIX_RWLock_Control  *the_rwlock;
+  Thread_queue_Context  queue_context;
+  Status_Controlstatus;
+
+  the_rwlock = _POSIX_RWLock_Get( rwlock );
+  POSIX_RWLOCK_VALIDATE_OBJECT( the_rwlock );
+
+  _Thread_queue_Context_initialize( &queue_context );
+
+  if ( clock_id == CLOCK_REALTIME ) {
+_Thread_queue_Context_set_enqueue_timeout_realtime_timespec(
+  &queue_context,
+  abstime,
+  true
+);
+  }
+  
+  if ( clock_id == CLOCK_MONOTONIC ) {
+_Thread_queue_Context_set_enqueue_timeout_monotonic_timespec(
+  &queue_context,
+  abstime,
+  true
+);
+  }
+
+  status = _CORE_RWLock_Seize_for_reading(
+&the_rwlock->RWLock,
+true,
+&queue_context
+  );
+  return _POSIX_Get_error( status );
+}
diff --git a/cpukit/posix/src/prwlockclockwrlock.c 
b/cpukit/posix/src/prwlockclockwrlock.c
new file mode 100644
index 00..c0ed7fe01c
--- /dev/null
+++ b/cpukit/posix/src/prwlockclockwrlock.c
@@ -0,0 +1,71 @@
+/**
+ * @file
+ *
+ * @ingroup POSIXAPI
+ *
+ * @brief Attempt to Obtain a Write lock on a RWLock instance 
+ */
+
+/*
+ *  POSIX RWLock Manager -- Attempt to Obtain a Write Lock on a RWLock Instance
+ *  The timeout is specified by abstime on the clock specified by clock_id.
+ *  
+ *  COPYRIGHT (c) 2021 Matthew Joyce
+ *  COPYRIGHT (c) 1989-2008.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+/* Defining to have access to function prototype in libc/include/pthread.h */
+#define _GNU_SOURCE
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include 
+#include 
+
+
+/* The POSIX Issue 8 Standard adds pthread_rwlock_clockwrlock */
+int pthread_rwlock_clockwrlock(
+  pthread_rwlock_t  *rwlock,
+  clockid_t clock_id,
+  const struct timespec *abstime
+)
+{
+  POSIX_RWLock_Control  *the_rwlock;
+  Thread_queue_Context  queue_context;
+  Status_Controlstatus;
+
+  the_rwlock = _POSIX_RWLock_Get( rwlock );
+  POSIX_RWLOCK_VALIDATE_OBJECT( the_rwlock );
+
+  _Thread_queue_Context_initialize( &queue_context );
+
+  if ( clock_id == CLOCK_REALTIME ) {
+_Thread_queue_Context_set_enqueue_timeout_realtime_timespec(
+  &queue_context,
+  abstime,
+  true
+);
+  }
+  
+  if ( clock_id == CLOCK_MONOTONIC ) {
+_Thread_queue_Context_set_enqueue_timeout_monotonic_timespec(
+  &queue_context,
+  abstime,
+  true
+);
+  }
+  
+  status = _CORE_RWLock_Seize_for_writing(
+&the_rwlock->RWLock,
+true,
+&queue_context
+  );
+  return _POSIX_Get_error( status );
+}
diff --git a/spec/build/testsuites/psx

Re: [PATCH 1/1] Implement clockrdlock / clockwrlock and test

2021-10-08 Thread Joel Sherrill
On Fri, Oct 8, 2021 at 8:23 AM Matt Joyce  wrote:
>
> Added implementations of the pthread_rwlock_clockrdlock and
> the pthread_rwlock_clockwrlock methods to cpukit/posix/src. Both of these
> methods have been newly added to the POSIX Issue 8 Standard.
>
> psxrwlock02 test added to testsuites/psxtests to test the newly added
> methods.
> ---
>  cpukit/posix/src/prwlockclockrdlock.c |  70 ++
>  cpukit/posix/src/prwlockclockwrlock.c |  71 ++
>  spec/build/testsuites/psxtests/grp.yml|   2 +
>  .../build/testsuites/psxtests/psxrwlock02.yml |  22 +
>  testsuites/psxtests/Makefile.am   |   9 +
>  testsuites/psxtests/configure.ac  |   1 +
>  testsuites/psxtests/psxrwlock02/main.c|  55 ++
>  testsuites/psxtests/psxrwlock02/test.c| 750 ++
>  8 files changed, 980 insertions(+)
>  create mode 100644 cpukit/posix/src/prwlockclockrdlock.c
>  create mode 100644 cpukit/posix/src/prwlockclockwrlock.c
>  create mode 100644 spec/build/testsuites/psxtests/psxrwlock02.yml
>  create mode 100644 testsuites/psxtests/psxrwlock02/main.c
>  create mode 100644 testsuites/psxtests/psxrwlock02/test.c
>
> diff --git a/cpukit/posix/src/prwlockclockrdlock.c 
> b/cpukit/posix/src/prwlockclockrdlock.c
> new file mode 100644
> index 00..d7187ebfb7
> --- /dev/null
> +++ b/cpukit/posix/src/prwlockclockrdlock.c
> @@ -0,0 +1,70 @@
> +/**
> + * @file
> + *
> + * @ingroup POSIXAPI
> + *
> + * @brief Attempt to Obtain a Read Lock on a RWLock Instance
> + */
> +
> +/*
> + *  POSIX RWLock Manager -- Attempt to Obtain a Read Lock on a RWLock 
> Instance.
> + *  The timeout is specified by abstime on the clock specified by clock_id.
> + *
> + *  COPYRIGHT (c) 2021 Matthew Joyce
> + *  COPYRIGHT (c) 1989-2008.
> + *  On-Line Applications Research Corporation (OAR).
> + *
> + *  The license and distribution terms for this file may be
> + *  found in the file LICENSE in this distribution or at
> + *  http://www.rtems.org/license/LICENSE.
> + */

Since this is new, feel free to convert the license to BSD-2-Clause and add
SPDX annotation. Plenty of examples for this.

> +
> +/* Defining to have access to function prototype in libc/include/pthread.h */
> +#define _GNU_SOURCE
> +
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +
> +#include 
> +#include 
> +
> +/* The POSIX Issue 8 Standard adds pthread_rwlock_clockrdlock */
> +int pthread_rwlock_clockrdlock(
> +  pthread_rwlock_t  *rwlock,
> +  clockid_t clock_id,
> +  const struct timespec *abstime

These don't look lined up.


> +)
> +{
> +  POSIX_RWLock_Control  *the_rwlock;
> +  Thread_queue_Context  queue_context;
> +  Status_Controlstatus;

Lined up again?

> +
> +  the_rwlock = _POSIX_RWLock_Get( rwlock );
> +  POSIX_RWLOCK_VALIDATE_OBJECT( the_rwlock );
> +
> +  _Thread_queue_Context_initialize( &queue_context );
> +
> +  if ( clock_id == CLOCK_REALTIME ) {
> +_Thread_queue_Context_set_enqueue_timeout_realtime_timespec(
> +  &queue_context,
> +  abstime,
> +  true
> +);
> +  }

Should there be an else here?

What if it is another CLOCK_ABC value? Shouldn't that be an error?

> +  if ( clock_id == CLOCK_MONOTONIC ) {
> +_Thread_queue_Context_set_enqueue_timeout_monotonic_timespec(
> +  &queue_context,
> +  abstime,
> +  true
> +);
> +  }
> +
> +  status = _CORE_RWLock_Seize_for_reading(
> +&the_rwlock->RWLock,
> +true,
> +&queue_context
> +  );
> +  return _POSIX_Get_error( status );
> +}
> diff --git a/cpukit/posix/src/prwlockclockwrlock.c 
> b/cpukit/posix/src/prwlockclockwrlock.c
> new file mode 100644
> index 00..c0ed7fe01c
> --- /dev/null
> +++ b/cpukit/posix/src/prwlockclockwrlock.c
> @@ -0,0 +1,71 @@
> +/**
> + * @file
> + *
> + * @ingroup POSIXAPI
> + *
> + * @brief Attempt to Obtain a Write lock on a RWLock instance
> + */
> +
> +/*
> + *  POSIX RWLock Manager -- Attempt to Obtain a Write Lock on a RWLock 
> Instance
> + *  The timeout is specified by abstime on the clock specified by clock_id.
> + *
> + *  COPYRIGHT (c) 2021 Matthew Joyce
> + *  COPYRIGHT (c) 1989-2008.
> + *  On-Line Applications Research Corporation (OAR).
> + *
> + *  The license and distribution terms for this file may be
> + *  found in the file LICENSE in this distribution or at
> + *  http://www.rtems.org/license/LICENSE.
> + */

BSD-2 again

> +
> +/* Defining to have access to function prototype in libc/include/pthread.h */
> +#define _GNU_SOURCE
> +
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +
> +#include 
> +#include 
> +
> +
> +/* The POSIX Issue 8 Standard adds pthread_rwlock_clockwrlock */
> +int pthread_rwlock_clockwrlock(
> +  pthread_rwlock_t  *rwlock,
> +  clockid_t clock_id,
> +  const struct timespec *abstime

Alignment

> +)
> +{
> +  POSIX_RWLock_Control  *the_rwlock;
> +  Thread_queue_Context  queue_context;
> +  Status_Controlstatus;

Alignment

> +
> +  the_rwlock = _POSIX_RWLock_

[PATCH] rtems-kernel: Implement kernel recipe using waf

2021-10-08 Thread Ryan Long
Closes #4145
---
 rtems/config/tools/rtems-kernel-6.cfg  |  8 ++-
 rtems/config/tools/rtems-kernel-common.cfg | 95 +-
 2 files changed, 47 insertions(+), 56 deletions(-)

diff --git a/rtems/config/tools/rtems-kernel-6.cfg 
b/rtems/config/tools/rtems-kernel-6.cfg
index f1d0990..edc0eb1 100644
--- a/rtems/config/tools/rtems-kernel-6.cfg
+++ b/rtems/config/tools/rtems-kernel-6.cfg
@@ -2,10 +2,12 @@
 # RTEMS 5
 #
 
-%define rtems_kernel_version 3ec5f20484cc4201e1d7b87844505644533b6148
-%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.bz2 \
-  
BjMKrf5n1YR6IpiZrY5TUEzKATPRJxA2/6m6f833DdRu+RyLxccXqA4gHRdVUqFelFNQ3o0XdG4o1naBKYfhkQ==
+%define rtems_kernel_version 3bb97a30b17b6c138dead3e3a6b329c3b301cdb3
 
+%source set rtems_kernel 
--rsb-file=rtems-kernel-%{rtems_kernel_version}.tar.gz 
https://codeload.github.com/RTEMS/rtems/tar.gz/%{rtems_kernel_version}
+
+%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.gz \
+  
m/ogwrJj4X60ewDIbV6WRj1MJa/22gQHQd56XiNMfvCr0nsvcXdkXKAObLIGYIGYfUyEwlVk3SRjjRFkFalDGQ==
 #
 # The RTEMS build instructions.
 #
diff --git a/rtems/config/tools/rtems-kernel-common.cfg 
b/rtems/config/tools/rtems-kernel-common.cfg
index 157c7a4..38af264 100644
--- a/rtems/config/tools/rtems-kernel-common.cfg
+++ b/rtems/config/tools/rtems-kernel-common.cfg
@@ -38,6 +38,11 @@
 %define rtems_bsp %{with_rtems_bsp}
 
 #
+# Configuration file used with waf
+#
+%define config_file config-%{_target}-%{rtems_bsp}.ini
+
+#
 # If no tools are provided use the prefix.
 #
 %ifn %{defined with_tools}
@@ -98,14 +103,6 @@ URL: https://www.rtems.org/
  %define rtems_posix 0
 %endif
 
-%if %{defined with_rtems_legacy_network}
- %define rtems_networking 1
-%endif
-
-%if %{defined with_rtems_cxx}
- %define rtems_cxx 1
-%endif
-
 %if %{defined with_rtems_bspopts}
  %define bspopts %{with_rtems_bspopts}
 %endif
@@ -129,8 +126,10 @@ URL:https://www.rtems.org/
  %error No RTEMS kernel version defined
 %endif
 
+#%if ! %{defined rtems_kernel}
 %source set rtems_kernel --rsb-file=%{rtems_kernel_file} \
   
https://git.rtems.org/rtems/snapshot/rtems-%{rtems_kernel_version}.tar.bz2
+#%endif
 
 #
 # Check the various --with/--without options we support. These are
@@ -151,51 +150,38 @@ URL:   https://www.rtems.org/
 %if %{defined without_rtemsbsp}
  %error Option --without-rtemsbsp is not supported.
 %endif
+
 %if %{defined without_rtems_tests}
- %define with_rtems_tests no
+ %define rtems_tests False
+ %define rtems_sample_tests False
 %endif
 %if %{defined with_rtems_tests}
  %if %{with_rtems_tests} == 1
-  %define with_rtems_tests yes
+   %define rtems_tests True
+   %define rtems_sample_tests True
  %endif
- %if %{with_rtems_tests} == yes || \
- %{with_rtems_tests} == no || \
- %{with_rtems_tests} == samples
-  %define rtems_tests %{with_rtems_tests}
+  %if %{with_rtems_tests} == samples
+  %define rtems_tests False
+  %define rtems_sample_tests True
  %endif
 %endif
 %if %{defined with_rtems_smp}
  %define rtems_smp 1
 %endif
-%if %{defined with_rtems_legacy_network}
- %define rtems_networking 1
-%endif
 %if %{defined with_rtems_bspopts}
  %define rtems_bspopts %{with_rtems_bspopts}
 %endif
 
 #
-# If C++ defined for the tool set use it to control RTEMS's setting..
-#
-%if %{defined enable_cxx}
- %define rtems_cxx %{enable_cxx}
-%endif
-
-#
 # Default set up. Override these in a BSP if you want a
 # specific setup.
 #
 %ifn %{defined rtems_posix}
  %define rtems_posix 1
 %endif
-%ifn %{defined rtems_networking}
- %define rtems_networking 0
-%endif
-%ifn %{defined rtems_cxx}
- %define rtems_cxx 1
-%endif
 %ifn %{defined rtems_tests}
- %define rtems_tests samples
+ %define rtems_tests False
+ %define rtems_sample_tests True
 %endif
 %ifn %{defined rtems_bspopts}
  %define rtems_bspopts %{nil}
@@ -213,8 +199,9 @@ URL: https://www.rtems.org/
 %if %{defined _internal_autotools_path}
   export PATH="%{_internal_autotools_path}/bin:${PATH}"
 %endif
-./bootstrap -c
-./rtems-bootstrap
+pwd
+ls
+./waf distclean
   %endif
   cd ..
 
@@ -225,32 +212,34 @@ URL:   https://www.rtems.org/
   else
 build_dir="build"
   fi
+
+  cd ${source_dir_rtems}
+
+  cpu=`echo %{_target} | cut -d- -f1`
+  echo "[${cpu}/%{rtems_bsp}]" > %{config_file}
+  echo "RTEMS_POSIX_API = %{?rtems_posix:True}%{!?rtems_posix:False}" >> 
%{config_file}
+  echo "RTEMS_SMP = %{?rtems_smp:True}%{!?rtems_smp:False}" >> %{config_file}
+  echo "BUILD_TESTS = %{rtems_tests}" >> %{config_file}
+  echo "BUILD_SAMPLES = %{rtems_sample_tests}" >> %{config_file}
+
   mkdir -p ${build_dir}
-  cd ${build_dir}
-
-  ../${source_dir_rtems}/configure \
---build=%{_build} --host=%{_host} \
---target=%{_target} \
---enable-rtemsbsp="%{rtems_bsp}" \
-%{?rtems_cxx:--enable-cxx}%{!?rtems_cxx:--disable-cxx} \
-%{?rtems_posix:--enable-posix}%{!?rtems_posix:--disable-posix} \
-
%{?rtems_networking:--enable-netwo

[PATCH] rtems-gdb-9.1-1.cfg: Add patch for Cygwin

2021-10-08 Thread Joel Sherrill
The patch is needed to address link failures introduced when
Cygwin apparently changed their base address for executables.
This is not an issue with gdb 10 and this is a minimalistic
approach to addressing this failure on the 5 branch.

Closes #4523.
---
 rtems/config/tools/rtems-gdb-9.1-1.cfg | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/rtems/config/tools/rtems-gdb-9.1-1.cfg 
b/rtems/config/tools/rtems-gdb-9.1-1.cfg
index 1d14a20..73648c5 100644
--- a/rtems/config/tools/rtems-gdb-9.1-1.cfg
+++ b/rtems/config/tools/rtems-gdb-9.1-1.cfg
@@ -12,4 +12,11 @@
 %patch add gdb 
https://devel.rtems.org/raw-attachment/ticket/4366/gdb-9-1-linker-error-fix.diff
 %hash sha512 gdb-9-1-linker-error-fix.diff 
QAtNCgJsDdfKno+IqHwqRGz1SR3YdTm34ERox2fqpgaGHI6H4GqNfmkJcJaIvSgzNxif24vqWO+bF/Djqa6wNg==
 
+%if %{_build_os} == win32
+  %if %{_windows_os} == cygwin
+%patch add gdb 
https://devel.rtems.org/raw-attachment/ticket/4523/gdb-9-1-thread-local.diff
+%hash sha512 gdb-9-1-thread-local.diff 
ln3rFWltmLCzXvRTz4ts/UoeX7MA49oBtkZWWuslpLEIpm7C/lxDG3/xT0GgJ2eQbENknttittCG31UKhUeljg==
+  %endif
+%endif
+
 %include %{_configdir}/gdb-common-1.cfg
-- 
2.33.0

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


[PATCH rtems-tools v1] rtems-tld.cpp: Remove logically dead code

2021-10-08 Thread Ryan Long
CID 1399595: Logically dead code in generate_traces().

Closes #4525
---
 linkers/rtems-tld.cpp | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/linkers/rtems-tld.cpp b/linkers/rtems-tld.cpp
index 7b42e45..bc1ad89 100644
--- a/linkers/rtems-tld.cpp
+++ b/linkers/rtems-tld.cpp
@@ -1266,10 +1266,7 @@ namespace rld
 ds += " + ";
   else
 ds_added = true;
-  if (drs_added)
-drs += " + ";
-  else
-drs_added = true;
+  drs_added = true;
   ds += "sizeof(" + sig.ret + ')';
   drs += "sizeof(" + sig.ret + ')';
 }
-- 
1.8.3.1

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


Re: [PATCH rtems-tools v1] rtems-tld.cpp: Remove logically dead code

2021-10-08 Thread Chris Johns
OK to push.

On 9/10/21 5:45 am, Ryan Long wrote:
> CID 1399595: Logically dead code in generate_traces().
> 
> Closes #4525
> ---
>  linkers/rtems-tld.cpp | 5 +
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/linkers/rtems-tld.cpp b/linkers/rtems-tld.cpp
> index 7b42e45..bc1ad89 100644
> --- a/linkers/rtems-tld.cpp
> +++ b/linkers/rtems-tld.cpp
> @@ -1266,10 +1266,7 @@ namespace rld
>  ds += " + ";
>else
>  ds_added = true;
> -  if (drs_added)
> -drs += " + ";
> -  else
> -drs_added = true;
> +  drs_added = true;
>ds += "sizeof(" + sig.ret + ')';
>drs += "sizeof(" + sig.ret + ')';
>  }
> 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] rtems-kernel: Implement kernel recipe using waf

2021-10-08 Thread Chris Johns
Hi Ryan,

Thank you for taking this on.

I would like see one addition, a user supplied config.ini file that bypasses any
generated config file. The config needs to match the tool chain being built and
waf will need to complain if it does not but that is not a problem for the RSB
to manage.

On 9/10/21 2:03 am, Ryan Long wrote:
> Closes #4145
> ---
>  rtems/config/tools/rtems-kernel-6.cfg  |  8 ++-
>  rtems/config/tools/rtems-kernel-common.cfg | 95 
> +-
>  2 files changed, 47 insertions(+), 56 deletions(-)
> 
> diff --git a/rtems/config/tools/rtems-kernel-6.cfg 
> b/rtems/config/tools/rtems-kernel-6.cfg
> index f1d0990..edc0eb1 100644
> --- a/rtems/config/tools/rtems-kernel-6.cfg
> +++ b/rtems/config/tools/rtems-kernel-6.cfg
> @@ -2,10 +2,12 @@
>  # RTEMS 5
>  #
>  
> -%define rtems_kernel_version 3ec5f20484cc4201e1d7b87844505644533b6148
> -%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.bz2 \
> -  
> BjMKrf5n1YR6IpiZrY5TUEzKATPRJxA2/6m6f833DdRu+RyLxccXqA4gHRdVUqFelFNQ3o0XdG4o1naBKYfhkQ==
> +%define rtems_kernel_version 3bb97a30b17b6c138dead3e3a6b329c3b301cdb3
>  
> +%source set rtems_kernel 
> --rsb-file=rtems-kernel-%{rtems_kernel_version}.tar.gz 
> https://codeload.github.com/RTEMS/rtems/tar.gz/%{rtems_kernel_version}

Please use the rtems.org repo.

> +
> +%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.gz \
> +  
> m/ogwrJj4X60ewDIbV6WRj1MJa/22gQHQd56XiNMfvCr0nsvcXdkXKAObLIGYIGYfUyEwlVk3SRjjRFkFalDGQ==
>  #
>  # The RTEMS build instructions.
>  #
> diff --git a/rtems/config/tools/rtems-kernel-common.cfg 
> b/rtems/config/tools/rtems-kernel-common.cfg
> index 157c7a4..38af264 100644
> --- a/rtems/config/tools/rtems-kernel-common.cfg
> +++ b/rtems/config/tools/rtems-kernel-common.cfg
> @@ -38,6 +38,11 @@
>  %define rtems_bsp %{with_rtems_bsp}
>  
>  #
> +# Configuration file used with waf
> +#
> +%define config_file config-%{_target}-%{rtems_bsp}.ini
> +
> +#
>  # If no tools are provided use the prefix.
>  #
>  %ifn %{defined with_tools}
> @@ -98,14 +103,6 @@ URL:   https://www.rtems.org/
>   %define rtems_posix 0
>  %endif
>  
> -%if %{defined with_rtems_legacy_network}
> - %define rtems_networking 1
> -%endif
> -
> -%if %{defined with_rtems_cxx}
> - %define rtems_cxx 1
> -
>  %if %{defined with_rtems_bspopts}
>   %define bspopts %{with_rtems_bspopts}
>  %endif
> @@ -129,8 +126,10 @@ URL:  https://www.rtems.org/
>   %error No RTEMS kernel version defined
>  %endif
>  
> +#%if ! %{defined rtems_kernel}
>  %source set rtems_kernel --rsb-file=%{rtems_kernel_file} \
>
> https://git.rtems.org/rtems/snapshot/rtems-%{rtems_kernel_version}.tar.bz2
> +#%endif
>  
>  #
>  # Check the various --with/--without options we support. These are
> @@ -151,51 +150,38 @@ URL: https://www.rtems.org/
>  %if %{defined without_rtemsbsp}
>   %error Option --without-rtemsbsp is not supported.
>  %endif
> +
>  %if %{defined without_rtems_tests}
> - %define with_rtems_tests no
> + %define rtems_tests False
> + %define rtems_sample_tests False
>  %endif
>  %if %{defined with_rtems_tests}
>   %if %{with_rtems_tests} == 1
> -  %define with_rtems_tests yes
> +   %define rtems_tests True
> +   %define rtems_sample_tests True
>   %endif
> - %if %{with_rtems_tests} == yes || \
> - %{with_rtems_tests} == no || \
> - %{with_rtems_tests} == samples
> -  %define rtems_tests %{with_rtems_tests}
> +  %if %{with_rtems_tests} == samples
> +  %define rtems_tests False
> +  %define rtems_sample_tests True
>   %endif
>  %endif
>  %if %{defined with_rtems_smp}
>   %define rtems_smp 1
>  %endif
> -%if %{defined with_rtems_legacy_network}

Please raise an error. Users will need to change their set up.

> - %define rtems_networking 1
> -%endif
>  %if %{defined with_rtems_bspopts}
>   %define rtems_bspopts %{with_rtems_bspopts}
>  %endif
>  
>  #
> -# If C++ defined for the tool set use it to control RTEMS's setting..
> -#
> -%if %{defined enable_cxx}
> - %define rtems_cxx %{enable_cxx}

I think raise an error.

> -%endif
> -
> -#
>  # Default set up. Override these in a BSP if you want a
>  # specific setup.
>  #
>  %ifn %{defined rtems_posix}
>   %define rtems_posix 1
>  %endif
> -%ifn %{defined rtems_networking}
> - %define rtems_networking 0
> -%endif
> -%ifn %{defined rtems_cxx}
> - %define rtems_cxx 1


> -%endif
>  %ifn %{defined rtems_tests}
> - %define rtems_tests samples
> + %define rtems_tests False
> + %define rtems_sample_tests True
>  %endif
>  %ifn %{defined rtems_bspopts}
>   %define rtems_bspopts %{nil}
> @@ -213,8 +199,9 @@ URL:   https://www.rtems.org/
>  %if %{defined _internal_autotools_path}
>export PATH="%{_internal_autotools_path}/bin:${PATH}"
>  %endif
> -./bootstrap -c
> -./rtems-bootstrap
> +pwd
> +ls

?

> +./waf distclean

I am not sure this works by itself when you use --out with configure?

This could be ...

  ./waf distclean configure 

>%endif
>cd ..
>  
>

Re: [PATCH] rtems-kernel: Implement kernel recipe using waf

2021-10-08 Thread Joel Sherrill
On Fri, Oct 8, 2021, 6:44 PM Chris Johns  wrote:

> Hi Ryan,
>
> Thank you for taking this on.
>
> I would like see one addition, a user supplied config.ini file that
> bypasses any
> generated config file. The config needs to match the tool chain being
> built and
> waf will need to complain if it does not but that is not a problem for the
> RSB
> to manage.
>
> On 9/10/21 2:03 am, Ryan Long wrote:
> > Closes #4145
> > ---
> >  rtems/config/tools/rtems-kernel-6.cfg  |  8 ++-
> >  rtems/config/tools/rtems-kernel-common.cfg | 95
> +-
> >  2 files changed, 47 insertions(+), 56 deletions(-)
> >
> > diff --git a/rtems/config/tools/rtems-kernel-6.cfg
> b/rtems/config/tools/rtems-kernel-6.cfg
> > index f1d0990..edc0eb1 100644
> > --- a/rtems/config/tools/rtems-kernel-6.cfg
> > +++ b/rtems/config/tools/rtems-kernel-6.cfg
> > @@ -2,10 +2,12 @@
> >  # RTEMS 5
> >  #
> >
> > -%define rtems_kernel_version 3ec5f20484cc4201e1d7b87844505644533b6148
> > -%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.bz2 \
> > -
> BjMKrf5n1YR6IpiZrY5TUEzKATPRJxA2/6m6f833DdRu+RyLxccXqA4gHRdVUqFelFNQ3o0XdG4o1naBKYfhkQ==
> > +%define rtems_kernel_version 3bb97a30b17b6c138dead3e3a6b329c3b301cdb3
> >
> > +%source set rtems_kernel
> --rsb-file=rtems-kernel-%{rtems_kernel_version}.tar.gz
> https://codeload.github.com/RTEMS/rtems/tar.gz/%{rtems_kernel_version}


I thought this was commented out at least. It wasn't working for us.  Is
that at least the right syntax for GitHub?

>
>
> Please use the rtems.org repo.
>
> > +
> > +%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.gz \
> > +
> m/ogwrJj4X60ewDIbV6WRj1MJa/22gQHQd56XiNMfvCr0nsvcXdkXKAObLIGYIGYfUyEwlVk3SRjjRFkFalDGQ==
> >  #
> >  # The RTEMS build instructions.
> >  #
> > diff --git a/rtems/config/tools/rtems-kernel-common.cfg
> b/rtems/config/tools/rtems-kernel-common.cfg
> > index 157c7a4..38af264 100644
> > --- a/rtems/config/tools/rtems-kernel-common.cfg
> > +++ b/rtems/config/tools/rtems-kernel-common.cfg
> > @@ -38,6 +38,11 @@
> >  %define rtems_bsp %{with_rtems_bsp}
> >
> >  #
> > +# Configuration file used with waf
> > +#
> > +%define config_file config-%{_target}-%{rtems_bsp}.ini
> > +
> > +#
> >  # If no tools are provided use the prefix.
> >  #
> >  %ifn %{defined with_tools}
> > @@ -98,14 +103,6 @@ URL:   https://www.rtems.org/
> >   %define rtems_posix 0
> >  %endif
> >
> > -%if %{defined with_rtems_legacy_network}
> > - %define rtems_networking 1
> > -%endif
> > -
> > -%if %{defined with_rtems_cxx}
> > - %define rtems_cxx 1
> > -
> >  %if %{defined with_rtems_bspopts}
> >   %define bspopts %{with_rtems_bspopts}
> >  %endif
> > @@ -129,8 +126,10 @@ URL:  https://www.rtems.org/
> >   %error No RTEMS kernel version defined
> >  %endif
> >
> > +#%if ! %{defined rtems_kernel}
> >  %source set rtems_kernel --rsb-file=%{rtems_kernel_file} \
> >
> https://git.rtems.org/rtems/snapshot/rtems-%{rtems_kernel_version}.tar.bz2
> > +#%endif
> >
> >  #
> >  # Check the various --with/--without options we support. These are
> > @@ -151,51 +150,38 @@ URL: https://www.rtems.org/
> >  %if %{defined without_rtemsbsp}
> >   %error Option --without-rtemsbsp is not supported.
> >  %endif
> > +
> >  %if %{defined without_rtems_tests}
> > - %define with_rtems_tests no
> > + %define rtems_tests False
> > + %define rtems_sample_tests False
> >  %endif
> >  %if %{defined with_rtems_tests}
> >   %if %{with_rtems_tests} == 1
> > -  %define with_rtems_tests yes
> > +   %define rtems_tests True
> > +   %define rtems_sample_tests True
> >   %endif
> > - %if %{with_rtems_tests} == yes || \
> > - %{with_rtems_tests} == no || \
> > - %{with_rtems_tests} == samples
> > -  %define rtems_tests %{with_rtems_tests}
> > +  %if %{with_rtems_tests} == samples
> > +  %define rtems_tests False
> > +  %define rtems_sample_tests True
> >   %endif
> >  %endif
> >  %if %{defined with_rtems_smp}
> >   %define rtems_smp 1
> >  %endif
> > -%if %{defined with_rtems_legacy_network}
>
> Please raise an error. Users will need to change their set up.
>

Ok. This is why we knew it was v1. Feedback was expected.

>
> > - %define rtems_networking 1
> > -%endif
> >  %if %{defined with_rtems_bspopts}
> >   %define rtems_bspopts %{with_rtems_bspopts}
> >  %endif
> >
> >  #
> > -# If C++ defined for the tool set use it to control RTEMS's setting..
> > -#
> > -%if %{defined enable_cxx}
> > - %define rtems_cxx %{enable_cxx}
>
> I think raise an error.
>
> > -%endif
> > -
> > -#
> >  # Default set up. Override these in a BSP if you want a
> >  # specific setup.
> >  #
> >  %ifn %{defined rtems_posix}
> >   %define rtems_posix 1
> >  %endif
> > -%ifn %{defined rtems_networking}
> > - %define rtems_networking 0
> > -%endif
> > -%ifn %{defined rtems_cxx}
> > - %define rtems_cxx 1
>
>
> > -%endif
> >  %ifn %{defined rtems_tests}
> > - %define rtems_tests samples
> > + %define rtems_tests False
> > + %define rtems_sample_tests True
> >  %endif
> >  %ifn %{defined rtems_bspopts}

Re: [PATCH] rtems-kernel: Implement kernel recipe using waf

2021-10-08 Thread Chris Johns
On 9/10/21 10:49 am, Joel Sherrill wrote:
> On Fri, Oct 8, 2021, 6:44 PM Chris Johns  > wrote:
> 
> Hi Ryan,
> 
> Thank you for taking this on.
> 
> I would like see one addition, a user supplied config.ini file that 
> bypasses any
> generated config file. The config needs to match the tool chain being 
> built and
> waf will need to complain if it does not but that is not a problem for 
> the RSB
> to manage.
> 
> On 9/10/21 2:03 am, Ryan Long wrote:
> > Closes #4145
> > ---
> >  rtems/config/tools/rtems-kernel-6.cfg      |  8 ++-
> >  rtems/config/tools/rtems-kernel-common.cfg | 95
> +-
> >  2 files changed, 47 insertions(+), 56 deletions(-)
> >
> > diff --git a/rtems/config/tools/rtems-kernel-6.cfg
> b/rtems/config/tools/rtems-kernel-6.cfg
> > index f1d0990..edc0eb1 100644
> > --- a/rtems/config/tools/rtems-kernel-6.cfg
> > +++ b/rtems/config/tools/rtems-kernel-6.cfg
> > @@ -2,10 +2,12 @@
> >  # RTEMS 5
> >  #
> > 
> > -%define rtems_kernel_version 3ec5f20484cc4201e1d7b87844505644533b6148
> > -%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.bz2 \
> > -             
> 
> BjMKrf5n1YR6IpiZrY5TUEzKATPRJxA2/6m6f833DdRu+RyLxccXqA4gHRdVUqFelFNQ3o0XdG4o1naBKYfhkQ==
> > +%define rtems_kernel_version 3bb97a30b17b6c138dead3e3a6b329c3b301cdb3
> > 
> > +%source set rtems_kernel
> --rsb-file=rtems-kernel-%{rtems_kernel_version}.tar.gz
> https://codeload.github.com/RTEMS/rtems/tar.gz/%{rtems_kernel_version}
> 
> 
> 
> 
> I thought this was commented out at least.

It does not look like it is.

> It wasn't working for us.

What was not working?

> Is that at least the right syntax for GitHub? 

Could be, I do not know. There have been a few updates to github links over the
years as their interfaces have changed.

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