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

LLVM/Clang 13: creduce fails to build #239

Open
wcohen opened this issue Dec 9, 2021 · 6 comments
Open

LLVM/Clang 13: creduce fails to build #239

wcohen opened this issue Dec 9, 2021 · 6 comments
Assignees

Comments

@wcohen
Copy link

wcohen commented Dec 9, 2021

Attempted to build the master branch of creduce on Fedora 35 after installing the dependencies. Fedora 32 is using LLVM-13. The build fails:

g++ -DHAVE_CONFIG_H -I. -I..   -I"/usr/include/clang"  -I/usr/include -std=c++14 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -fno-exceptions -g -O3 -fno-strict-aliasing -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Wno-missing-field-initializers -MT clang_delta-RemoveBaseClass.o -MD -MP -MF .deps/clang_delta-RemoveBaseClass.Tpo -c -o clang_delta-RemoveBaseClass.o `test -f 'RemoveBaseClass.cpp' || echo './'`RemoveBaseClass.cpp
In file included from RemoveBaseClass.cpp:19:
CommonRenameClassRewriteVisitor.h: In instantiation of ‘bool clang_delta_common_visitor::CommonRenameClassRewriteVisitor<T>::VisitUsingDecl(clang::UsingDecl*) [with T = RemoveBaseClassRewriteVisitor]’:
/usr/include/clang/AST/DeclNodes.inc:109:1:   required from ‘bool clang::RecursiveASTVisitor<Derived>::WalkUpFromUsingDecl(clang::UsingDecl*) [with Derived = RemoveBaseClassRewriteVisitor]’
/usr/include/clang/AST/RecursiveASTVisitor.h:1601:1:   required from ‘bool clang::RecursiveASTVisitor<Derived>::TraverseUsingDecl(clang::UsingDecl*) [with Derived = RemoveBaseClassRewriteVisitor]’
/usr/include/clang/AST/DeclNodes.inc:109:1:   required from ‘bool clang::RecursiveASTVisitor<Derived>::TraverseDecl(clang::Decl*) [with Derived = RemoveBaseClassRewriteVisitor]’
RemoveBaseClass.cpp:111:31:   required from here
CommonRenameClassRewriteVisitor.h:101:39: error: conversion from ‘llvm::StringRef’ to non-scalar type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} requested
  101 |   std::string IdName = IdInfo->getName();
      |                        ~~~~~~~~~~~~~~~^~
CommonRenameClassRewriteVisitor.h: In instantiation of ‘bool clang_delta_common_visitor::CommonRenameClassRewriteVisitor<T>::VisitDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc) [with T = RemoveBaseClassRewriteVisitor]’:
/usr/include/clang/AST/TypeNodes.inc:41:1:   required from ‘bool clang::RecursiveASTVisitor<Derived>::WalkUpFromDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc) [with Derived = RemoveBaseClassRewriteVisitor]’
/usr/include/clang/AST/RecursiveASTVisitor.h:1328:1:   required from ‘bool clang::RecursiveASTVisitor<Derived>::TraverseDependentTemplateSpecializationTypeLoc(clang::DependentTemplateSpecializationTypeLoc) [with Derived = RemoveBaseClassRewriteVisitor]’
/usr/include/clang/AST/TypeNodes.inc:41:1:   required from ‘bool clang::RecursiveASTVisitor<Derived>::TraverseTypeLoc(clang::TypeLoc) [with Derived = RemoveBaseClassRewriteVisitor]’
/usr/include/clang/AST/RecursiveASTVisitor.h:1424:1:   required from ‘bool clang::RecursiveASTVisitor<Derived>::TraverseBlockDecl(clang::BlockDecl*) [with Derived = RemoveBaseClassRewriteVisitor]’
/usr/include/clang/AST/DeclNodes.inc:29:1:   required from ‘bool clang::RecursiveASTVisitor<Derived>::TraverseDecl(clang::Decl*) [with Derived = RemoveBaseClassRewriteVisitor]’
RemoveBaseClass.cpp:111:31:   required from here
CommonRenameClassRewriteVisitor.h:340:39: error: conversion from ‘llvm::StringRef’ to non-scalar type ‘std::string’ {aka ‘std::__cxx11::basic_string<char>’} requested
  340 |   std::string IdName = IdInfo->getName();
      |                        ~~~~~~~~~~~~~~~^~
make[2]: *** [Makefile:1436: clang_delta-RemoveBaseClass.o] Error 1
make[2]: Leaving directory '/home/wcohen/research/profiling/creduce/creduce/clang_delta'
make[1]: *** [Makefile:445: all-recursive] Error 1
make[1]: Leaving directory '/home/wcohen/research/profiling/creduce/creduce'
make: *** [Makefile:377: all] Error 2

Saw that there were some branches ( llvm-11.0 and llvm-12.0-dev) that appear to try to address problems with newer versions of LLVM, but those also failed. Both llvm-11.0 and llvm-12.0-dev get the following error:

g++ -DHAVE_CONFIG_H -I. -I..   -I"/usr/include/clang"  -I/usr/include -std=c++14 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -fno-exceptions -g -O3 -fno-strict-aliasing -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Wno-missing-field-initializers -MT clang_delta-RemoveNamespace.o -MD -MP -MF .deps/clang_delta-RemoveNamespace.Tpo -c -o clang_delta-RemoveNamespace.o `test -f 'RemoveNamespace.cpp' || echo './'`RemoveNamespace.cpp
RemoveNamespace.cpp: In member function ‘void RemoveNamespace::handleOneUsingShadowDecl(const clang::UsingShadowDecl*, const clang::DeclContext*)’:
RemoveNamespace.cpp:790:28: error: ‘const class clang::UsingShadowDecl’ has no member named ‘getUsingDecl’
  790 |   const UsingDecl *D = UD->getUsingDecl();
      |                            ^~~~~~~~~~~~
make[2]: *** [Makefile:1478: clang_delta-RemoveNamespace.o] Error 1
make[2]: Leaving directory '/home/wcohen/research/profiling/creduce/creduce/clang_delta'
make[1]: *** [Makefile:445: all-recursive] Error 1
make[1]: Leaving directory '/home/wcohen/research/profiling/creduce/creduce'
make: *** [Makefile:377: all] Error 2
@eeide eeide self-assigned this Dec 10, 2021
@chenyang78
Copy link
Member

@wcohen , I created a branch llvm-13.0 that works with LLVM 13.0 release. Thanks!

@wcohen
Copy link
Author

wcohen commented Jan 17, 2022

I was able to successfully build the llvm-13.0 branch on Fedora 35. The creduce provided the same reduction on Fedora 35 as on Fedora 33. Thanks

Is that going to be merged into the main branch of creduce or is there some incompatibility with earlier versions of LLVM?

@wcohen
Copy link
Author

wcohen commented Jan 17, 2022

The example used to exercise creduce on Fedora 35 was from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96937, GCC Bug 96937 - Duplicate DW_TAG_formal_parameter in out-of-line DW_TAG_subprogram instance

@chenyang78
Copy link
Member

I was able to successfully build the llvm-13.0 branch on Fedora 35. The creduce provided the same reduction on Fedora 35 as on Fedora 33. Thanks

Is that going to be merged into the main branch of creduce or is there some incompatibility with earlier versions of LLVM?

Yes, it's not compatible with earlier LLVM versions. We will keep this as a separate branch for now. Thanks.

@chenyang78
Copy link
Member

The example used to exercise creduce on Fedora 35 was from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96937, GCC Bug 96937 - Duplicate DW_TAG_formal_parameter in out-of-line DW_TAG_subprogram instance

Thank you for the info!

@mgehre-amd
Copy link

I was able to successfully build the llvm-13.0 branch on Fedora 35. The creduce provided the same reduction on Fedora 35 as on Fedora 33. Thanks
Is that going to be merged into the main branch of creduce or is there some incompatibility with earlier versions of LLVM?

Yes, it's not compatible with earlier LLVM versions. We will keep this as a separate branch for now. Thanks.
Would there be a way to merge this by guarding with an #if check for the LLVM version?

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

No branches or pull requests

4 participants