Skip to content

Set -fno-gnu-unique for building LLVM #39390

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

Merged
merged 2 commits into from
Feb 1, 2021
Merged

Set -fno-gnu-unique for building LLVM #39390

merged 2 commits into from
Feb 1, 2021

Conversation

vchuravy
Copy link
Member

On my system that uses a Radeon GPU the codesnippet below (from #37200)

using GLFW, ModernGL
window = GLFW.Window(resolution = (10, 10), major = 3, minor = 3, visible = false, focus = false)

crashes with

Thread 15 "julia:sh0" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff827fc640 (LWP 2166709)]
0x00007fff89ea919d in llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool)
    () from /usr/lib/libLLVM-11.so
(gdb) bt
#0  0x00007fff89ea919d in llvm::TargetPassConfig::addPass(llvm::Pass*, bool, bool) () from /usr/lib/libLLVM-11.so
#1  0x00007fff89eabfc8 in llvm::TargetPassConfig::addRegAssignmentOptimized() () from /usr/lib/libLLVM-11.so
#2  0x00007fff89eac38e in llvm::TargetPassConfig::addOptimizedRegAlloc() () from /usr/lib/libLLVM-11.so
#3  0x00007fff89eac986 in llvm::TargetPassConfig::addMachinePasses() () from /usr/lib/libLLVM-11.so
#4  0x00007fff89bfb5d2 in ?? () from /usr/lib/libLLVM-11.so
#5  0x00007fff89bff8a1 in llvm::LLVMTargetMachine::addPassesToEmitFile(llvm::legacy::PassManagerBase&, llvm::raw_pwrite_stream&, llvm::raw_pwrite_stream*, llvm::CodeGenFileType, bool, llvm::MachineModuleInfoWrapperPass*) ()
   from /usr/lib/libLLVM-11.so
#6  0x00007fff8f1c6f66 in ?? () from /usr/lib/dri/radeonsi_dri.so
#7  0x00007fff8f107475 in ?? () from /usr/lib/dri/radeonsi_dri.so
#8  0x00007fff8f14f22b in ?? () from /usr/lib/dri/radeonsi_dri.so
#9  0x00007fff8ed8dd08 in ?? () from /usr/lib/dri/radeonsi_dri.so
#10 0x00007fff8ed8c418 in ?? () from /usr/lib/dri/radeonsi_dri.so
#11 0x00007ffff7f6c3e9 in start_thread () from /usr/lib/libpthread.so.0
#12 0x00007ffff7e9a293 in clone () from /usr/lib/libc.so.6
(gdb) 

The last time I dug into this it tourned out to be a problem with how gcc handles static variables
in particular it annotating them with GNU_UNIQUE and glibc promptly ignoring symbol versions of
symbols marked such.

Upstream bug report: https://bugs.llvm.org/show_bug.cgi?id=48221
I never got a reply on libc-help when I asked if that behaviour is intended https://sourceware.org/pipermail/libc-help/2020-November/005559.html

On the LLVM discord I got the recommendation to build LLVM with -fno-gnu-unique

cc: @wsmoses in case this impacts LLVM plugins

If this looks okay, I will fix this in Yggdrasil as well.

@vchuravy vchuravy added the backport 1.6 Change should be backported to release-1.6 label Jan 25, 2021
@Wikunia
Copy link
Contributor

Wikunia commented Jan 25, 2021

Just in time for me ☺️ thanks a lot @vchuravy
This solved my AMD problem with Makie!

@vchuravy
Copy link
Member Author

@vtjnash any concerns? Otherwise I would like to merge this.

@vchuravy
Copy link
Member Author

@vtjnash you asked me whether or not Clang tests are passing with this flag. I build LLVM ToT with -fno-gnu-unique and all the Clang tests are passing.

@KristofferC KristofferC mentioned this pull request Feb 1, 2021
10 tasks
@vchuravy
Copy link
Member Author

vchuravy commented Feb 1, 2021

I am going to merge this, since it fixes a long-standing usability issue on Linux, but we should keep an eye out for issues that might happen with Clang.jl/Cxx.jl

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

Successfully merging this pull request may close these issues.

3 participants