Bug 230463 - devel/llvm40, devel/llvm50: fails to build with Clang 7
Summary: devel/llvm40, devel/llvm50: fails to build with Clang 7
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Brooks Davis
URL:
Keywords: needs-patch
Depends on:
Blocks: 230355
  Show dependency treegraph
 
Reported: 2018-08-08 17:19 UTC by Jan Beich
Modified: 2018-08-15 22:46 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (brooks)


Attachments
Fix template instantiations in devel/llvm{40,50} (8.82 KB, patch)
2018-08-15 21:29 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2018-08-08 17:19:07 UTC
$ poudriere jail -cj clang7 -a amd64 -v projects/clang700-import -m svn
$ poudriere testport -j clang7 devel/llvm50
[...]
tools/lld/ELF/Symbols.cpp:386:31: error: 'template' keyword not permitted here
template uint32_t SymbolBody::template getSize<ELF32LE>() const;
                              ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:387:31: error: 'template' keyword not permitted here
template uint32_t SymbolBody::template getSize<ELF32BE>() const;
                              ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:388:31: error: 'template' keyword not permitted here
template uint64_t SymbolBody::template getSize<ELF64LE>() const;
                              ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:389:31: error: 'template' keyword not permitted here
template uint64_t SymbolBody::template getSize<ELF64BE>() const;
                              ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:391:31: error: 'template' keyword not permitted here
template bool DefinedRegular::template isMipsPIC<ELF32LE>() const;
                              ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:392:31: error: 'template' keyword not permitted here
template bool DefinedRegular::template isMipsPIC<ELF32BE>() const;
                              ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:393:31: error: 'template' keyword not permitted here
template bool DefinedRegular::template isMipsPIC<ELF64LE>() const;
                              ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:394:31: error: 'template' keyword not permitted here
template bool DefinedRegular::template isMipsPIC<ELF64BE>() const;
                              ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:396:33: error: 'template' keyword not permitted here
template uint32_t SharedSymbol::template getAlignment<ELF32LE>() const;
                                ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:397:33: error: 'template' keyword not permitted here
template uint32_t SharedSymbol::template getAlignment<ELF32BE>() const;
                                ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:398:33: error: 'template' keyword not permitted here
template uint32_t SharedSymbol::template getAlignment<ELF64LE>() const;
                                ^~~~~~~~~
tools/lld/ELF/Symbols.cpp:399:33: error: 'template' keyword not permitted here
template uint32_t SharedSymbol::template getAlignment<ELF64BE>() const;
                                ^~~~~~~~~

build log: https://ptpb.pw/58hj https://ptpb.pw/8GNe
Comment 1 Jan Beich freebsd_committer 2018-08-08 17:20:16 UTC
$ poudriere testport -j clang7 devel/llvm40
[...]
tools/lld/ELF/LTO.cpp:161:32: error: 'template' keyword not permitted here
template void BitcodeCompiler::template add<ELF32LE>(BitcodeFile &);
                               ^~~~~~~~~
tools/lld/ELF/LTO.cpp:162:32: error: 'template' keyword not permitted here
template void BitcodeCompiler::template add<ELF32BE>(BitcodeFile &);
                               ^~~~~~~~~
tools/lld/ELF/LTO.cpp:163:32: error: 'template' keyword not permitted here
template void BitcodeCompiler::template add<ELF64LE>(BitcodeFile &);
                               ^~~~~~~~~
tools/lld/ELF/LTO.cpp:164:32: error: 'template' keyword not permitted here
template void BitcodeCompiler::template add<ELF64BE>(BitcodeFile &);
                               ^~~~~~~~~
Comment 2 Dimitry Andric freebsd_committer 2018-08-15 21:29:22 UTC
Created attachment 196232 [details]
Fix template instantiations in devel/llvm{40,50}

This patch should fix the template instantiations.
Comment 3 commit-hook freebsd_committer 2018-08-15 22:40:20 UTC
A commit references this bug:

Author: brooks
Date: Wed Aug 15 22:40:07 UTC 2018
New revision: 477293
URL: https://svnweb.freebsd.org/changeset/ports/477293

Log:
  Fix build with clang 7.0.

  PR:		230463
  Submitted by:	dim

Changes:
  head/devel/llvm40/Makefile
  head/devel/llvm40/files/lld/
  head/devel/llvm40/files/lld/patch-tools_lld_ELF_LTO.cpp
  head/devel/llvm40/files/lld/patch-tools_lld_ELF_Symbols.cpp
  head/devel/llvm50/Makefile
  head/devel/llvm50/files/lld/
  head/devel/llvm50/files/lld/patch-tools_lld_ELF_Symbols.cpp
Comment 4 Brooks Davis freebsd_committer 2018-08-15 22:46:56 UTC
Thanks for the patches!