[llvm-dev] Building llvm1.6 on ubuntu 14.

mats petersson via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 8 01:06:14 PDT 2016


On 6 April 2016 at 00:57, Muhammad Umar Janjua via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> I just had an old project with llvm1.6.
>
> I tried to compile it on the ubuntu 14..
>
> First, I copied cfrontend, called ./fixheaders and then did configure.
>
> Everything worked well. It required g++/bison/flex, which I installed.
>
> Then I tried to use make ( no gmake). It gave these errors...
>
> Any wonder..how to fix this.
>
>
>
> ubuntu at ubuntu:~/build1.6$ make
> make[1]: Entering directory `/home/ubuntu/build1.6/lib/System'
> llvm[1]: Compiling Path.cpp for Debug build
> In file included from
> /home/ubuntu/build1.6/../llvm/lib/System/Path.cpp:14:0:
> /home/ubuntu/build1.6/../llvm/include/llvm/System/Path.h:250:33: warning:
> type qualifiers ignored on function return type [-Wignored-qualifiers]
>        const char* const c_str() const { return path.c_str(); }
>

Probably harmless... Maybe remove the extra const - it makes little or no
difference.

>                                  ^
> /home/ubuntu/build1.6/../llvm/lib/System/Path.cpp: In function
> ‘llvm::sys::LLVMFileType llvm::sys::IdentifyFileType(const char*, unsigned
> int)’:
> /home/ubuntu/build1.6/../llvm/lib/System/Path.cpp:52:39: error: ‘memcmp’
> was not declared in this scope
>          if (memcmp(magic,"!<arch>\n",8) == 0)
>

Looks like the typical case of "something used to drag in a header file
that some code depends on, and now it doesn't" -  add #include <cstring> to
the list of #includes in Path.cpp.

Since 1.6 is 11 years old, it's not entirely surprising that there will be
warnings and errors because of changes in the compilers and header files in
between.

--
Mats

>                                        ^
> make[1]: *** [/home/ubuntu/build1.6/lib/System/Debug/Path.o] Error 1
> make[1]: Leaving directory `/home/ubuntu/build1.6/lib/System'
> make: *** [all] Error 1
> ubuntu at ubuntu:~/build1.6$
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160408/25917e9f/attachment.html>


More information about the llvm-dev mailing list