Bug 89705

Summary: lp_bld_debug.cpp:280:54: error: no matching function for call to ‘llvm::TargetMachine::getSubtargetImpl()’
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: lonewolf
Version: gitKeywords: bisected
Hardware: x86-64 (AMD64)   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2015-03-21 22:26:22 UTC
mesa: bbaf22a998f89eb720a3995fa2216512deed5f76 (master 10.6.0-devel)

Build error with llvm-3.7.0svn.

  Compiling src/gallium/auxiliary/gallivm/lp_bld_debug.cpp ...
src/gallium/auxiliary/gallivm/lp_bld_debug.cpp: In function ‘size_t disassemble(const void*, llvm::raw_ostream&)’:
src/gallium/auxiliary/gallivm/lp_bld_debug.cpp:280:54: error: no matching function for call to ‘llvm::TargetMachine::getSubtargetImpl()’
    const TargetInstrInfo *TII = TM->getSubtargetImpl()->getInstrInfo();
                                                      ^
Comment 1 Dieter Nützel 2015-03-22 03:01:06 UTC
I get this too on r600/Turks XT.

/opt/mesa> llc --version
LLVM (http://llvm.org/):
  LLVM version 3.7.0svn
  Optimized build with assertions.
  Built Mar 21 2015 (16:59:53).
  Default target: x86_64-unknown-linux-gnu
  Host CPU: corei7

  Registered Targets:
    amdgcn - AMD GCN GPUs
    r600   - AMD GPUs HD2XXX-HD6XXX
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64
Comment 2 Vinson Lee 2015-03-22 06:22:55 UTC
4638c993331b04c73453927cb0b9909fa0dbd282 is the first bad commit
commit 4638c993331b04c73453927cb0b9909fa0dbd282
Author: Eric Christopher <echristo@gmail.com>
Date:   Sat Mar 21 04:22:23 2015 +0000

    Remove the target independent TargetMachine::getSubtarget and
    TargetMachine::getSubtargetImpl routines.
    
    This keeps the target independent code free of bare subtarget
    calls while the remainder of the backends are migrated, or not
    if they don't wish to support per-function subtargets as would
    be needed for function multiversioning or LTO of disparate
    cpu subarchitecture types, e.g.
    
    clang -msse4.2 -c foo.c -emit-llvm -o foo.bc
    clang -c bar.c -emit-llvm -o bar.bc
    llvm-link foo.bc bar.bc -o baz.bc
    llc baz.bc
    
    and get appropriate code for what the command lines requested.
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232885 91177308-0d34-0410-b5e6-96231b3b80d8

:040000 040000 588aa3c96b228a8e4e5be4cc2f9bf901c160da3a 0f44478fddd47d1a7b5c2f445a83216b6c8d2b18 M	include
:040000 040000 9bac4dbc48c000848fd80a33971b313542fd6fd2 518cd85f7a7c92b36b357b273857aa4cd314d51f M	lib
bisect run success
Comment 3 LoneVVolf 2015-03-23 14:25:23 UTC
I found a patch by archlinux developer here :

http://pkgbuild.com/~lcarlier/mesa-git/sources/mesa-git/radeonsi.patch

It allows building mesa-git against latest llvm .
Comment 4 Tom Stellard 2015-03-23 15:50:01 UTC
Fixed in git: 769b366b83dcc12bfe06935f816023cdcfbdf578
Comment 5 Dieter Nützel 2015-03-24 04:36:18 UTC
(In reply to Tom Stellard from comment #4)
> Fixed in git: 769b366b83dcc12bfe06935f816023cdcfbdf578

Works fine on NI/Turks XT, here.
Could be closed for my side.

Thanks Tom!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.