[PATCH] libtest: Add hash to gcov info dump

2023-11-27 Thread Sebastian Huber
This helps to validate that the data was transferred correctly.
---
 cpukit/libtest/testgcovdumpinfo.c | 29 +++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/cpukit/libtest/testgcovdumpinfo.c 
b/cpukit/libtest/testgcovdumpinfo.c
index c1d07275e7..71cf4d6d37 100644
--- a/cpukit/libtest/testgcovdumpinfo.c
+++ b/cpukit/libtest/testgcovdumpinfo.c
@@ -10,7 +10,7 @@
  */
 
 /*
- * Copyright (C) 2021, 2022 embedded brains GmbH & Co. KG
+ * Copyright (C) 2021, 2023 embedded brains GmbH & Co. KG
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -42,12 +42,24 @@
 
 #include 
 #include 
+#include 
 #include 
 
 ISR_LOCK_DEFINE( static, gcov_dump_lock, "gcov dump" );
 
 static bool gcov_dump_done;
 
+static Hash_Context gcov_hash;
+
+static void gcov_put_char( int c, void *arg )
+{
+  uint8_t byte;
+
+  rtems_put_char( c, arg );
+  byte = (uint8_t) c;
+  _Hash_Add_data( &gcov_hash, &byte, sizeof( byte ) );
+}
+
 void rtems_test_gcov_dump_info( void )
 {
   ISR_lock_Context lock_context;
@@ -55,11 +67,24 @@ void rtems_test_gcov_dump_info( void )
   _ISR_lock_ISR_disable_and_acquire( &gcov_dump_lock, &lock_context );
 
   if ( !gcov_dump_done ) {
+Hash_Control result;
+uint8_t  byte;
+
 gcov_dump_done = true;
 
 _IO_Printf( rtems_put_char, NULL, "\n*** BEGIN OF GCOV INFO BASE64 ***\n" 
);
-_Gcov_Dump_info_base64( rtems_put_char, NULL );
+_Hash_Initialize( &gcov_hash );
+_Gcov_Dump_info_base64( gcov_put_char, NULL );
 _IO_Printf( rtems_put_char, NULL, "\n*** END OF GCOV INFO BASE64 ***\n" );
+byte = '\n';
+_Hash_Add_data( &gcov_hash, &byte, sizeof( byte ) );
+_Hash_Finalize( &gcov_hash, &result );
+_IO_Printf(
+  rtems_put_char,
+  NULL,
+  "*** GCOV INFO SHA256 %s ***\n",
+  _Hash_Get_string( &result )
+);
   }
 
   _ISR_lock_Release_and_ISR_enable( &gcov_dump_lock, &lock_context );
-- 
2.35.3

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


Cyclone 10 LP BSP

2023-11-27 Thread Kirspel, Kevin
I'm trying to create a BSP for a NIOS V/m running on a Cyclone 10 LP Eval Kit.  
The NIOS V/m is a rv32ia/ilp32 architecture so I had to patch the RSB to add 
that multilib.  I have a Hello World app compiled but I get exceptions when 
having the tick timer interrupt enabled.  So, I disabled the tick timer 
interrupt and was able to get to the Init() task.  When execution the hello 
world printf, I get another exception related to puts_r in newlib.  The 
exception is occurring when trying to load the address of _tls_stdout.  I 
traced this back to THREAD_LOCAL_STORAGE being enabled in newlib for the RISC 
V.  Does the BSP have to do anything to setup thread local storage or does this 
happen automatically when triggered?  The exception occurs after it returns 
from __sinit which I guess is initializes the thread local storage.

Kevin Kirspel (he/his), R&D Manager Sr II, BS EE
IDEXX | One IDEXX Drive Westbrook, Maine 04092 | m. +1 770-688-1642 | idexx.com


We help pets lead fuller lives + + + + + + +


[Shape  Description automatically generated with medium confidence]

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

Re: [RSB PATCH] 6: Merge the MacOS M silicon patch from gcc-12 to gcc-13

2023-11-27 Thread Chris Johns
On 27/11/2023 6:43 pm, Cedric Berger wrote:
> Hello,
> 
> On 24.11.2023 08:36, Sebastian Huber wrote:
>> Would updating to ISL 0.26 and MPC 1.3.1 fix this issue also?
> 
> I just tried in on my fully up-to-date M1 Pro (macOS Sonoma 14.1.1, Xcode 
> 15.0.1)
> 
> Short answer: everything works well without issues (configure, make, check)
> 
> I just installed the following packages successively:
> 
>  - https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz
>  - https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.gz
>  - https://ftp.gnu.org/gnu/mpc/mpc-1.3.1.tar.gz
>  - https://libisl.sourceforge.io/isl-0.26.tar.gz
> 
> by simply extracting the archive and doing:
> 
>   ./configure
>   make
>   make check
>   sudo make install

Is this a native build? This seems to resolve the OS support part which is good
however is the other issue of bad code execution in GMP fixed? This only showed
up when the cross-compiled libraries are built?

> And everything went fine with just a couple of warnings:
> 
>  - during make check for the first 3 packages:
> 
>   libtool: warning: '-no-install' is ignored for aarch64-apple-darwin23.1.0
>   libtool: warning: assuming '-no-fast-install' instead
> 
>  - at the end of libisl make:
> 
>   ld: warning: -bind_at_load is deprecated on macOS
>   warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: archive 
> library:
> libdep.a the table of contents is empty (no object file members in the library
> define global symbols)
> 
> So it seems that updating to the lastest packages would fix all outstanding M1
> macOS issues witout any extra patches needed.

Thanks for taking the time to do this testing.

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

Re: [RSB PATCH] 6: Merge the MacOS M silicon patch from gcc-12 to gcc-13

2023-11-27 Thread Chris Johns
On 27/11/2023 6:43 pm, Cedric Berger wrote:
> I just installed the following packages successively:
> 
>  - https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz
>  - https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.gz

This URL is not suitable so the GNU mirror is better. A change in version means
mpfr-4.2.1.tar.gz is not accessible and that breaks our long term releases. I
have hit this before and why we switched to downloading from gcc.

>  - https://ftp.gnu.org/gnu/mpc/mpc-1.3.1.tar.gz
>  - https://libisl.sourceforge.io/isl-0.26.tar.gz

This does not build on my M2 with Sonoma and the latest Xcode. Something about a
missing constructor. I tried 0.25 and it failed to detect the OS, which is the
original issue we are wanting to solve. I will test 0.24 and the original patch.
An update patch to 0.25 would be welcome if anyone is interested.

I think we should add source-builder/config/gcc-13.cfg and then use ISL 0.24,
MPFR 4.2.1, MPC 1.3.1 and GMP 6.3.0. I have built an aarch64 compiler without
needing to disable the assembler in GMP. I will try some more architectures.

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