Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test binaries are not reproducible #529

Open
matthiasgoergens opened this issue Jan 30, 2024 · 2 comments
Open

Test binaries are not reproducible #529

matthiasgoergens opened this issue Jan 30, 2024 · 2 comments

Comments

@matthiasgoergens
Copy link

matthiasgoergens commented Jan 30, 2024

Unfortunately, GCC injects the randomised file names of intermediate temporary files into the result test binaries. So they change every time you build. Here's an example:

$ diffoscope isa/rv32ua-p-lrsc-old isa/rv32ua-p-lrsc
2024-01-30 08:53:35 E: diffoscope.comparators.elf: Command '['objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text.init {}']' returned non-zero exit status 1.
2024-01-30 08:53:35 E: diffoscope.comparators.elf: Command '['objdump --disassemble --demangle --no-show-raw-insn --section=.text.init {}']' returned non-zero exit status 1.
--- isa/rv32ua-p-lrsc-old
+++ isa/rv32ua-p-lrsc
├── readelf --wide --symbols {}
│ @@ -2,15 +2,15 @@
│  Symbol table '.symtab' contains 28 entries:
│     Num:    Value  Size Type    Bind   Vis      Ndx Name
│       0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
│       1: 80000000     0 SECTION LOCAL  DEFAULT    1 .text.init
│       2: 80001000     0 SECTION LOCAL  DEFAULT    2 .tohost
│       3: 80002000     0 SECTION LOCAL  DEFAULT    3 .data
│       4: 00000000     0 SECTION LOCAL  DEFAULT    4 .riscv.attributes
│ -     5: 00000000     0 FILE    LOCAL  DEFAULT  ABS ccILFvq9.o
│ +     5: 00000000     0 FILE    LOCAL  DEFAULT  ABS ccM5Sbp3.o
│       6: 80000000     0 NOTYPE  LOCAL  DEFAULT    1 $x
│       7: 80000050     0 NOTYPE  LOCAL  DEFAULT    1 reset_vector
│       8: 80000004     0 NOTYPE  LOCAL  DEFAULT    1 trap_vector
│       9: 8000003c     0 NOTYPE  LOCAL  DEFAULT    1 write_tohost
│      10: 80000038     0 NOTYPE  LOCAL  DEFAULT    1 handle_exception
│      11: 80000038     0 NOTYPE  LOCAL  DEFAULT    1 other_exception
│      12: 80002000     0 NOTYPE  LOCAL  DEFAULT    3 coreid
├── strings --all --bytes=8 {}
│ @@ -1,10 +1,10 @@
│  R0sP 0sP00
│  rv32i2p0_m2p0_a2p0_f2p0_d2p0
│ -ccILFvq9.o
│ +ccM5Sbp3.o
│  reset_vector
│  trap_vector
│  write_tohost
│  handle_exception
│  other_exception
│  fooTest3
│  end_signature
├── readelf --wide --decompress --hex-dump=.strtab {}
│ @@ -1,10 +1,10 @@

│  Hex dump of section '.strtab':
│ -  0x00000000 00636349 4c467671 392e6f00 24780072 .ccILFvq9.o.$x.r
│ +  0x00000000 0063634d 35536270 332e6f00 24780072 .ccM5Sbp3.o.$x.r
│    0x00000010 65736574 5f766563 746f7200 74726170 eset_vector.trap
│    0x00000020 5f766563 746f7200 77726974 655f746f _vector.write_to
│    0x00000030 686f7374 0068616e 646c655f 65786365 host.handle_exce
│    0x00000040 7074696f 6e006f74 6865725f 65786365 ption.other_exce
│    0x00000050 7074696f 6e00636f 72656964 00746573 ption.coreid.tes
│    0x00000060 745f3200 666f6f00 6661696c 00746573 t_2.foo.fail.tes
│    0x00000070 745f3300 62617272 69657200 74657374 t_3.barrier.test

I'm sure there's some way to tell GCC not to put that information into the file in the first place, or perhaps to strip it out after the fact?

Reproducible builds are important for us, because we use a change of the upstream test binaries as one of the triggers to re-run the tests for our Risc-V simulator.

The actual GCC command that make executes looks a bit like this (with --verbose added by me):

$ riscv64-unknown-elf-gcc --verbose -march=rv32g -mabi=ilp32 -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles -I./../env/p -I./macros/scalar -T./../env/p/link.ld rv32ua/lrsc.S -o rv32ua-p-lrsc
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /home/runner/work/riscv-gnu-toolchain/riscv-gnu-toolchain/gcc/configure --target=riscv64-unknown-elf --prefix=/opt/riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-pkgversion=g2ee5e430018 --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/riscv/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=/home/runner/work/riscv-gnu-toolchain/riscv-gnu-toolchain/gcc --disable-multilib --with-abi=lp64d --with-arch=rv64gc --with-tune=rocket --with-isa-spec=2.2 'CFLAGS_FOR_TARGET=-Os   -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os   -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.2.0 (g2ee5e430018) 
COLLECT_GCC_OPTIONS='-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc-'
 /usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/cc1 -E -lang-asm -quiet -v -I ./../env/p -I ./macros/scalar -iprefix /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/ -isysroot /usr/bin/../riscv64-unknown-elf rv32ua/lrsc.S -march=rv32g -mabi=ilp32 -mcmodel=medany -mtune=rocket -misa-spec=2.2 -march=rv32imafd -fvisibility=hidden -fno-directives-only -o /tmp/ccUe8hGD.s
ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv64-unknown-elf/12.2.0/include"
ignoring nonexistent directory "/usr/bin/../riscv64-unknown-elf/usr/local/include"
ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv64-unknown-elf/12.2.0/include-fixed"
ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/include"
ignoring duplicate directory "/usr/bin/../riscv64-unknown-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 ./../env/p
 ./macros/scalar
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/include
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/include-fixed
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc-'
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/bin/as -v -I ./../env/p -I ./macros/scalar --traditional-format -march=rv32g -march=rv32imafd -mabi=ilp32 -misa-spec=2.2 -o /tmp/ccUV3yKR.o /tmp/ccUe8hGD.s
GNU assembler version 2.39 (riscv64-unknown-elf) using BFD version (GNU Binutils) 2.39
COMPILER_PATH=/usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/:/usr/bin/../libexec/gcc/:/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/bin/
LIBRARY_PATH=/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/:/usr/bin/../lib/gcc/:/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/lib/:/usr/bin/../riscv64-unknown-elf/lib/
COLLECT_GCC_OPTIONS='-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc.'
 /usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/collect2 -plugin /usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/liblto_plugin.so -plugin-opt=/usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccTL1k8H.res --sysroot=/usr/bin/../riscv64-unknown-elf -melf32lriscv -o rv32ua-p-lrsc -L/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0 -L/usr/bin/../lib/gcc -L/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/lib -L/usr/bin/../riscv64-unknown-elf/lib /tmp/ccUV3yKR.o -T ./../env/p/link.ld
COLLECT_GCC_OPTIONS='-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc.'

Look for /tmp/ in the above to see instances of randomised file names, some of them make it into the final ELF.

@matthiasgoergens
Copy link
Author

Unfortunately, -frandom-seed doesn't seem to be working. See how the file names differ, despite the same seed:

~/m/p/r/isa (master)$ riscv64-unknown-elf-gcc -frandom-seed=1 --verbose -march=rv32g -mabi=ilp32 -static -mcmodel=medany -frandom-seed=1 -fvisibility=hidden -nostdlib -nostartfiles -I./../env/p -I./macros/scalar -T./../env/p/link.ld rv32ua/lrsc.S -o rv32ua-p-lrsc
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /home/runner/work/riscv-gnu-toolchain/riscv-gnu-toolchain/gcc/configure --target=riscv64-unknown-elf --prefix=/opt/riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-pkgversion=g2ee5e430018 --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/riscv/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=/home/runner/work/riscv-gnu-toolchain/riscv-gnu-toolchain/gcc --disable-multilib --with-abi=lp64d --with-arch=rv64gc --with-tune=rocket --with-isa-spec=2.2 'CFLAGS_FOR_TARGET=-Os   -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os   -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.2.0 (g2ee5e430018) 
COLLECT_GCC_OPTIONS='-frandom-seed=1' '-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-frandom-seed=1' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc-'
 /usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/cc1 -E -lang-asm -quiet -v -I ./../env/p -I ./macros/scalar -iprefix /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/ -isysroot /usr/bin/../riscv64-unknown-elf rv32ua/lrsc.S -march=rv32g -mabi=ilp32 -mcmodel=medany -mtune=rocket -misa-spec=2.2 -march=rv32imafd -frandom-seed=1 -frandom-seed=1 -fvisibility=hidden -fno-directives-only -o /tmp/ccmA0ohx.s
ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv64-unknown-elf/12.2.0/include"
ignoring nonexistent directory "/usr/bin/../riscv64-unknown-elf/usr/local/include"
ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv64-unknown-elf/12.2.0/include-fixed"
ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/include"
ignoring duplicate directory "/usr/bin/../riscv64-unknown-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 ./../env/p
 ./macros/scalar
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/include
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/include-fixed
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/include
End of search list.
COLLECT_GCC_OPTIONS='-frandom-seed=1' '-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-frandom-seed=1' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc-'
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/bin/as -v -I ./../env/p -I ./macros/scalar --traditional-format -march=rv32g -march=rv32imafd -mabi=ilp32 -misa-spec=2.2 -o /tmp/ccvkKBl6.o /tmp/ccmA0ohx.s
GNU assembler version 2.39 (riscv64-unknown-elf) using BFD version (GNU Binutils) 2.39
COMPILER_PATH=/usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/:/usr/bin/../libexec/gcc/:/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/bin/
LIBRARY_PATH=/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/:/usr/bin/../lib/gcc/:/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/lib/:/usr/bin/../riscv64-unknown-elf/lib/
COLLECT_GCC_OPTIONS='-frandom-seed=1' '-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-frandom-seed=1' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc.'
 /usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/collect2 -plugin /usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/liblto_plugin.so -plugin-opt=/usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccYQKQcB.res --sysroot=/usr/bin/../riscv64-unknown-elf -melf32lriscv -o rv32ua-p-lrsc -L/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0 -L/usr/bin/../lib/gcc -L/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/lib -L/usr/bin/../riscv64-unknown-elf/lib /tmp/ccvkKBl6.o -T ./../env/p/link.ld
COLLECT_GCC_OPTIONS='-frandom-seed=1' '-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-frandom-seed=1' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc.'
~/m/p/r/isa (master)$ riscv64-unknown-elf-gcc -frandom-seed=1 --verbose -march=rv32g -mabi=ilp32 -static -mcmodel=medany -frandom-seed=1 -fvisibility=hidden -nostdlib -nostartfiles -I./../env/p -I./macros/scalar -T./../env/p/link.ld rv32ua/lrsc.S -o rv32ua-p-lrsc
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /home/runner/work/riscv-gnu-toolchain/riscv-gnu-toolchain/gcc/configure --target=riscv64-unknown-elf --prefix=/opt/riscv --disable-shared --disable-threads --enable-languages=c,c++ --with-pkgversion=g2ee5e430018 --with-system-zlib --enable-tls --with-newlib --with-sysroot=/opt/riscv/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=/home/runner/work/riscv-gnu-toolchain/riscv-gnu-toolchain/gcc --disable-multilib --with-abi=lp64d --with-arch=rv64gc --with-tune=rocket --with-isa-spec=2.2 'CFLAGS_FOR_TARGET=-Os   -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os   -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.2.0 (g2ee5e430018) 
COLLECT_GCC_OPTIONS='-frandom-seed=1' '-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-frandom-seed=1' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc-'
 /usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/cc1 -E -lang-asm -quiet -v -I ./../env/p -I ./macros/scalar -iprefix /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/ -isysroot /usr/bin/../riscv64-unknown-elf rv32ua/lrsc.S -march=rv32g -mabi=ilp32 -mcmodel=medany -mtune=rocket -misa-spec=2.2 -march=rv32imafd -frandom-seed=1 -frandom-seed=1 -fvisibility=hidden -fno-directives-only -o /tmp/ccQwJFHl.s
ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv64-unknown-elf/12.2.0/include"
ignoring nonexistent directory "/usr/bin/../riscv64-unknown-elf/usr/local/include"
ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv64-unknown-elf/12.2.0/include-fixed"
ignoring duplicate directory "/usr/bin/../lib/gcc/../../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/include"
ignoring duplicate directory "/usr/bin/../riscv64-unknown-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 ./../env/p
 ./macros/scalar
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/include
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/include-fixed
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/include
End of search list.
COLLECT_GCC_OPTIONS='-frandom-seed=1' '-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-frandom-seed=1' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc-'
 /usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/bin/as -v -I ./../env/p -I ./macros/scalar --traditional-format -march=rv32g -march=rv32imafd -mabi=ilp32 -misa-spec=2.2 -o /tmp/ccEgFq5M.o /tmp/ccQwJFHl.s
GNU assembler version 2.39 (riscv64-unknown-elf) using BFD version (GNU Binutils) 2.39
COMPILER_PATH=/usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/:/usr/bin/../libexec/gcc/:/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/bin/
LIBRARY_PATH=/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/:/usr/bin/../lib/gcc/:/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/lib/:/usr/bin/../riscv64-unknown-elf/lib/
COLLECT_GCC_OPTIONS='-frandom-seed=1' '-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-frandom-seed=1' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc.'
 /usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/collect2 -plugin /usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/liblto_plugin.so -plugin-opt=/usr/bin/../libexec/gcc/riscv64-unknown-elf/12.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccEZH2Zm.res --sysroot=/usr/bin/../riscv64-unknown-elf -melf32lriscv -o rv32ua-p-lrsc -L/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0 -L/usr/bin/../lib/gcc -L/usr/bin/../lib/gcc/riscv64-unknown-elf/12.2.0/../../../../riscv64-unknown-elf/lib -L/usr/bin/../riscv64-unknown-elf/lib /tmp/ccEgFq5M.o -T ./../env/p/link.ld
COLLECT_GCC_OPTIONS='-frandom-seed=1' '-v' '-march=rv32g' '-mabi=ilp32' '-static' '-mcmodel=medany' '-frandom-seed=1' '-fvisibility=hidden' '-nostdlib' '-nostartfiles' '-I' './../env/p' '-I' './macros/scalar' '-T' './../env/p/link.ld' '-o' 'rv32ua-p-lrsc' '-mtune=rocket' '-misa-spec=2.2' '-march=rv32imafd' '-dumpdir' 'rv32ua-p-lrsc.'

@matthiasgoergens
Copy link
Author

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65015 suggests that combining -frandom-seed and -save-temps should work. And when I'm calling the compiler manually, that does seem to be the case.

However, I haven't managed to convince configure nor make to pass that on. I tried eg ./configure CFLAGS="-save-temps -frandom-seed=1".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant