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

dev-vcs/git command git ls-tree gives wrong output when compiled with LTO #794

Closed
sliwowitz opened this issue Oct 18, 2021 · 2 comments
Closed

Comments

@sliwowitz
Copy link

When compiled with LTO, git mangles the output of the git ls-tree command.

Example of wrong output:

$ git ls-tree 601d1366475f765acaf31eb327e33bcca63a086a -- .
100644 blob 420eb4fb5b5e13911d7369f3f715594a6c1d5fb4	./
100644 blob a76943fbfcdee3fb548de6303ffa8aee2d3030e8	.cproject.gitignore
100644 blob bfa7f9e48a96bc6d430da61b60805f9b9e45d7aa	.cproject.gitignore.project
040000 tree aba29d83ffec42f5869c3dfe1a1be8ddc55e0cef	.cproject.gitignore.project.settings
100644 blob 208df79c66a5455d274a27267fce276ea5244357	.cproject.gitignore.project.settingsCMakeLists.txt
040000 tree 2addc5042610363541828a63c015d62889eb7bcd	.cproject.gitignore.project.settingsCMakeLists.txtdoc
040000 tree e460624cb3cc343a33028dd35334588082218853	.cproject.gitignore.project.settingsCMakeLists.txtdocexamples
100755 blob 7859dc94026b6705ddd57470a058185e5c51ce2f	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.sh
040000 tree 4ca4a4bd1115e52997e5efa38cdc0e434cea0870	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.shsrc
040000 tree 3579ae0c85e856d56da533c3b9aba816833cea4b	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.shsrctest
040000 tree 125e8177c1d6a99fdaa0b9e41eacc0f508ba5315	.cproject.gitignore.project.settingsCMakeLists.txtdocexamplesinstall-libs.shsrctesttools

Recompiling with *FLAGS-=-flto* results in correct output; example:

$ git ls-tree 601d1366475f765acaf31eb327e33bcca63a086a -- .
100644 blob 420eb4fb5b5e13911d7369f3f715594a6c1d5fb4	.cproject
100644 blob a76943fbfcdee3fb548de6303ffa8aee2d3030e8	.gitignore
100644 blob bfa7f9e48a96bc6d430da61b60805f9b9e45d7aa	.project
040000 tree aba29d83ffec42f5869c3dfe1a1be8ddc55e0cef	.settings
100644 blob 208df79c66a5455d274a27267fce276ea5244357	CMakeLists.txt
040000 tree 2addc5042610363541828a63c015d62889eb7bcd	doc
040000 tree e460624cb3cc343a33028dd35334588082218853	examples
100755 blob 7859dc94026b6705ddd57470a058185e5c51ce2f	install-libs.sh
040000 tree 4ca4a4bd1115e52997e5efa38cdc0e434cea0870	src
040000 tree 3579ae0c85e856d56da533c3b9aba816833cea4b	test
040000 tree 125e8177c1d6a99fdaa0b9e41eacc0f508ba5315	tools

This is with dev-vcs/git-2.33.1, and sys-devel/gcc-11.2.0. The USE flags don't matter, I also tried with USE=-*.

@sliwowitz
Copy link
Author

Just found out this has been reported as a regression in gcc 11.

@sliwowitz
Copy link
Author

Ah. I see a workaround has been already reported with PR #776 open until a fixed gcc version is in the tree. Closing this bug since this is already being taken care of.

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