Re: [PATCH] build: Use -frandom-seed=0
On 29/2/2024 6:36 pm, Sebastian Huber wrote: > On 29.02.24 00:29, Chris Johns wrote: >> On 28/2/2024 6:24 pm, Sebastian Huber wrote: >>> On 28.02.24 06:34, Chris Johns wrote: The manual says: The string can either be a number (decimal, octal or hex) or an arbitrary string (in which case it’s converted to a number by computing CRC32). The string should be different for every file you compile. I take this to mean the option `-frandom-seed=0` uses `0` as a number however it is the same for every file and the manual clearly says it must be different? >>> Using -frandom-seed=0 seems to be quite common on the internet. The random >>> seed >>> is rarely used in GCC. The only use case in RTEMS I found is related to the >>> gcov >>> code coverage instrumentation. >> There are lots of things that are common on the internet I ignore >> >> Is this a bug in the documentation? > > From my point of view this random seed is a gray area in the compiler. The > cases > in which it is used should not matter for the RTEMS build (except for the code > coverage): > > https://gcc.gnu.org/pipermail/gcc-help/2024-February/143324.html > > I will try to add it only to the coverage flags. I would prefer knowing which path is right. If the documentation for gcc says not to do something then I am not sure it is good for us to add it anywhere. For example it is working now in your testing but a future release of gcc changes and subtle issues appear our testing does not pick up. If the gcc maintainers say it is OK then I am fine but they need to update their documentation. I know nothing about this options so it is difficult for me to say yes to the change when it is in conflict to the published documentation. Others may have a different view. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] build: Use -frandom-seed=0
On 29.02.24 00:29, Chris Johns wrote: On 28/2/2024 6:24 pm, Sebastian Huber wrote: On 28.02.24 06:34, Chris Johns wrote: The manual says: The string can either be a number (decimal, octal or hex) or an arbitrary string (in which case it’s converted to a number by computing CRC32). The string should be different for every file you compile. I take this to mean the option `-frandom-seed=0` uses `0` as a number however it is the same for every file and the manual clearly says it must be different? Using -frandom-seed=0 seems to be quite common on the internet. The random seed is rarely used in GCC. The only use case in RTEMS I found is related to the gcov code coverage instrumentation. There are lots of things that are common on the internet I ignore Is this a bug in the documentation? From my point of view this random seed is a gray area in the compiler. The cases in which it is used should not matter for the RTEMS build (except for the code coverage): https://gcc.gnu.org/pipermail/gcc-help/2024-February/143324.html I will try to add it only to the coverage flags. -- embedded brains GmbH & Co. KG 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
Re: [PATCH] build: Use -frandom-seed=0
On 28/2/2024 6:24 pm, Sebastian Huber wrote: > On 28.02.24 06:34, Chris Johns wrote: >> The manual says: >> >> The string can either be a number (decimal, octal or hex) or >> an arbitrary string (in which case it’s converted to a number by >> computing CRC32). >> >> The string should be different for every file you compile. >> >> I take this to mean the option `-frandom-seed=0` uses `0` as a number >> however it >> is the same for every file and the manual clearly says it must be different? > > Using -frandom-seed=0 seems to be quite common on the internet. The random > seed > is rarely used in GCC. The only use case in RTEMS I found is related to the > gcov > code coverage instrumentation. There are lots of things that are common on the internet I ignore ;) Is this a bug in the documentation? Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: [PATCH] build: Use -frandom-seed=0
On 28.02.24 06:34, Chris Johns wrote: The manual says: The string can either be a number (decimal, octal or hex) or an arbitrary string (in which case it’s converted to a number by computing CRC32). The string should be different for every file you compile. I take this to mean the option `-frandom-seed=0` uses `0` as a number however it is the same for every file and the manual clearly says it must be different? Using -frandom-seed=0 seems to be quite common on the internet. The random seed is rarely used in GCC. The only use case in RTEMS I found is related to the gcov code coverage instrumentation. -- embedded brains GmbH & Co. KG 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
Re: [PATCH] build: Use -frandom-seed=0
Hi, The manual says: The string can either be a number (decimal, octal or hex) or an arbitrary string (in which case it’s converted to a number by computing CRC32). The string should be different for every file you compile. I take this to mean the option `-frandom-seed=0` uses `0` as a number however it is the same for every file and the manual clearly says it must be different? Chris On 28/2/2024 12:23 am, Sebastian Huber wrote: > This makes the build reproducible. > --- > spec/build/bsps/opto0.yml | 1 + > spec/build/bsps/opto1.yml | 1 + > spec/build/bsps/opto2.yml | 1 + > spec/build/bsps/optog.yml | 1 + > spec/build/bsps/optos.yml | 1 + > 5 files changed, 5 insertions(+) > > diff --git a/spec/build/bsps/opto0.yml b/spec/build/bsps/opto0.yml > index de7ad1515e..bb59ce8cfa 100644 > --- a/spec/build/bsps/opto0.yml > +++ b/spec/build/bsps/opto0.yml > @@ -13,6 +13,7 @@ default: >- -g >- -fdata-sections >- -ffunction-sections > + - -frandom-seed=0 > description: | >Default optimization flags for C and C++ compilers. > enabled-by: true > diff --git a/spec/build/bsps/opto1.yml b/spec/build/bsps/opto1.yml > index d3e0b6d361..b3bfea2dec 100644 > --- a/spec/build/bsps/opto1.yml > +++ b/spec/build/bsps/opto1.yml > @@ -13,6 +13,7 @@ default: >- -g >- -fdata-sections >- -ffunction-sections > + - -frandom-seed=0 > description: | >Default optimization flags for C and C++ compilers. > enabled-by: true > diff --git a/spec/build/bsps/opto2.yml b/spec/build/bsps/opto2.yml > index ff4f1d23e0..068f2f075d 100644 > --- a/spec/build/bsps/opto2.yml > +++ b/spec/build/bsps/opto2.yml > @@ -13,6 +13,7 @@ default: >- -g >- -fdata-sections >- -ffunction-sections > + - -frandom-seed=0 > description: | >Default optimization flags for C and C++ compilers. > enabled-by: true > diff --git a/spec/build/bsps/optog.yml b/spec/build/bsps/optog.yml > index de20502c78..7149d91e3b 100644 > --- a/spec/build/bsps/optog.yml > +++ b/spec/build/bsps/optog.yml > @@ -13,6 +13,7 @@ default: >- -g >- -fdata-sections >- -ffunction-sections > + - -frandom-seed=0 > description: | >Default optimization flags for C and C++ compilers. > enabled-by: true > diff --git a/spec/build/bsps/optos.yml b/spec/build/bsps/optos.yml > index a39447ef36..12c96621f9 100644 > --- a/spec/build/bsps/optos.yml > +++ b/spec/build/bsps/optos.yml > @@ -13,6 +13,7 @@ default: >- -g >- -fdata-sections >- -ffunction-sections > + - -frandom-seed=0 > description: | >Default optimization flags for C and C++ compilers. > enabled-by: true ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel