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

clang-18: -ffat-lto-objects gives multiple definition of `.str.llvm.0' #84167

Closed
stsp opened this issue Mar 6, 2024 · 10 comments
Closed

clang-18: -ffat-lto-objects gives multiple definition of `.str.llvm.0' #84167

stsp opened this issue Mar 6, 2024 · 10 comments

Comments

@stsp
Copy link

stsp commented Mar 6, 2024

I made the bug reproducer.
Please do the following:

  1. git clone https://github.com/dosemu2/fdpp.git
  2. cd fdpp
  3. git checkout lto-bug
  4. ./bug.sh

Build process ending with:

/usr/bin/ld: /tmp/lto-llvm-00e3b8.o:(.rodata.str1.1+0x70): multiple definition of `.str.2.llvm.0'; /tmp/lto-llvm-98e51f.o:(.rodata.str1.1+0x5b): first defined here

Removing -ffat-lto-objects avoids the
problem, but unfortunately rpmbuild
in fedora forces this option.

@EugeneZelenko EugeneZelenko added LTO Link time optimization (regular/full LTO or ThinLTO) and removed new issue labels Mar 6, 2024
@nikic
Copy link
Contributor

nikic commented Mar 6, 2024

cc @ilovepi for fat LTO

@ilovepi
Copy link
Contributor

ilovepi commented Mar 6, 2024

Is this happening at head? I think #83159 should have fixed this. While I didn't run into this for Fuchsia, when trying to enable FatLTO in our Toolchain builds I hit this. Basically the way we set module flags was inconsistent with what we do outside of FatLTO.

@nikic nikic added this to the LLVM 18.X Release milestone Mar 6, 2024
@nikic
Copy link
Contributor

nikic commented Mar 7, 2024

The reproducer doesn't work for me, fails with:

2024-03-07 10:11:21,731 [ERROR] koji: Unknown command: install

And I'm not sure how I would test build setup against a different clang version. @stsp Is that possible somehow?

We can at least backport that PR though.

/cherry-pick 7d8b50a

@llvmbot llvmbot closed this as completed Mar 7, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 7, 2024

/pull-request #84290

@stsp
Copy link
Author

stsp commented Mar 7, 2024

@nikic can you prepare the rpm
with the patched version of clang?
I'll test locally.
Is this an option?

@nikic
Copy link
Contributor

nikic commented Mar 7, 2024

@stsp I created a scratch build with this patch: https://koji.fedoraproject.org/koji/taskinfo?taskID=114603529

@EugeneZelenko EugeneZelenko added clang:codegen release:backport and removed LTO Link time optimization (regular/full LTO or ThinLTO) labels Mar 7, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 7, 2024

@llvm/issue-subscribers-clang-codegen

Author: Stas Sergeev (stsp)

I made the bug reproducer. Please do the following:
  1. git clone https://github.com/dosemu2/fdpp.git
  2. cd fdpp
  3. git checkout lto-bug
  4. ./bug.sh

Build process ending with:

/usr/bin/ld: /tmp/lto-llvm-00e3b8.o:(.rodata.str1.1+0x70): multiple definition of `.str.2.llvm.0'; /tmp/lto-llvm-98e51f.o:(.rodata.str1.1+0x5b): first defined here

Removing -ffat-lto-objects avoids the
problem, but unfortunately rpmbuild
in fedora forces this option.

@stsp
Copy link
Author

stsp commented Mar 7, 2024

Thanks!
I confirm that the problem is now fixed.

@nikic
Copy link
Contributor

nikic commented Mar 7, 2024

Awesome, thanks!

@ilovepi
Copy link
Contributor

ilovepi commented Mar 7, 2024

Thanks @nikic I didn't realize we could still backport.

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

No branches or pull requests

5 participants