[cfe-dev] Compiling llvm/clang/compiler-rt 3.2

Richard Smith richard at metafoo.co.uk
Tue May 7 09:40:54 PDT 2013


On Tue, May 7, 2013 at 9:08 AM, Jordan Rose <jordan_rose at apple.com> wrote:

> Looks like a vexing parse <http://en.wikipedia.org/wiki/Most_vexing_parse> problem.
> Try changing 'StringRef URL(SVN_REPOSITORY)' to 'StringRef URL
> = SVN_REPOSITORY'.
>

That will just break in a different way. The problem seems to be that
SVN_REPOSITORY is defined but expands to no tokens.


> If that works, please let us know so we can fix it for 3.3!
>
> Jordan
>
>
> On May 6, 2013, at 18:48 , Graeme Russell <grussell86 at gmail.com> wrote:
>
> Hi cfe-dev,
>
> I'm currently trying to compile llvm, clang and compiler-rt from the
> official 3.2 tag with gcc4.7.0 but unfortunately I'm getting the compiler
> error detailed below. Is this something anyone has come across before?
>
> Thanks,
> Graeme
>
> *Compiler Errror*
> make[4]: Entering directory `/home/grarus/build/tools/clang/lib/Basic'
> llvm[4]: Compiling Builtins.cpp for Release+Asserts build
> llvm[4]: Compiling ConvertUTF.c for Release+Asserts build
> llvm[4]: Compiling ConvertUTFWrapper.cpp for Release+Asserts build
> llvm[4]: Compiling Diagnostic.cpp for Release+Asserts build
> llvm[4]: Compiling DiagnosticIDs.cpp for Release+Asserts build
> llvm[4]: Compiling FileManager.cpp for Release+Asserts build
> llvm[4]: Compiling FileSystemStatCache.cpp for Release+Asserts build
> llvm[4]: Compiling IdentifierTable.cpp for Release+Asserts build
> llvm[4]: Compiling LangOptions.cpp for Release+Asserts build
> llvm[4]: Compiling Module.cpp for Release+Asserts build
> llvm[4]: Compiling ObjCRuntime.cpp for Release+Asserts build
> llvm[4]: Compiling SourceLocation.cpp for Release+Asserts build
> llvm[4]: Compiling SourceManager.cpp for Release+Asserts build
> llvm[4]: Compiling TargetInfo.cpp for Release+Asserts build
> llvm[4]: Compiling Targets.cpp for Release+Asserts build
> llvm[4]: Compiling TokenKinds.cpp for Release+Asserts build
> llvm[4]: Compiling Version.cpp for Release+Asserts build
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp: In function
> ‘std::string clang::getClangRepositoryPath()’:
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:36:11: error: request
> for member ‘empty’ in ‘clang::URL’, which is of non-class type
> ‘llvm::StringRef()’
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:38:63: error:
> assignment of function ‘llvm::StringRef clang::URL()’
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:38:63: error: cannot
> convert ‘llvm::StringRef’ to ‘llvm::StringRef()’ in assignment
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:42:13: error: request
> for member ‘slice’ in ‘clang::URL’, which is of non-class type
> ‘llvm::StringRef()’
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:42:26: error: request
> for member ‘find’ in ‘clang::URL’, which is of non-class type
> ‘llvm::StringRef()’
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:45:22: error: request
> for member ‘find’ in ‘clang::URL’, which is of non-class type
> ‘llvm::StringRef()’
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:47:15: error: request
> for member ‘substr’ in ‘clang::URL’, which is of non-class type
> ‘llvm::StringRef()’
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:49:10: error: could
> not convert ‘clang::URL’ from ‘llvm::StringRef (*)()’ to ‘std::string {aka
> std::basic_string<char>}’
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp: In function
> ‘std::string clang::getLLVMRepositoryPath()’:
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:63:22: error: request
> for member ‘find’ in ‘clang::URL’, which is of non-class type
> ‘llvm::StringRef()’
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:65:15: error: request
> for member ‘substr’ in ‘clang::URL’, which is of non-class type
> ‘llvm::StringRef()’
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:67:10: error: could
> not convert ‘clang::URL’ from ‘llvm::StringRef (*)()’ to ‘std::string {aka
> std::basic_string<char>}’
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp: In function
> ‘std::string clang::getClangRevision()’:
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:72:3: error:
> return-statement with no value, in function returning ‘std::string {aka
> std::basic_string<char>}’ [-fpermissive]
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:76:1: warning: no
> return statement in function returning non-void [-Wreturn-type]
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp: In function
> ‘std::string clang::getLLVMRevision()’:
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:80:3: error:
> return-statement with no value, in function returning ‘std::string {aka
> std::basic_string<char>}’ [-fpermissive]
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:84:1: warning: no
> return statement in function returning non-void [-Wreturn-type]
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp: In function
> ‘std::string clang::getLLVMRepositoryPath()’:
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:68:1: warning: control
> reaches end of non-void function [-Wreturn-type]
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp: In function
> ‘std::string clang::getClangRepositoryPath()’:
> /home/grarus/llvm/tools/clang/lib/Basic/Version.cpp:51:1: warning: control
> reaches end of non-void function [-Wreturn-type]
> /bin/rm: cannot remove
> `/home/grarus/build/tools/clang/lib/Basic/Release+Asserts/Version.d.tmp':
> No such file or directory
> make[4]: ***
> [/home/grarus/build/tools/clang/lib/Basic/Release+Asserts/Version.o] Error 1
>
>
> *Code Snippet from Version.cpp*
> #include "clang/Basic/Version.h"
> #include "clang/Basic/LLVM.h"
> #include "llvm/Support/raw_ostream.h"
> #include "llvm/Config/config.h"
> #include <cstring>
> #include <cstdlib>
>
> namespace clang {
>
> std::string getClangRepositoryPath() {
> #if defined(CLANG_REPOSITORY_STRING)
>   return CLANG_REPOSITORY_STRING;
> #else
> #ifdef SVN_REPOSITORY
>   StringRef URL(SVN_REPOSITORY);
> #else
>   StringRef URL("");
> #endif
>
>   // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This
> helps us
>   // pick up a tag in an SVN export, for example.
>   static StringRef SVNRepository("$URL:
> http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_32/final/lib/Basic/Version.cpp
>  $");
>   if (URL.empty()) {
>     URL = SVNRepository.slice(SVNRepository.find(':'),
>                               SVNRepository.find("/lib/Basic"));
>   }
>
>   // Strip off version from a build from an integration branch.
>   URL = URL.slice(0, URL.find("/src/tools/clang"));
>
>   // Trim path prefix off, assuming path came from standard cfe path.
>   size_t Start = URL.find("cfe/");
>   if (Start != StringRef::npos)
>     URL = URL.substr(Start + 4);
>
>   return URL;
> #endif
> }
>  _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130507/71ace95e/attachment.html>


More information about the cfe-dev mailing list