Re: rtems-central: Error trying to add FACE POSIX Timer Behavior

2022-08-16 Thread Frank Kühndel
Hi Joel,

as far as I can remember, the error handling of `spec2modules.py` was
never excellent. Adding `notes: null` to
`spec/acfg/if/posix-timer-face-behavior.yml` fixes your problem:


SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
appl-config-option-type: feature-enable
copyrights:
- Copyright (C) 2022 On-Line Applications Research Corporation (OAR)
description: |
  If this configuration option is defined, then POSIX timers may
  not be created to use the CLOCK_REALTIME. Per POSIX, this is allowed
  behavior but per the FACE Technical Standard, using POSIX timers based
  on CLOCK_REALTIME (e.g., time of day) is unsafe for real-time safety
  systems as setting CLOCK_REALTIME will perturb any active timers.

  If this option is not defined, POSIX timers may be created to use the
  CLOCK_REALTIME in compliance with the POSIX specification.
enabled-by: true
index-entries: []
interface-type: appl-config-option
links:
- role: appl-config-group-member
  uid: group-face
name: CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR
notes: null
type: interface
}}}

Missing non-optional keys, misspelled keys, or keys placed in the wrong
level lead to exceptions in `spec2modules.py` as well as missing values,
or values of wrong type.

In this particular case, I found the problem by comparing
`spec/acfg/if/posix-timer-face-behavior.yml` to files using
`group-filesystem` (e.g. `spec/acfg/if/filesystem-all.yml`).

There is a documentation on specification items:
https://docs.rtems.org/branches/master/eng/req/items.html

The format for your file `spec/acfg/if/posix-timer-face-behavior.yml` is
described in

* section "5.2.2.18. Interface Item Type"
* sub-section "5.2.2.20. Application Configuration Option Item Type"

It states the missing key "notes".

I hope I could help.

Greetings
Frank



On 8/12/22 23:28, Joel Sherrill wrote:
> Hi
> 
> I've just attached the patch as a work in progress since spec2modules.py is
> unhappy with what I've done so far. I'd appreciate some guidance. I checked
> that spec2modules.py ran OK before my changes. I added a group-face and
> hope I did that much right. But something is wrong. Help appreciated.
> 
> $ ./spec2modules.py
> Traceback (most recent call last):
>   File "./spec2modules.py", line 85, in 
> main()
>   File "./spec2modules.py", line 76, in main
> rtemsspec.applconfig.generate(config["appl-config"], item_cache)
>   File "/home/joel/rtems-work/rtems/rtems-central/rtemsspec/applconfig.py",
> line 336, in generate
> _generate(group, options, enabled, sphinx_content)
>   File "/home/joel/rtems-work/rtems/rtems-central/rtemsspec/applconfig.py",
> line 264, in _generate
> content.add_option_notes(content.substitute(item["notes"]))
>   File "/home/joel/rtems-work/rtems/rtems-central/rtemsspec/items.py", line
> 210, in __getitem__
> return self._data[key]
> KeyError: 'notes'
> 
> Thanks.
> 
> --joel

-- 
embedded brains GmbH
Herr Frank KÜHNDEL
Dornierstr. 4
82178 Puchheim
Germany
email: frank.kuehn...@embedded-brains.de
phone:  +49-89-18 94 741 - 23
mobile: +49-176-15 22 06 - 11
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

Re: rtems-central: Error trying to add FACE POSIX Timer Behavior

2022-08-16 Thread Joel Sherrill
On Tue, Aug 16, 2022 at 7:15 AM Frank Kühndel <
frank.kuehn...@embedded-brains.de> wrote:

> Hi Joel,
>
> as far as I can remember, the error handling of `spec2modules.py` was
> never excellent. Adding `notes: null` to
> `spec/acfg/if/posix-timer-face-behavior.yml` fixes your problem:
>

Thanks! That did it.

I accidentally added a k to interface and it also gave a mysterious
exception.

Improving the error handling might be a good GSoC project if we can define
the places a field is required, a field as an enumerated set of values,
group
references are wrong, etc.

It is going to be hard to write these with crystal ball error diagnosis. :(

>
> 
> SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> appl-config-option-type: feature-enable
> copyrights:
> - Copyright (C) 2022 On-Line Applications Research Corporation (OAR)
> description: |
>   If this configuration option is defined, then POSIX timers may
>   not be created to use the CLOCK_REALTIME. Per POSIX, this is allowed
>   behavior but per the FACE Technical Standard, using POSIX timers based
>   on CLOCK_REALTIME (e.g., time of day) is unsafe for real-time safety
>   systems as setting CLOCK_REALTIME will perturb any active timers.
>
>   If this option is not defined, POSIX timers may be created to use the
>   CLOCK_REALTIME in compliance with the POSIX specification.
> enabled-by: true
> index-entries: []
> interface-type: appl-config-option
> links:
> - role: appl-config-group-member
>   uid: group-face
> name: CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR
> notes: null
> type: interface
> }}}
>
> Missing non-optional keys, misspelled keys, or keys placed in the wrong
> level lead to exceptions in `spec2modules.py` as well as missing values,
> or values of wrong type.
>
> In this particular case, I found the problem by comparing
> `spec/acfg/if/posix-timer-face-behavior.yml` to files using
> `group-filesystem` (e.g. `spec/acfg/if/filesystem-all.yml`).
>
> There is a documentation on specification items:
> https://docs.rtems.org/branches/master/eng/req/items.html
>
> The format for your file `spec/acfg/if/posix-timer-face-behavior.yml` is
> described in
>
> * section "5.2.2.18. Interface Item Type"
> * sub-section "5.2.2.20. Application Configuration Option Item Type"
>
> It states the missing key "notes".
>

This was my first time wandering into here. Hopefully it gets easier
over time.

>
> I hope I could help.
>

I appreciate the help.

Thanks.

>
> Greetings
> Frank
>
>
>
> On 8/12/22 23:28, Joel Sherrill wrote:
> > Hi
> >
> > I've just attached the patch as a work in progress since spec2modules.py
> is
> > unhappy with what I've done so far. I'd appreciate some guidance. I
> checked
> > that spec2modules.py ran OK before my changes. I added a group-face and
> > hope I did that much right. But something is wrong. Help appreciated.
> >
> > $ ./spec2modules.py
> > Traceback (most recent call last):
> >   File "./spec2modules.py", line 85, in 
> > main()
> >   File "./spec2modules.py", line 76, in main
> > rtemsspec.applconfig.generate(config["appl-config"], item_cache)
> >   File
> "/home/joel/rtems-work/rtems/rtems-central/rtemsspec/applconfig.py",
> > line 336, in generate
> > _generate(group, options, enabled, sphinx_content)
> >   File
> "/home/joel/rtems-work/rtems/rtems-central/rtemsspec/applconfig.py",
> > line 264, in _generate
> > content.add_option_notes(content.substitute(item["notes"]))
> >   File "/home/joel/rtems-work/rtems/rtems-central/rtemsspec/items.py",
> line
> > 210, in __getitem__
> > return self._data[key]
> > KeyError: 'notes'
> >
> > Thanks.
> >
> > --joel
>
> --
> embedded brains GmbH
> Herr Frank KÜHNDEL
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: frank.kuehn...@embedded-brains.de
> phone:  +49-89-18 94 741 - 23
> mobile: +49-176-15 22 06 - 11
> 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 v1 01/12] threads.h: Add pragma to disable -Wpedantic

2022-08-16 Thread Ryan Long
Updates #4662
---
 cpukit/include/rtems/confdefs/threads.h | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/cpukit/include/rtems/confdefs/threads.h 
b/cpukit/include/rtems/confdefs/threads.h
index 8e4537f90b..4040bcb50a 100644
--- a/cpukit/include/rtems/confdefs/threads.h
+++ b/cpukit/include/rtems/confdefs/threads.h
@@ -147,7 +147,15 @@ const size_t _Thread_Maximum_TLS_size =
   CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE;
 
 struct Thread_Configured_control {
+/*
+ * This was added to address the following warning.
+ * warning: invalid use of structure with flexible array member
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
   Thread_Control Control;
+#pragma GCC diagnostic pop
+
   #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
 void *extensions[ CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1 ];
   #endif
@@ -211,7 +219,14 @@ const size_t _Thread_Control_add_on_count =
 
 #ifdef RTEMS_SMP
   struct Thread_queue_Configured_heads {
+/*
+ * This was put in to address the following warning.
+ * warning: invalid use of structure with flexible array member
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
 Thread_queue_Heads Heads;
+#pragma GCC diagnostic pop
   Thread_queue_Priority_queue Priority[ _CONFIGURE_SCHEDULER_COUNT ];
   };
 
-- 
2.11.0

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


[PATCH v1 01/12] threads.h: Add pragmas to get rid of gcc 12 errors

2022-08-16 Thread Ryan Long
Updates #4662
---
 cpukit/include/rtems/confdefs/threads.h | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/cpukit/include/rtems/confdefs/threads.h 
b/cpukit/include/rtems/confdefs/threads.h
index 8e4537f90b..4040bcb50a 100644
--- a/cpukit/include/rtems/confdefs/threads.h
+++ b/cpukit/include/rtems/confdefs/threads.h
@@ -147,7 +147,15 @@ const size_t _Thread_Maximum_TLS_size =
   CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE;
 
 struct Thread_Configured_control {
+/*
+ * This was added to address the following warning.
+ * warning: invalid use of structure with flexible array member
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
   Thread_Control Control;
+#pragma GCC diagnostic pop
+
   #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
 void *extensions[ CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1 ];
   #endif
@@ -211,7 +219,14 @@ const size_t _Thread_Control_add_on_count =
 
 #ifdef RTEMS_SMP
   struct Thread_queue_Configured_heads {
+/*
+ * This was put in to address the following warning.
+ * warning: invalid use of structure with flexible array member
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
 Thread_queue_Heads Heads;
+#pragma GCC diagnostic pop
   Thread_queue_Priority_queue Priority[ _CONFIGURE_SCHEDULER_COUNT ];
   };
 
-- 
2.11.0

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


[PATCH v1 00/12] gcc 12 warnings patches

2022-08-16 Thread Ryan Long
Hi,

For these patches I fixed some of the warnings and added pragmas to ignore
some of the others. These were the warnings I got when building
AArch64/xilinx_zynqmp_lp64_qemu. If you have any feedback on fixing some of
these warnings instead of just ignoring them, please let me know and I can
get that put in.

Thanks,
Ryan

Ryan Long (12):
  threads.h: Add pragmas to get rid of gcc 12 errors
  linkersets.h: Fix gcc 12 warning
  interr.h: Fix gcc 12 warning
  percpu.h: Add pragma for gcc 12 warning
  schedulerpriority.h: Fix gcc 12 warning
  test.h: Add pragma for gcc 12 warning
  cpu.h: Fix gcc 12 warnings
  dl09/dl-load.c: Fix gcc 12 warning
  malloctest/init.c: Added pragmas to address gcc 12 warnings
  ttest01/test-checks.c: Initialize variables
  psxclock/init.c: Change print format for warning
  psxkey07/init.c: Add pragma for gcc 12 warning

 cpukit/include/rtems/confdefs/threads.h| 15 
 cpukit/include/rtems/linkersets.h  |  2 +-
 cpukit/include/rtems/score/interr.h|  2 +-
 cpukit/include/rtems/score/percpu.h|  8 +
 cpukit/include/rtems/score/schedulerpriority.h |  2 +-
 cpukit/include/rtems/test.h|  7 
 cpukit/score/cpu/aarch64/include/rtems/score/cpu.h | 20 +--
 testsuites/libtests/dl09/dl-load.c |  2 +-
 testsuites/libtests/malloctest/init.c  | 41 --
 testsuites/libtests/ttest01/test-checks.c  | 10 +++---
 testsuites/psxtests/psxclock/init.c|  2 +-
 testsuites/psxtests/psxkey07/init.c| 11 --
 12 files changed, 105 insertions(+), 17 deletions(-)

-- 
2.11.0

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


[PATCH v1 02/12] linkersets.h: Fix gcc 12 warning

2022-08-16 Thread Ryan Long
Changing the offset from 0 to 1 got rid of a warning stating that offset 0 is
out of bounds.

Updates #4662
---
 cpukit/include/rtems/linkersets.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/include/rtems/linkersets.h 
b/cpukit/include/rtems/linkersets.h
index cdfcd54cde..45f9dc1ef7 100644
--- a/cpukit/include/rtems/linkersets.h
+++ b/cpukit/include/rtems/linkersets.h
@@ -92,7 +92,7 @@ extern "C" {
   extern RTEMS_LINKER_SET_ALIGN( type ) type RTEMS_LINKER_SET_END( set )[]
 
 #define RTEMS_LINKER_RWSET( set, type ) \
-  RTEMS_LINKER_SET_ALIGN( type ) type RTEMS_LINKER_SET_BEGIN( set )[ 0 ] \
+  RTEMS_LINKER_SET_ALIGN( type ) type RTEMS_LINKER_SET_BEGIN( set )[ 1 ] \
   RTEMS_SECTION( ".rtemsrwset." #set ".begin" ) RTEMS_USED; \
   RTEMS_LINKER_SET_ALIGN( type ) type RTEMS_LINKER_SET_END( set )[ 0 ] \
   RTEMS_SECTION( ".rtemsrwset." #set ".end" ) RTEMS_USED
-- 
2.11.0

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


[PATCH v1 03/12] interr.h: Fix gcc 12 warning

2022-08-16 Thread Ryan Long
The warning that this fixes states that "ISO C restricts enumerator values to
range of 'int'."

Updates #4662
---
 cpukit/include/rtems/score/interr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/include/rtems/score/interr.h 
b/cpukit/include/rtems/score/interr.h
index d3fb370ec3..61233dce5f 100644
--- a/cpukit/include/rtems/score/interr.h
+++ b/cpukit/include/rtems/score/interr.h
@@ -175,7 +175,7 @@ typedef enum {
* This enum value ensures that the enum type needs at least 32-bits for
* architectures with short enums.
*/
-  RTEMS_FATAL_SOURCE_LAST = 0x
+  RTEMS_FATAL_SOURCE_LAST = INT_MAX
 } Internal_errors_Source;
 
 /**
-- 
2.11.0

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


[PATCH v1 04/12] percpu.h: Add pragma for gcc 12 warning

2022-08-16 Thread Ryan Long
Updates #4662
---
 cpukit/include/rtems/score/percpu.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/cpukit/include/rtems/score/percpu.h 
b/cpukit/include/rtems/score/percpu.h
index 24086cde86..fdd40e0a8b 100644
--- a/cpukit/include/rtems/score/percpu.h
+++ b/cpukit/include/rtems/score/percpu.h
@@ -262,6 +262,13 @@ typedef struct Per_CPU_Job {
 /**
  * @brief Per-CPU statistics.
  */
+
+/*
+ * This was added to address the following warning:
+ * warning: struct has no members
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
 typedef struct {
 #if defined( RTEMS_PROFILING )
   /**
@@ -330,6 +337,7 @@ typedef struct {
   uint64_t total_interrupt_time;
 #endif /* defined( RTEMS_PROFILING ) */
 } Per_CPU_Stats;
+#pragma GCC diagnostic pop
 
 /**
  * @brief Per-CPU watchdog header index.
-- 
2.11.0

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


[PATCH v1 06/12] test.h: Add pragma for gcc 12 warning

2022-08-16 Thread Ryan Long
Updates #4662
---
 cpukit/include/rtems/test.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/cpukit/include/rtems/test.h b/cpukit/include/rtems/test.h
index c283be7860..e0823394d1 100644
--- a/cpukit/include/rtems/test.h
+++ b/cpukit/include/rtems/test.h
@@ -218,12 +218,19 @@ void T_check_null(const T_check_context_msg *, const void 
*);
 
 void T_check_not_null(const T_check_context_msg *, const void *);
 
+/*
+ * This was added to address the following warning.
+ * warning: 'a' may be used uninitialized
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 #define T_flags_not_null(a, flags, sa) \
 {  \
static const T_check_context_msg T_check_instance = {   \
{ T_FILE_NAME, __LINE__, (flags) | T_CHECK_FMT }, sa }; \
T_check_not_null(&T_check_instance, a); \
 }
+#pragma GCC diagnostic pop
 
 void T_check_eq_mem(const T_check_context_msg *, const void *, const void *,
 size_t);
-- 
2.11.0

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


[PATCH v1 04/12] percpu.h: Add pragma to disable -Wpedantic

2022-08-16 Thread Ryan Long
Updates #4662
---
 cpukit/include/rtems/score/percpu.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/cpukit/include/rtems/score/percpu.h 
b/cpukit/include/rtems/score/percpu.h
index 24086cde86..fdd40e0a8b 100644
--- a/cpukit/include/rtems/score/percpu.h
+++ b/cpukit/include/rtems/score/percpu.h
@@ -262,6 +262,13 @@ typedef struct Per_CPU_Job {
 /**
  * @brief Per-CPU statistics.
  */
+
+/*
+ * This was added to address the following warning:
+ * warning: struct has no members
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
 typedef struct {
 #if defined( RTEMS_PROFILING )
   /**
@@ -330,6 +337,7 @@ typedef struct {
   uint64_t total_interrupt_time;
 #endif /* defined( RTEMS_PROFILING ) */
 } Per_CPU_Stats;
+#pragma GCC diagnostic pop
 
 /**
  * @brief Per-CPU watchdog header index.
-- 
2.11.0

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


[PATCH v1 05/12] schedulerpriority.h: Fix gcc 12 warning

2022-08-16 Thread Ryan Long
Changed the size of the array to 1 to get rid of the warning.

Updates #4662
---
 cpukit/include/rtems/score/schedulerpriority.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/include/rtems/score/schedulerpriority.h 
b/cpukit/include/rtems/score/schedulerpriority.h
index cf5d0762a9..e485e97c60 100644
--- a/cpukit/include/rtems/score/schedulerpriority.h
+++ b/cpukit/include/rtems/score/schedulerpriority.h
@@ -94,7 +94,7 @@ typedef struct {
   /**
* @brief One ready queue per priority level.
*/
-  Chain_Control Ready[ 0 ];
+  Chain_Control Ready[ 1 ];
 } Scheduler_priority_Context;
 
 /**
-- 
2.11.0

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


[PATCH v1 07/12] cpu.h: Fix gcc 12 warnings

2022-08-16 Thread Ryan Long
Added two pragmas to address, and changed the value of
AARCH64_EXCEPTION_MAKE_ENUM_64_BIT to INT_MAX because the old value was not
in range of an int.

Updates #4662
---
 cpukit/score/cpu/aarch64/include/rtems/score/cpu.h | 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h 
b/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
index 47a8e97985..282977853f 100644
--- a/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/aarch64/include/rtems/score/cpu.h
@@ -43,6 +43,7 @@
 #endif
 #include 
 #include 
+#include 
 
 /**
  * @addtogroup RTEMSScoreCPUAArch64
@@ -156,7 +157,14 @@
 extern "C" {
 #endif
 
+/*
+   This is to fix the following warning
+   ISO C does not support 'uint128_t' types
+*/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
 typedef unsigned __int128 uint128_t;
+#pragma GCC diagnostic pop
 
 typedef struct {
   uint64_t register_x19;
@@ -404,7 +412,7 @@ typedef enum {
   AARCH64_EXCEPTION_LEL32_FIQ = 14,
   AARCH64_EXCEPTION_LEL32_SERROR = 15,
   MAX_EXCEPTIONS = 16,
-  AARCH64_EXCEPTION_MAKE_ENUM_64_BIT = 0x
+  AARCH64_EXCEPTION_MAKE_ENUM_64_BIT = INT_MAX
 } AArch64_symbolic_exception_name;
 
 #define VECTOR_POINTER_OFFSET 0x78
@@ -432,7 +440,15 @@ static inline void* AArch64_set_exception_handler(
   *vector_address = handler;
 
   /* return now-previous vector pointer */
-  return (void*)current_vector_pointer;
+
+/*
+ * This was put in to fix the following warning:
+ * warning: ISO C forbids conversion of function pointer to object pointer 
type.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
+ return (void*)current_vector_pointer;
+#pragma GCC diagnostic pop
 }
 
 typedef struct {
-- 
2.11.0

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


[PATCH v1 09/12] malloctest/init.c: Added pragmas to address gcc 12 warnings

2022-08-16 Thread Ryan Long
Fixed four warnings disabled were for "-Wuse-after-free" and one for a
"-Wfree-nonheap-object."

Updates #4662
---
 testsuites/libtests/malloctest/init.c | 41 ---
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/testsuites/libtests/malloctest/init.c 
b/testsuites/libtests/malloctest/init.c
index 05d97a27d5..ae3719c2cd 100644
--- a/testsuites/libtests/malloctest/init.c
+++ b/testsuites/libtests/malloctest/init.c
@@ -60,8 +60,15 @@ static void test_realloc(void)
   for (i=2 ; i<2048 ; i++) {
 p2 = realloc(p1, i);
 if (p2 != p1)
+/*
+ * This was added to address the following warning.
+ * warning: pointer 'p1' may be used after 'realloc'
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuse-after-free"
   printf( "realloc - failed grow in place: "
   "%p != realloc(%p,%zu)\n", p1, p2, i);
+#pragma GCC diagnostic pop
 p1 = p2;
   }
   free(p1);
@@ -71,8 +78,15 @@ static void test_realloc(void)
   for (i=2047 ; i>=1; i--)  {
 p2 = realloc(p1, i);
 if (p2 != p1)
-  printf( "realloc - failed shrink in place: "
+/*
+ * This was added to address the following warning.
+ * warning: pointer 'p1' may be used after 'realloc'
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuse-after-free"
+   printf( "realloc - failed shrink in place: "
   "%p != realloc(%p,%zu)\n", p1, p2, i);
+#pragma GCC diagnostic pop
 p1 = p2;
   }
   free(p1);
@@ -84,8 +98,15 @@ static void test_realloc(void)
   p2 = malloc(32);
   p3 = realloc(p1, 64);
   if (p3 == p1 || p3 == NULL)
-printf(
+/*
+ * This was added to address the following warning.
+ * warning: pointer may be used after 'realloc'
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuse-after-free"
+ printf(
   "realloc - failed non-in place: realloc(%p,%d) = %p\n", p1, 64, p3);
+#pragma GCC diagnostic pop
   free(p3);
   free(p2);
 
@@ -122,7 +143,14 @@ static void test_realloc(void)
   /*
*  Realloc with a bad pointer to force a point
*/
-  p4 = realloc( test_realloc, 32 );
+/*
+ * This was added to address the following warning.
+ * warning: 'realloc' called on unallocated object
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
+   p4 = realloc( test_realloc, 32 );
+#pragma GCC diagnostic pop
 
   p4 = _realloc_r( NULL, NULL, 1 );
 }
@@ -1528,8 +1556,15 @@ static void test_early_malloc( void )
 
   free( q );
 
+/*
+ * This was added to address the following warning.
+ * warning: pointer 'q' used after 'free'
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuse-after-free"
   r = realloc( q, 128 );
   rtems_test_assert( r == q );
+#pragma GCC diagnostic pop
 
   s = malloc( 1 );
   rtems_test_assert( s != NULL );
-- 
2.11.0

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


[PATCH v1 08/12] dl09/dl-load.c: Fix gcc 12 warning

2022-08-16 Thread Ryan Long
Changed format of size_t variable being printed.

Updates #4662
---
 testsuites/libtests/dl09/dl-load.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuites/libtests/dl09/dl-load.c 
b/testsuites/libtests/dl09/dl-load.c
index 1de7c8fa29..ce9708c3a3 100644
--- a/testsuites/libtests/dl09/dl-load.c
+++ b/testsuites/libtests/dl09/dl-load.c
@@ -171,7 +171,7 @@ static void dl_object_open (object_def* od, objects* o)
   if (od->space != 0)
   {
 o->space = malloc (od->space);
-printf("space alloc: %s: %d: %p\n", od->name, od->space, o->space);
+printf("space alloc: %s: %zd: %p\n", od->name, od->space, o->space);
 rtems_test_assert (o->space != NULL);
   }
   dl_load_dump ();
-- 
2.11.0

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


[PATCH v1 10/12] ttest01/test-checks.c: Initialize variables

2022-08-16 Thread Ryan Long
These uninitialized variables were causing warnings to be generated.

Updates #4662
---
 testsuites/libtests/ttest01/test-checks.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/testsuites/libtests/ttest01/test-checks.c 
b/testsuites/libtests/ttest01/test-checks.c
index fa5591121e..06e1a959bf 100644
--- a/testsuites/libtests/ttest01/test-checks.c
+++ b/testsuites/libtests/ttest01/test-checks.c
@@ -90,8 +90,8 @@ T_TEST_CASE(step_assert_eq_ptr)
 
 T_TEST_CASE(check_eq_ptr)
 {
-   int a;
-   int b;
+   int a = 0;
+   int b = 0;
 
T_eq_ptr(&a, &a);
T_eq_ptr(&a, &b);
@@ -115,8 +115,8 @@ T_TEST_CASE(step_assert_ne_ptr)
 
 T_TEST_CASE(check_ne_ptr)
 {
-   int a;
-   int b;
+   int a = 0;
+   int b = 0;
 
T_ne_ptr(&a, &b);
T_ne_ptr(&a, &a);
@@ -162,7 +162,7 @@ T_TEST_CASE(step_assert_not_null)
 
 T_TEST_CASE(check_not_null)
 {
-   int a;
+   int a = 0;
 
T_not_null(&a);
T_not_null(NULL);
-- 
2.11.0

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


[PATCH v1 11/12] psxclock/init.c: Change print format for warning

2022-08-16 Thread Ryan Long
Updates #4662
---
 testsuites/psxtests/psxclock/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuites/psxtests/psxclock/init.c 
b/testsuites/psxtests/psxclock/init.c
index 743cfa6d78..eb2f1d130c 100644
--- a/testsuites/psxtests/psxclock/init.c
+++ b/testsuites/psxtests/psxclock/init.c
@@ -115,7 +115,7 @@ static void test_clock_check( clock_context* ctx, const 
rtems_interval ticks_per
 (((ctx->tspec.tv_sec * 10LLU) + ctx->tspec.tv_nsec) / 
tick_period_nsec) + 1;
   rtems_test_assert( ctx->result == 0 );
   printf(
-"clock: %s: sec=%llu nsec=%li ticks=%u expected-ticks=%u\n",
+"clock: %s: sec=%" PRIdtime_t" nsec=%li ticks=%u expected-ticks=%u\n",
 ctx->name, ctx->tspec.tv_sec, ctx->tspec.tv_nsec, ctx->ticks, ticks);
   rtems_test_assert( ctx->ticks == ticks );
 }
-- 
2.11.0

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


[PATCH v1 12/12] psxkey07/init.c: Add pragma for gcc 12 warning

2022-08-16 Thread Ryan Long
Updates #4662
---
 testsuites/psxtests/psxkey07/init.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/testsuites/psxtests/psxkey07/init.c 
b/testsuites/psxtests/psxkey07/init.c
index 593df739db..15387264ba 100644
--- a/testsuites/psxtests/psxkey07/init.c
+++ b/testsuites/psxtests/psxkey07/init.c
@@ -56,8 +56,15 @@ rtems_task Test_Thread(rtems_task_argument argument)
 
   value_p = malloc( sizeof( int ) );
   rtems_test_assert(value_p != NULL);
-  sc = pthread_setspecific( Key, value_p );
-  rtems_test_assert( !sc );
+/*
+ * This was added to address the following warning.
+ * warning: 'value_p' may be used uninitialized
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+ sc = pthread_setspecific( Key, value_p );
+#pragma GCC diagnostic pop
+ rtems_test_assert( !sc );
 
   pthread_mutex_lock( &mutex1 );
   ++setted_thread_count;
-- 
2.11.0

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


Re: [PATCH v1 09/12] malloctest/init.c: Added pragmas to address gcc 12 warnings

2022-08-16 Thread Chris Johns
On 17/8/2022 6:11 am, Ryan Long wrote:
> Fixed four warnings disabled were for "-Wuse-after-free" and one for a
> "-Wfree-nonheap-object."

Is this a gcc warning bug? If p1 was used to access the memory the warning is
right but we are only referencing the address and not the data. It is no
different to:

  void* p = 0x1;
  printf("P is %p\n", p);

This is fine and has to be or we could never access any hardware.

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


[PATCH RSB] Fixes for getting sources

2022-08-16 Thread chrisj
Hi

These patches fix getting sources for all the packages so releases
can be CI tested to catch breakages closer to the time they happen.

The get sources tool now finds the top level buildset files and only
fetches the sources for them. This avoids processing and handling
configurations that are out of date.

The tool also captures the used buildset and config files and if
all top level buildset files are fetched the unused files can be
listed. This can be used to clean up the repo.

I think it is time to remove old configs. There are some using CVS
or depending on host versions of tools no one runs anymore.

Chris

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


[PATCH 1/3] sb/get-sources: Fix getting sources with archs

2022-08-16 Thread chrisj
From: Chris Johns 

- Add a stop on error option

- Add listing root or toplevel buildset files

- Add used and unused file output to track what is not used
  for clean ups

- Update to handle macro expanded includes in buildset files
---
 source-builder/sb/getsources.py |  30 +++-
 source-builder/sb/simhost.py| 128 
 2 files changed, 123 insertions(+), 35 deletions(-)

diff --git a/source-builder/sb/getsources.py b/source-builder/sb/getsources.py
index d348da4..eb5c855 100644
--- a/source-builder/sb/getsources.py
+++ b/source-builder/sb/getsources.py
@@ -60,7 +60,9 @@ def run(args = sys.argv):
default = version.version())
 argsp.add_argument('--list-hosts', help = 'List the hosts.',
action = 'store_true')
-argsp.add_argument('--list-bsets', help = 'List the hosts.',
+argsp.add_argument('--list-bsets', help = 'List the buildsets.',
+   action = 'store_true')
+argsp.add_argument('--list-root-bsets', help = 'List the toplevel or 
root buildsets.',
action = 'store_true')
 argsp.add_argument('--download-dir', help = 'Download directory.',
type = str)
@@ -71,8 +73,14 @@ def run(args = sys.argv):
 argsp.add_argument('--log', help = 'Log file.',
type = str,
default = simhost.log_default('getsource'))
+argsp.add_argument('--stop-on-error', help = 'Stop on error.',
+   action = 'store_true')
 argsp.add_argument('--trace', help = 'Enable trace logging for 
debugging.',
action = 'store_true')
+argsp.add_argument('--used', help = 'Save the used buildset and config 
files.',
+   type = str, default = None)
+argsp.add_argument('--unused', help = 'Save the unused buildset and 
config files.',
+   type = str, default = None)
 argsp.add_argument('bsets', nargs='*', help = 'Build sets.')
 
 argopts = argsp.parse_args(args[1:])
@@ -84,10 +92,14 @@ def run(args = sys.argv):
 opts = simhost.load_options(args, argopts, extras = 
['--with-download'])
 configs = build.get_configs(opts)
 
+stop_on_error = argopts.stop_on_error
+
 if argopts.list_hosts:
 simhost.list_hosts()
 elif argopts.list_bsets:
 simhost.list_bset_files(opts, configs)
+elif argopts.list_root_bsets:
+simhost.list_root_bset_files(opts, configs)
 else:
 if argopts.clean:
 if argopts.download_dir is None:
@@ -95,11 +107,11 @@ def run(args = sys.argv):
 if path.exists(argopts.download_dir):
 log.notice('Cleaning source directory: %s' % 
(argopts.download_dir))
 path.removeall(argopts.download_dir)
-all_bsets = simhost.get_bset_files(configs)
 if len(argopts.bsets) == 0:
-bsets = all_bsets
+bsets = simhost.get_root_bset_files(opts, configs)
 else:
 bsets = argopts.bsets
+deps = copy.copy(simhost.strip_common_prefix(bsets))
 for bset in bsets:
 b = None
 try:
@@ -108,11 +120,23 @@ def run(args = sys.argv):
 b = simhost.buildset(bset, configs, opts)
 get_sources_error = False
 b.build(host)
+deps += b.deps()
 del b
 except error.general as gerr:
+if stop_on_error:
+raise
 log.stderr(str(gerr))
 log.stderr('Build FAILED')
 b = None
+deps = sorted(list(set(deps)))
+if argopts.used:
+with open(argopts.used, 'w') as o:
+o.write(os.linesep.join(deps))
+if argopts.unused:
+cfgs_bsets = \
+[cb for cb in simhost.get_config_bset_files(opts, configs) 
if not cb in deps]
+with open(argopts.unused, 'w') as o:
+o.write(os.linesep.join(cfgs_bsets))
 except error.general as gerr:
 if get_sources_error:
 log.stderr(str(gerr))
diff --git a/source-builder/sb/simhost.py b/source-builder/sb/simhost.py
index 1ff98e8..f58a66d 100644
--- a/source-builder/sb/simhost.py
+++ b/source-builder/sb/simhost.py
@@ -36,6 +36,7 @@ try:
 from . import log
 from . import macros
 from . import path
+from . import shell
 from . import sources
 from . import version
 except KeyboardInterrupt:
@@ -122,7 +123,6 @@ profiles = {
  '_var': ('dir', 'optional', '/usr/local/var') 
},
 }
 
-
 class log_capture(object):
 def __init

[PATCH 2/3] sb/gcc-common: Allow URL overrides for downloaded source

2022-08-16 Thread chrisj
From: Chris Johns 

- This allows the URL for an older package to be defined when
  gcc no longer hosts it
---
 source-builder/config/gcc-common-1.cfg | 33 --
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/source-builder/config/gcc-common-1.cfg 
b/source-builder/config/gcc-common-1.cfg
index 0eb032b..87ccef1 100644
--- a/source-builder/config/gcc-common-1.cfg
+++ b/source-builder/config/gcc-common-1.cfg
@@ -46,18 +46,37 @@ URL:   http://gcc.gnu.org/
  %define rtems_gcc_version %{rtems_version}
 %endif
 
+#
+# Packages GCC URLs, can be defined for older packages
+#
+%if %{!defined cloog_url}
+ %define cloog_url https://gcc.gnu.org/pub/gcc/infrastructure
+%endif
+%if %{!defined isl_url}
+ %define isl_url https://gcc.gnu.org/pub/gcc/infrastructure
+%endif
+%if %{!defined mpc_url}
+ %define mpc_url https://gcc.gnu.org/pub/gcc/infrastructure
+%endif
+%if %{!defined gmp_url}
+ %define gmp_url https://gcc.gnu.org/pub/gcc/infrastructure
+%endif
+%if %{!defined mpfr_url}
+ %define mpfr_url https://gcc.gnu.org/pub/gcc/infrastructure
+%endif
+
 #
 # Packages GCC requires
 #
 %if %{defined cloog_version}
-%source set cloog 
https://gcc.gnu.org/pub/gcc/infrastructure/cloog-%{cloog_version}.tar.gz
+%source set cloog %{_url}/cloog-%{cloog_version}.tar.gz
 %endif
 %if %{defined isl_version}
-%source set isl 
https://gcc.gnu.org/pub/gcc/infrastructure/isl-%{isl_version}.tar.bz2
+%source set isl %{isl_url}/isl-%{isl_version}.tar.bz2
 %endif
-%source set mpc 
https://gcc.gnu.org/pub/gcc/infrastructure/mpc-%{mpc_version}.tar.gz
-%source set gmp 
https://gcc.gnu.org/pub/gcc/infrastructure/gmp-%{gmp_version}.tar.bz2
-%source set mpfr 
https://gcc.gnu.org/pub/gcc/infrastructure/mpfr-%{mpfr_version}.tar.bz2
+%source set mpc %{mpc_url}/mpc-%{mpc_version}.tar.gz
+%source set gmp %{gmp_url}/gmp-%{gmp_version}.tar.bz2
+%source set mpfr %{mpfr_url}/mpfr-%{mpfr_version}.tar.bz2
 
 #
 # Prepare the source code.
@@ -93,7 +112,7 @@ URL:http://gcc.gnu.org/
   %source setup cloog -q -D -n cloog-%{cloog_version}
   %patch setup cloog -p1
   cd ${build_top}
-  # Build MPFR one-tree style
+  # Build CLooG one-tree style
   %{__rmfile} ${source_dir_gcc}/cloog
   %{__ln_s} $PWD/${source_dir_cloog} ${source_dir_gcc}/cloog
 %endif
@@ -104,7 +123,7 @@ URL:   http://gcc.gnu.org/
   %source setup isl -q -D -n isl-%{isl_version}
   %patch setup isl -p1
   cd ${build_top}
-  # Build MPFR one-tree style
+  # Build ISL one-tree style
   %{__rmfile} ${source_dir_gcc}/isl
   %{__ln_s} $PWD/${source_dir_isl} ${source_dir_gcc}/isl
 %endif
-- 
2.24.1

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


[PATCH 3/3] config: Various updates to fix downloading of sources

2022-08-16 Thread chrisj
From: Chris Johns 

---
 bare/config/devel/gcc-4.6-newlib-1.20-1.cfg  |  4 
 bare/config/devel/or1ksim-1.1.0.cfg  |  3 ++-
 bare/config/devel/pcre-8.40-1.cfg|  3 ++-
 bare/config/devel/qemu-xilinx-v2020.2-1.cfg  |  2 +-
 bare/config/gnu-tools-4.6.bset   |  6 ++---
 bare/config/gnu-tools-4.8.2.bset | 25 
 rtems/config/graphics/libjpeg-9a-1.cfg   |  3 ++-
 rtems/config/net-mgmt/net-snmp-5.7.2.1-1.cfg |  8 ---
 rtems/config/rtems-urls.bset |  2 ++
 source-builder/config/freetype-1.cfg |  2 +-
 source-builder/config/gcc-4.9-1.cfg  | 12 ++
 source-builder/config/libtool-2-1.cfg|  8 +++
 source-builder/config/nxlib-1.cfg|  2 +-
 source-builder/config/pcre-8-1.cfg   |  2 +-
 source-builder/config/swig-4-1.cfg   |  5 ++--
 15 files changed, 39 insertions(+), 48 deletions(-)
 delete mode 100644 bare/config/gnu-tools-4.8.2.bset

diff --git a/bare/config/devel/gcc-4.6-newlib-1.20-1.cfg 
b/bare/config/devel/gcc-4.6-newlib-1.20-1.cfg
index 0a7cc63..659752f 100644
--- a/bare/config/devel/gcc-4.6-newlib-1.20-1.cfg
+++ b/bare/config/devel/gcc-4.6-newlib-1.20-1.cfg
@@ -15,6 +15,10 @@
 %define mpc_version0.8.2
 %define gmp_version5.0.5
 
+%define mpc_url  https://www.multiprecision.org/downloads
+%define gmp_url  https://ftp.gnu.org/gnu/gmp
+%define mpfr_url https://ftp.gnu.org/gnu/mpfr
+
 #
 # Project custom message
 #
diff --git a/bare/config/devel/or1ksim-1.1.0.cfg 
b/bare/config/devel/or1ksim-1.1.0.cfg
index 5e6b592..d4ccc88 100644
--- a/bare/config/devel/or1ksim-1.1.0.cfg
+++ b/bare/config/devel/or1ksim-1.1.0.cfg
@@ -9,7 +9,8 @@
 %include %{_configdir}/base.cfg
 
 %define or1ksim_version 1.1.0
-%hash md5 or1k-master.zip 7c9aec3fef6648a380ca5e91b2e3e87f
+%hash sha512 or1k-master.zip \
+
qi2pPthxvefp9OpwsAz3ul9lakJHkpwIgGlj4fcDa+Lshjsush2ekYm1SKsPJ38YaldSuJdH2buhCmPkXTeWHQ==
 
 #
 # The or1ksim build instructions. We use 1.x.x Release 1.
diff --git a/bare/config/devel/pcre-8.40-1.cfg 
b/bare/config/devel/pcre-8.40-1.cfg
index f6031fd..85ec7a1 100644
--- a/bare/config/devel/pcre-8.40-1.cfg
+++ b/bare/config/devel/pcre-8.40-1.cfg
@@ -9,7 +9,8 @@
 %include %{_configdir}/base.cfg
 
 %define pcre_version 8.40
-%hash sha512 pcre-%{pcre_version}.tar.bz2 
tMJ+r73zO9ehOEZVsZNvS+O8Z0XAcjR+sm6YiJbFJmS9haxCRE2hvni24g9Ftsflkh9fIPWwdBtb09mETlvU4g==
+%hash sha512 pcre-%{pcre_version}.tar.bz2 \
+
tMJ+r73zO9ehOEZVsZNvS+O8Z0XAcjR+sm6YiJbFJmS9haxCRE2hvni24g9Ftsflkh9fIPWwdBtb09mETlvU4g==
 
 #
 # The PCRE build instructions. We use 8.x Release 1.
diff --git a/bare/config/devel/qemu-xilinx-v2020.2-1.cfg 
b/bare/config/devel/qemu-xilinx-v2020.2-1.cfg
index 94b14ef..180b621 100644
--- a/bare/config/devel/qemu-xilinx-v2020.2-1.cfg
+++ b/bare/config/devel/qemu-xilinx-v2020.2-1.cfg
@@ -15,7 +15,7 @@
 #
 # Checkout the version tag and initialize all submodules.
 #
-%source set qemu 
git://github.com/Xilinx/qemu.git?checkout=%{qemu_version}?submodule=dtc?submodule=slirp?submodule=ui/keycodemapdb?submodule=tests/fp/berkeley-softfloat-3?submodule=tests/fp/berkeley-testfloat-3
+%source set qemu 
https://github.com/Xilinx/qemu.git?checkout=%{qemu_version}?submodule=dtc?submodule=slirp?submodule=ui/keycodemapdb?submodule=tests/fp/berkeley-softfloat-3?submodule=tests/fp/berkeley-testfloat-3
 
 #
 # The Qemu build instructions. We use 5.x.x Release 1.
diff --git a/bare/config/gnu-tools-4.6.bset b/bare/config/gnu-tools-4.6.bset
index fa3ced8..baccd84 100644
--- a/bare/config/gnu-tools-4.6.bset
+++ b/bare/config/gnu-tools-4.6.bset
@@ -19,7 +19,7 @@ package: gnu-tool-%{_target}-%{_host}-%{release}
 #
 # Tool configuration.
 #
-binutils-2.22-1
-gcc-4.6-newlib-1.20-1
-expat-2.1.0-1
+devel/binutils-2.22-1
+devel/gcc-4.6-newlib-1.20-1
+devel/expat-2.1.0-1
 gdb-7.5-1
diff --git a/bare/config/gnu-tools-4.8.2.bset b/bare/config/gnu-tools-4.8.2.bset
deleted file mode 100644
index 9dd4b8a..000
--- a/bare/config/gnu-tools-4.8.2.bset
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# GNU Tools Set
-#
-
-%define release 1
-
-package: gnu-tools-%{_target}-%{_host}-%{release}
-
-#
-# Project custom message
-#
-%define gcc_version_message 
SB-%{release},gcc-%{gcc_version}/newlib-%{newlib_version}
-
-#
-# Enable G++
-#
-%define enable_cxx 1
-
-#
-# Tool configuration.
-#
-devel/expat-2.1.0-1
-devel/binutils-2.23.2-1
-devel/gcc-4.8.2-newlib-cvs-1
-devel/gdb-7.6.1-1
diff --git a/rtems/config/graphics/libjpeg-9a-1.cfg 
b/rtems/config/graphics/libjpeg-9a-1.cfg
index fef32d6..04d2324 100644
--- a/rtems/config/graphics/libjpeg-9a-1.cfg
+++ b/rtems/config/graphics/libjpeg-9a-1.cfg
@@ -13,7 +13,8 @@
 #
 %define libjpeg_version 9a
 
-%hash sha512 jpegsrc.v%{libjpeg_version}.tar.gz 
9b21cc115e22c68bea46db462263c5c7a0d10beb192a919ecccbd801a25982b518ce44d8c301dd582ecaba1850e0e0f20e322be82b0e24ae917b9949b4f10d3b
+%hash sha512 jpegsrc.v%{libjpeg_version}.tar.gz \
+
z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8X

Re: [PATCH RSB] Fixes for getting sources

2022-08-16 Thread Joel Sherrill
On Tue, Aug 16, 2022, 6:34 PM  wrote:

> Hi
>
> These patches fix getting sources for all the packages so releases
> can be CI tested to catch breakages closer to the time they happen.
>

Thanks. I didn't expect a question to turn into a quest for you.

Is this for 5 and 6?



> The get sources tool now finds the top level buildset files and only
> fetches the sources for them. This avoids processing and handling
> configurations that are out of date.
>

What's an example command for this?


> The tool also captures the used buildset and config files and if
> all top level buildset files are fetched the unused files can be
> listed. This can be used to clean up the repo.
>
> I think it is time to remove old configs. There are some using CVS
> or depending on host versions of tools no one runs anymore.
>

I'm good with these patches and removing unused configurations.

--joel

>
> Chris
>
> ___
> 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 v1 09/12] malloctest/init.c: Added pragmas to address gcc 12 warnings

2022-08-16 Thread Joel Sherrill
On Tue, Aug 16, 2022, 6:07 PM Chris Johns  wrote:

> On 17/8/2022 6:11 am, Ryan Long wrote:
> > Fixed four warnings disabled were for "-Wuse-after-free" and one for a
> > "-Wfree-nonheap-object."
>
> Is this a gcc warning bug? If p1 was used to access the memory the warning
> is
> right but we are only referencing the address and not the data. It is no
> different to:
>
>   void* p = 0x1;
>   printf("P is %p\n", p);
>
> This is fine and has to be or we could never access any hardware.
>

That example is different I think. Semantically after a call to free, the
address is no longer valid for any use. Ensuring you don't call another
member of the malloc family is a legitimate way to avoid double frees.

If we have an issue with a specific use case pattern that GCC is tripping,
then we discuss it with them. I'm sure all of these were well thought out.

Besides this code is pushing deliberate error conditions so we should not
be surprised that the compiler is detecting issues with the code.

--joel

>
> Chris
> ___
> 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 v1 09/12] malloctest/init.c: Added pragmas to address gcc 12 warnings

2022-08-16 Thread Chris Johns
On 17/8/2022 12:16 pm, Joel Sherrill wrote:
> On Tue, Aug 16, 2022, 6:07 PM Chris Johns  > wrote:
> On 17/8/2022 6:11 am, Ryan Long wrote:
> > Fixed four warnings disabled were for "-Wuse-after-free" and one for a
> > "-Wfree-nonheap-object."
> 
> Is this a gcc warning bug? If p1 was used to access the memory the 
> warning is
> right but we are only referencing the address and not the data. It is no
> different to:
> 
>   void* p = 0x1;
>   printf("P is %p\n", p);
> 
> This is fine and has to be or we could never access any hardware.
> 
> 
> That example is different I think. Semantically after a call to free, the
> address is no longer valid for any use.

Ah yes sorry, I was looking at the wrong spot in the code. It is down at line 
1531.

> Ensuring you don't call another member
> of the malloc family is a legitimate way to avoid double frees.

Yes using the pointer is invalid.

> If we have an issue with a specific use case pattern that GCC is tripping, 
> then
> we discuss it with them. I'm sure all of these were well thought out.
> 
> Besides this code is pushing deliberate error conditions so we should not be
> surprised that the compiler is detecting issues with the code.

I am not sure the test is correct and should be there. Passing in and then
testing the same value is returned assumes undefined behaviour:

 If ptr does not match a pointer returned earlier by calloc(), malloc(),
 or realloc() or if the space has previously been deallocated by a call
 to free() or realloc(), the behavior is undefined.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/realloc.html

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

Re: [PATCH RSB] Fixes for getting sources

2022-08-16 Thread Chris Johns
On 17/8/2022 12:13 pm, Joel Sherrill wrote:
> On Tue, Aug 16, 2022, 6:34 PM mailto:chr...@rtems.org>> 
> wrote:
> 
> Hi
> 
> These patches fix getting sources for all the packages so releases
> can be CI tested to catch breakages closer to the time they happen.
> 
> 
> Thanks. I didn't expect a question to turn into a quest for you. 

Haha .. it had to be done or the release scripts do not work unless on an RSB
branch with a cleaned up set of buildset and config files.

> Is this for 5 and 6?

Both. The release scripts are tagged and not branched. A releases when ever it
is made it made for the hosts of that time.

> The get sources tool now finds the top level buildset files and only
> fetches the sources for them. This avoids processing and handling
> configurations that are out of date>
> What's an example command for this?
> 

./source-builder/sb-get-sources --download-dir test-src --log=gw.txt
--stop-on-error --trace --used=used.txt --unused=unused.txt

> The tool also captures the used buildset and config files and if
> all top level buildset files are fetched the unused files can be
> listed. This can be used to clean up the repo.
> 
> I think it is time to remove old configs. There are some using CVS
> or depending on host versions of tools no one runs anymore.
> 
> I'm good with these patches and removing unused configurations.

Yeah it is time to do this.

It would be good for you to manually do a run and check these files to make sure
I have it right before we start the removal process.

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

Re: [PATCH] 6: Enable some libstdc++ features

2022-08-16 Thread Chris Johns
On 12/8/2022 12:48 am, Sebastian Huber wrote:
> Hello Chris,
> 
> On 08.08.22 13:46, Sebastian Huber wrote:
>> Enable TLS support for all RTEMS targets except bfin, lm32, m68k, mips, 
>> moxie,
>> or1k, and v850.  For all RTEMS targets, define HAVE_ALIGNED_ALLOC,
>> HAVE_AT_QUICK_EXIT, HAVE_LINK, HAVE_QUICK_EXIT, HAVE_READLINK, HAVE_SETENV,
>> HAVE_SLEEP, HAVE_STRERROR_L, HAVE_SYMLINK, HAVE_TRUNCATE, and HAVE_USLEEP.
>>
>> Update #4668.
> 
> did you already have time to test the TLS support for libstdc++?
> 

I have tested this patch and found no regressions (so far) and pushed the 
change.

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