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

Bootstrap comparison failure: gcc/rust/rust-lex.o differs #3424

Open
1 task
kxxt opened this issue Feb 10, 2025 · 8 comments
Open
1 task

Bootstrap comparison failure: gcc/rust/rust-lex.o differs #3424

kxxt opened this issue Feb 10, 2025 · 8 comments

Comments

@kxxt
Copy link

kxxt commented Feb 10, 2025

Summary

I am building gcc 14.2.1+r730+gc061ad5a36ba-1 with gcc 14.2.1+r134+gab884fffe3fc-2 for Arch Linux RISC-V

A bootstrap comparison failure occurred for gcc/rust/rust-lex.o.

Build script: https://paste.rs/578r4

Build logs:

gcc-14.2.1+r730+gc061ad5a36ba-1-riscv64-prepare.log

gcc-14.2.1+r730+gc061ad5a36ba-1-riscv64-build.log

Two rust-lex.o from stage 2 and stage 3:

rust-lex.zip

Reproducer

Does the code make use of any (1.49) nightly feature ?

  • Nightly

Godbolt link

No response

Actual behavior

make[3]: Entering directory '/build/gcc/src/gcc-build'
rm -f stage_current
make[3]: Leaving directory '/build/gcc/src/gcc-build'
Comparing stages 2 and 3
Bootstrap comparison failure!
gcc/rust/rust-lex.o differs
make[2]: *** [Makefile:31146: compare] Error 1
make[1]: *** [Makefile:31126: stage3-bubble] Error 2
make: *** [Makefile:31189: bootstrap] Error 2

Expected behavior

The compiler successfully bootstraps itself.

GCC Version

c061ad5a36ba0c07d3d9d82a85aebb887def759d

@powerboat9
Copy link
Collaborator

Does the compiler still bootstrap with rust disabled? I'd think rust-lex.o would come from rust-lex.cc, which is a C++ file, and its compilation shouldn't be affected by the rust frontend.

@kxxt
Copy link
Author

kxxt commented Feb 10, 2025

Does the compiler still bootstrap with rust disabled? I'd think rust-lex.o would come from rust-lex.cc, which is a C++ file, and its compilation shouldn't be affected by the rust frontend.

Thanks for the suggestion! I will try a build with rust disabled.

@kxxt
Copy link
Author

kxxt commented Feb 11, 2025

Does the compiler still bootstrap with rust disabled?

Yes. With rust disabled, it bootstraps successfully. So the problem is very specific to rust-lex.o.

build.log

I'd think rust-lex.o would come from rust-lex.cc, which is a C++ file, and its compilation shouldn't be affected by the rust frontend.

Then do you have any clue about how this could happen? Thanks!

@kxxt
Copy link
Author

kxxt commented Feb 11, 2025

After running diffoscope, I find a very obvious difference in plain text apart from other differences:

$ readelf --wide --decompress --string-dump=.gnu.lto_.opts rust-lex.2.o 

String dump of section '.gnu.lto_.opts':
  [     0]  '-fno-openmp' '-fno-openacc' '-fcf-protection=none' '-g' '-mabi=lp64d' '-misa-spec=20191213' '-mtls-dialect=trad' '-march=rv64imafdc_zicsr_zifencei' '-O2' '-O2' '-flto=jobserver' '-frandom-seed=1' '-fasynchronous-unwind-tables' '-fno-PIE' '-fno-plt' '-fexceptions' '-fstack-clash-protection' '-fno-omit-frame-pointer' '-fno-checking' '-flto=jobserver' '-frandom-seed=1'
$ readelf --wide --decompress --string-dump=.gnu.lto_.opts rust-lex.3.o

String dump of section '.gnu.lto_.opts':
  [     0]  '-fno-openmp' '-fno-openacc' '-fcf-protection=none' '-g' '-mabi=lp64d' '-misa-spec=20191213' '-mtls-dialect=trad' '-march=rv64imafdc_zicsr_zifencei' '-O2' '-O2' '-fchecking=1' '-flto=jobserver' '-frandom-seed=1' '-fasynchronous-unwind-tables' '-fno-PIE' '-fno-plt' '-fexceptions' '-fstack-clash-protection' '-fno-omit-frame-pointer' '-fchecking=1' '-flto=jobserver' '-frandom-seed=1'

There are commandline-like strings embedded in .gnu.lto_.opts.

Stage 2 has '-fno-checking'

But Stage 3 has '-fchecking=1', which appeared twice.

And grepping through the build log, the options used to build stage 2 and 3 are indeed different:

cat ~/Downloads/gcc-14.2.1+r730+gc061ad5a36ba-1-riscv64-build.log | grep rust-lex
/build/gcc/src/gcc-build/./prev-gcc/xg++ -B/build/gcc/src/gcc-build/./prev-gcc/ -B/usr/riscv64-unknown-linux-gnu/bin/ -nostdinc++ -B/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs  -I/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/include/riscv64-unknown-linux-gnu  -I/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/include  -I/build/gcc/src/gcc/libstdc++-v3/libsupc++ -L/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs  -fno-PIE -c  -I /build/gcc/src/gcc/gcc/rust -I /build/gcc/src/gcc/gcc/rust/lex -I /build/gcc/src/gcc/gcc/rust/parse -I /build/gcc/src/gcc/gcc/rust/ast -I /build/gcc/src/gcc/gcc/rust/analysis -I /build/gcc/src/gcc/gcc/rust/backend -I /build/gcc/src/gcc/gcc/rust/expand -I /build/gcc/src/gcc/gcc/rust/hir/tree -I /build/gcc/src/gcc/gcc/rust/hir -I /build/gcc/src/gcc/gcc/rust/resolve -I /build/gcc/src/gcc/gcc/rust/util -I /build/gcc/src/gcc/gcc/rust/typecheck -I /build/gcc/src/gcc/gcc/rust/checks/lints -I /build/gcc/src/gcc/gcc/rust/checks/errors -I /build/gcc/src/gcc/gcc/rust/checks/errors/privacy -I /build/gcc/src/gcc/gcc/rust/checks/errors/borrowck -I /build/gcc/src/gcc/gcc/rust/util -I /build/gcc/src/gcc/gcc/rust/metadata -I /build/gcc/src/gcc/gcc/../libgrust -DIN_GCC_FRONTEND -march=rv64gc -mabi=lp64d -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat          -fstack-clash-protection         -fno-omit-frame-pointer -g -ffile-prefix-map=/build/gcc/src=/usr/src/debug/gcc -fno-checking -flto=jobserver -frandom-seed=1 -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wno-unused-parameter   -DHAVE_CONFIG_H -fno-PIE -I. -Irust -I/build/gcc/src/gcc/gcc -I/build/gcc/src/gcc/gcc/rust -I/build/gcc/src/gcc/gcc/../include  -I/build/gcc/src/gcc/gcc/../libcpp/include -I/build/gcc/src/gcc/gcc/../libcody  -I/build/gcc/src/gcc/gcc/../libdecnumber -I/build/gcc/src/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/build/gcc/src/gcc/gcc/../libbacktrace   -o rust/rust-lex.o -MT rust/rust-lex.o -MMD -MP -MF rust/.deps/rust-lex.TPo -march=rv64gc -mabi=lp64d -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat          -fstack-clash-protection         -fno-omit-frame-pointer -g -ffile-prefix-map=/build/gcc/src=/usr/src/debug/gcc -fno-checking -flto=jobserver -frandom-seed=1 -I /build/gcc/src/gcc/gcc/rust -I /build/gcc/src/gcc/gcc/rust/lex -I /build/gcc/src/gcc/gcc/rust/parse -I /build/gcc/src/gcc/gcc/rust/ast -I /build/gcc/src/gcc/gcc/rust/analysis -I /build/gcc/src/gcc/gcc/rust/backend -I /build/gcc/src/gcc/gcc/rust/expand -I /build/gcc/src/gcc/gcc/rust/hir/tree -I /build/gcc/src/gcc/gcc/rust/hir -I /build/gcc/src/gcc/gcc/rust/resolve -I /build/gcc/src/gcc/gcc/rust/util -I /build/gcc/src/gcc/gcc/rust/typecheck -I /build/gcc/src/gcc/gcc/rust/checks/lints -I /build/gcc/src/gcc/gcc/rust/checks/errors -I /build/gcc/src/gcc/gcc/rust/checks/errors/privacy -I /build/gcc/src/gcc/gcc/rust/checks/errors/borrowck -I /build/gcc/src/gcc/gcc/rust/util -I /build/gcc/src/gcc/gcc/rust/metadata -I /build/gcc/src/gcc/gcc/../libgrust /build/gcc/src/gcc/gcc/rust/lex/rust-lex.cc
      rust/rust-lang.o rust/rust-attribs.o rust/rust-object-export.o rust/rust-linemap.o rust/rust-diagnostics.o rust/rust-gcc.o rust/rust-token.o rust/rust-lex.o rust/rust-cfg-parser.o rust/rust-parse.o rust/rust-ast.o rust/rust-ast-formatting.o rust/rust-path.o rust/rust-pattern.o rust/rust-ast-fragment.o rust/rust-ast-dump.o rust/rust-ast-collector.o rust/rust-ast-visitor.o rust/rust-hir-dump.o rust/rust-session-manager.o rust/rust-compile.o rust/rust-mangle.o rust/rust-mangle-v0.o rust/rust-mangle-legacy.o rust/rust-compile-resolve-path.o rust/rust-macro-expand.o rust/rust-cfg-strip.o rust/rust-expand-visitor.o rust/rust-ast-builder.o rust/rust-derive.o rust/rust-derive-clone.o rust/rust-derive-copy.o rust/rust-proc-macro.o rust/rust-macro-invoc-lexer.o rust/rust-proc-macro-invoc-lexer.o rust/rust-macro-substitute-ctx.o rust/rust-macro-builtins.o rust/rust-hir.o rust/rust-hir-map.o rust/rust-attributes.o rust/rust-keyword-values.o rust/rust-abi.o rust/rust-token-converter.o rust/rust-macro.o rust/rust-ast-lower.o rust/rust-ast-lower-base.o rust/rust-ast-lower-pattern.o rust/rust-ast-lower-item.o rust/rust-ast-lower-implitem.o rust/rust-ast-lower-expr.o rust/rust-ast-lower-type.o rust/rust-ast-lower-stmt.o rust/rust-rib.o rust/rust-name-resolution-context.o rust/rust-default-resolver.o rust/rust-toplevel-name-resolver-2.0.o rust/rust-early-name-resolver-2.0.o rust/rust-late-name-resolver-2.0.o rust/rust-early-name-resolver.o rust/rust-name-resolver.o rust/rust-ast-resolve.o rust/rust-ast-resolve-base.o rust/rust-ast-resolve-item.o rust/rust-ast-resolve-pattern.o rust/rust-ast-resolve-expr.o rust/rust-ast-resolve-type.o rust/rust-ast-resolve-path.o rust/rust-ast-resolve-stmt.o rust/rust-ast-resolve-struct-expr-field.o rust/rust-hir-type-check.o rust/rust-privacy-check.o rust/rust-privacy-ctx.o rust/rust-reachability.o rust/rust-visibility-resolver.o rust/rust-pub-restricted-visitor.o rust/rust-privacy-reporter.o rust/rust-tyty.o rust/rust-tyty-util.o rust/rust-tyty-call.o rust/rust-tyty-subst.o rust/rust-typecheck-context.o rust/rust-tyty-bounds.o rust/rust-hir-trait-resolve.o rust/rust-hir-trait-reference.o rust/rust-hir-type-check-item.o rust/rust-hir-type-check-type.o rust/rust-hir-type-check-struct.o rust/rust-hir-type-check-pattern.o rust/rust-hir-type-check-expr.o rust/rust-hir-type-check-stmt.o rust/rust-hir-type-check-enumitem.o rust/rust-hir-type-check-implitem.o rust/rust-borrow-checker.o rust/rust-bir-builder-expr-stmt.o rust/rust-bir-dump.o rust/rust-hir-dot-operator.o rust/rust-hir-path-probe.o rust/rust-type-util.o rust/rust-coercion.o rust/rust-casts.o rust/rust-unify.o rust/rust-hir-type-check-base.o rust/rust-autoderef.o rust/rust-substitution-mapper.o rust/rust-const-checker.o rust/rust-lint-marklive.o rust/rust-lint-unused-var.o rust/rust-readonly-check.o rust/rust-hir-type-check-path.o rust/rust-unsafe-checker.o rust/rust-compile-intrinsic.o rust/rust-compile-pattern.o rust/rust-compile-fnparam.o rust/rust-compile-proc-macro.o rust/rust-base62.o rust/rust-compile-item.o rust/rust-compile-implitem.o rust/rust-compile-stmt.o rust/rust-compile-expr.o rust/rust-compile-type.o rust/rust-compile-block.o rust/rust-compile-struct-field-expr.o rust/rust-constexpr.o rust/rust-compile-base.o rust/rust-tree.o rust/rust-compile-context.o rust/rust-export-metadata.o rust/rust-imports.o rust/rust-import-archive.o rust/rust-extern-crate.o rust/rust-builtins.o rust/rust-feature.o rust/rust-feature-gate.o rust/rust-ast-validation.o rust/rust-dir-owner.o rust/rust-unicode.o rust/rust-punycode.o  linux-rust.o attribs.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  ../libgrust/libproc_macro_internal/libproc_macro_internal.a -lisl -lmpc -lmpfr -lgmp -rdynamic  -lz -lzstd 
/build/gcc/src/gcc-build/./prev-gcc/xg++ -B/build/gcc/src/gcc-build/./prev-gcc/ -B/usr/riscv64-unknown-linux-gnu/bin/ -nostdinc++ -B/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs  -I/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/include/riscv64-unknown-linux-gnu  -I/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/include  -I/build/gcc/src/gcc/libstdc++-v3/libsupc++ -L/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/build/gcc/src/gcc-build/prev-riscv64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs  -fno-PIE -c  -I /build/gcc/src/gcc/gcc/rust -I /build/gcc/src/gcc/gcc/rust/lex -I /build/gcc/src/gcc/gcc/rust/parse -I /build/gcc/src/gcc/gcc/rust/ast -I /build/gcc/src/gcc/gcc/rust/analysis -I /build/gcc/src/gcc/gcc/rust/backend -I /build/gcc/src/gcc/gcc/rust/expand -I /build/gcc/src/gcc/gcc/rust/hir/tree -I /build/gcc/src/gcc/gcc/rust/hir -I /build/gcc/src/gcc/gcc/rust/resolve -I /build/gcc/src/gcc/gcc/rust/util -I /build/gcc/src/gcc/gcc/rust/typecheck -I /build/gcc/src/gcc/gcc/rust/checks/lints -I /build/gcc/src/gcc/gcc/rust/checks/errors -I /build/gcc/src/gcc/gcc/rust/checks/errors/privacy -I /build/gcc/src/gcc/gcc/rust/checks/errors/borrowck -I /build/gcc/src/gcc/gcc/rust/util -I /build/gcc/src/gcc/gcc/rust/metadata -I /build/gcc/src/gcc/gcc/../libgrust -DIN_GCC_FRONTEND -march=rv64gc -mabi=lp64d -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat          -fstack-clash-protection         -fno-omit-frame-pointer -g -ffile-prefix-map=/build/gcc/src=/usr/src/debug/gcc -fchecking=1 -flto=jobserver -frandom-seed=1 -DIN_GCC    -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wno-unused-parameter   -DHAVE_CONFIG_H -fno-PIE -I. -Irust -I/build/gcc/src/gcc/gcc -I/build/gcc/src/gcc/gcc/rust -I/build/gcc/src/gcc/gcc/../include  -I/build/gcc/src/gcc/gcc/../libcpp/include -I/build/gcc/src/gcc/gcc/../libcody  -I/build/gcc/src/gcc/gcc/../libdecnumber -I/build/gcc/src/gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I/build/gcc/src/gcc/gcc/../libbacktrace   -o rust/rust-lex.o -MT rust/rust-lex.o -MMD -MP -MF rust/.deps/rust-lex.TPo -march=rv64gc -mabi=lp64d -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat          -fstack-clash-protection         -fno-omit-frame-pointer -g -ffile-prefix-map=/build/gcc/src=/usr/src/debug/gcc -fchecking=1 -flto=jobserver -frandom-seed=1 -I /build/gcc/src/gcc/gcc/rust -I /build/gcc/src/gcc/gcc/rust/lex -I /build/gcc/src/gcc/gcc/rust/parse -I /build/gcc/src/gcc/gcc/rust/ast -I /build/gcc/src/gcc/gcc/rust/analysis -I /build/gcc/src/gcc/gcc/rust/backend -I /build/gcc/src/gcc/gcc/rust/expand -I /build/gcc/src/gcc/gcc/rust/hir/tree -I /build/gcc/src/gcc/gcc/rust/hir -I /build/gcc/src/gcc/gcc/rust/resolve -I /build/gcc/src/gcc/gcc/rust/util -I /build/gcc/src/gcc/gcc/rust/typecheck -I /build/gcc/src/gcc/gcc/rust/checks/lints -I /build/gcc/src/gcc/gcc/rust/checks/errors -I /build/gcc/src/gcc/gcc/rust/checks/errors/privacy -I /build/gcc/src/gcc/gcc/rust/checks/errors/borrowck -I /build/gcc/src/gcc/gcc/rust/util -I /build/gcc/src/gcc/gcc/rust/metadata -I /build/gcc/src/gcc/gcc/../libgrust /build/gcc/src/gcc/gcc/rust/lex/rust-lex.cc
      rust/rust-lang.o rust/rust-attribs.o rust/rust-object-export.o rust/rust-linemap.o rust/rust-diagnostics.o rust/rust-gcc.o rust/rust-token.o rust/rust-lex.o rust/rust-cfg-parser.o rust/rust-parse.o rust/rust-ast.o rust/rust-ast-formatting.o rust/rust-path.o rust/rust-pattern.o rust/rust-ast-fragment.o rust/rust-ast-dump.o rust/rust-ast-collector.o rust/rust-ast-visitor.o rust/rust-hir-dump.o rust/rust-session-manager.o rust/rust-compile.o rust/rust-mangle.o rust/rust-mangle-v0.o rust/rust-mangle-legacy.o rust/rust-compile-resolve-path.o rust/rust-macro-expand.o rust/rust-cfg-strip.o rust/rust-expand-visitor.o rust/rust-ast-builder.o rust/rust-derive.o rust/rust-derive-clone.o rust/rust-derive-copy.o rust/rust-proc-macro.o rust/rust-macro-invoc-lexer.o rust/rust-proc-macro-invoc-lexer.o rust/rust-macro-substitute-ctx.o rust/rust-macro-builtins.o rust/rust-hir.o rust/rust-hir-map.o rust/rust-attributes.o rust/rust-keyword-values.o rust/rust-abi.o rust/rust-token-converter.o rust/rust-macro.o rust/rust-ast-lower.o rust/rust-ast-lower-base.o rust/rust-ast-lower-pattern.o rust/rust-ast-lower-item.o rust/rust-ast-lower-implitem.o rust/rust-ast-lower-expr.o rust/rust-ast-lower-type.o rust/rust-ast-lower-stmt.o rust/rust-rib.o rust/rust-name-resolution-context.o rust/rust-default-resolver.o rust/rust-toplevel-name-resolver-2.0.o rust/rust-early-name-resolver-2.0.o rust/rust-late-name-resolver-2.0.o rust/rust-early-name-resolver.o rust/rust-name-resolver.o rust/rust-ast-resolve.o rust/rust-ast-resolve-base.o rust/rust-ast-resolve-item.o rust/rust-ast-resolve-pattern.o rust/rust-ast-resolve-expr.o rust/rust-ast-resolve-type.o rust/rust-ast-resolve-path.o rust/rust-ast-resolve-stmt.o rust/rust-ast-resolve-struct-expr-field.o rust/rust-hir-type-check.o rust/rust-privacy-check.o rust/rust-privacy-ctx.o rust/rust-reachability.o rust/rust-visibility-resolver.o rust/rust-pub-restricted-visitor.o rust/rust-privacy-reporter.o rust/rust-tyty.o rust/rust-tyty-util.o rust/rust-tyty-call.o rust/rust-tyty-subst.o rust/rust-typecheck-context.o rust/rust-tyty-bounds.o rust/rust-hir-trait-resolve.o rust/rust-hir-trait-reference.o rust/rust-hir-type-check-item.o rust/rust-hir-type-check-type.o rust/rust-hir-type-check-struct.o rust/rust-hir-type-check-pattern.o rust/rust-hir-type-check-expr.o rust/rust-hir-type-check-stmt.o rust/rust-hir-type-check-enumitem.o rust/rust-hir-type-check-implitem.o rust/rust-borrow-checker.o rust/rust-bir-builder-expr-stmt.o rust/rust-bir-dump.o rust/rust-hir-dot-operator.o rust/rust-hir-path-probe.o rust/rust-type-util.o rust/rust-coercion.o rust/rust-casts.o rust/rust-unify.o rust/rust-hir-type-check-base.o rust/rust-autoderef.o rust/rust-substitution-mapper.o rust/rust-const-checker.o rust/rust-lint-marklive.o rust/rust-lint-unused-var.o rust/rust-readonly-check.o rust/rust-hir-type-check-path.o rust/rust-unsafe-checker.o rust/rust-compile-intrinsic.o rust/rust-compile-pattern.o rust/rust-compile-fnparam.o rust/rust-compile-proc-macro.o rust/rust-base62.o rust/rust-compile-item.o rust/rust-compile-implitem.o rust/rust-compile-stmt.o rust/rust-compile-expr.o rust/rust-compile-type.o rust/rust-compile-block.o rust/rust-compile-struct-field-expr.o rust/rust-constexpr.o rust/rust-compile-base.o rust/rust-tree.o rust/rust-compile-context.o rust/rust-export-metadata.o rust/rust-imports.o rust/rust-import-archive.o rust/rust-extern-crate.o rust/rust-builtins.o rust/rust-feature.o rust/rust-feature-gate.o rust/rust-ast-validation.o rust/rust-dir-owner.o rust/rust-unicode.o rust/rust-punycode.o  linux-rust.o attribs.o libbackend.a main.o libcommon-target.a libcommon.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a  ../libgrust/libproc_macro_internal/libproc_macro_internal.a -lisl -lmpc -lmpfr -lgmp -rdynamic  -lz -lzstd 
gcc/rust/rust-lex.o differs

@powerboat9
Copy link
Collaborator

https://gcc.gnu.org/onlinedocs/gcc/Developer-Options.html

While I don't know what could be causing the issue, I'm not sure that's it -- it looks like that's only supposed to affect code generation if -fchecking is set to 2

@powerboat9
Copy link
Collaborator

What does objdump -d show differently for each?

@kxxt
Copy link
Author

kxxt commented Feb 11, 2025

https://gcc.gnu.org/onlinedocs/gcc/Developer-Options.html

While I don't know what could be causing the issue, I'm not sure that's it -- it looks like that's only supposed to affect code generation if -fchecking is set to 2

Yes, you are right. It appears that gcc strips the lto opts before comparing them so this difference doesn't matter. (with contrib/compare-lto)

./compare-lto  rust-lex.2.o rust-lex.3.o 
rust-lex.2.o rust-lex.3.o differ: byte 41, line 1
stripping off LTO option section, then retrying
rust-lex.2.o.stripped rust-lex.3.o.stripped differ: byte 2360617, line 2960

@kxxt
Copy link
Author

kxxt commented Feb 11, 2025

What does objdump -d show differently for each?

From the output of diffoscope: https://repos.kxxt.dev/temp/diff.htm

The most different section is .gnu.lto_.jmpfuncs.1.
Other differences are mostly offsets.

The diff of disasm of this section is too big to read:

 diff -u <(objdump --disassemble-all --section .gnu.lto_.jmpfuncs.1  rust-lex.2.o)  <(objdump --disassemble-all --section .gnu.lto_.jmpfuncs.1  rust-lex.3.o) > diff.log

diff.log

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

2 participants