-
Notifications
You must be signed in to change notification settings - Fork 463
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
Comments
Unfortunately, ~/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.' |
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65015 suggests that combining However, I haven't managed to convince |
See riscv-software-src/riscv-tests#529 --------- Co-authored-by: bing <[email protected]>
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:
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):Look for
/tmp/
in the above to see instances of randomised file names, some of them make it into the final ELF.The text was updated successfully, but these errors were encountered: