wyleecoyo / iphone-dev

Automatically exported from code.google.com/p/iphone-dev
0 stars 0 forks source link

Compilation of LLVM fails #149

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Error during compilation of LLVM

 make ENABLE_OPTIMIZED=1
make[1]: Entering directory `/usr/local/coding/iphone/llvm-svn/lib/System'
llvm[1]: Compiling Alarm.cpp for Release build 
llvm[1]: Compiling Disassembler.cpp for Release build 
llvm[1]: Compiling DynamicLibrary.cpp for Release build 
DynamicLibrary.cpp: In static member function ‘static void*
llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(const char*)’:
DynamicLibrary.cpp:178: error: ‘strcmp’ was not declared in this scope
DynamicLibrary.cpp:179: error: ‘strcmp’ was not declared in this scope
DynamicLibrary.cpp:180: error: ‘strcmp’ was not declared in this scope
make[1]: ***
[/usr/local/coding/iphone/llvm-svn/lib/System/Release/DynamicLibrary.o] Error 1
make[1]: Leaving directory `/usr/local/coding/iphone/llvm-svn/lib/System'
make: *** [all] Error 1

Any suggestions???

Original issue reported on code.google.com by alien.0...@gmail.com on 3 Aug 2008 at 9:01

GoogleCodeExporter commented 9 years ago
I also have this bug. I'm running Debian sid.

$ gcc --version
gcc (Debian 4.3.2-1) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Original comment by norna...@gmail.com on 12 Sep 2008 at 4:46

GoogleCodeExporter commented 9 years ago
Well I was getting same error earlier on. But now I am stuck somewhere else.
I am not sure but I resolved that error by installing some more packages using 
apt-
get.

I am really sorry I don't remember package names.I tried to search for that 
link but 
not able to find it.

Original comment by alien.0...@gmail.com on 12 Sep 2008 at 7:00

GoogleCodeExporter commented 9 years ago
Had the same problem with the svn version, compiling the 2.3 release I had no
problems, so it's probably a missing include.

Original comment by fabricio...@gmail.com on 21 Oct 2008 at 5:54

GoogleCodeExporter commented 9 years ago
yes, I got the same problem. Hi Rabricio, 2.3 of what ? Thanks 

Original comment by the.ts.c...@gmail.com on 3 Nov 2008 at 2:49

GoogleCodeExporter commented 9 years ago
please, which packages did you install ?
I'm (still) stuck here ...

Original comment by julien.bayle on 13 Dec 2008 at 12:30

GoogleCodeExporter commented 9 years ago
anybody can help me ??
I'm stuck here :(

Original comment by julien.bayle on 14 Dec 2008 at 9:50

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Following the instruccions in porting to GCC 4.3 from here [1] i successfully
compiled that file.

To success you should to add "#include <cstring>" on:
DynamicLibrary.cpp
Path.cpp

But my next problem is APFloat.cpp that complains about:

"APFloat.cpp:1760: error: 'abort' was not declared in this scope"

:-/

[1] http://gcc.gnu.org/gcc-4.3/porting_to.html

Original comment by nauj27 on 3 Jan 2009 at 9:24

GoogleCodeExporter commented 9 years ago
Write "#include <cstdlib>" at top of APFloat.cpp, FileUtilities.cpp.
Write "#include <climits>" at top of CommandLine.cpp.
Write "#include <cstring>" at top of FoldingSet.cpp, Statistic.cpp, 
StringExtras.cpp

... and so on. Good luck.

Original comment by nauj27 on 3 Jan 2009 at 10:00

GoogleCodeExporter commented 9 years ago
______________________________
make[2]: entrant dans le répertoire « 
/home/user/rootIphoneDev/llvm-svn/utils/TableGen »
llvm[2]: Compiling AsmWriterEmitter.cpp for Release build
In file included from CodeGenTarget.h:21,
                 from AsmWriterEmitter.cpp:17:
CodeGenRegisters.h: In member function ‘llvm::MVT::ValueType
llvm::CodeGenRegisterClass::getValueTypeNum(unsigned int) const’:
CodeGenRegisters.h:53: erreur: ‘abort’ was not declared in this scope
In file included from AsmWriterEmitter.cpp:17:
CodeGenTarget.h: In member function ‘const llvm::CodeGenRegisterClass&
llvm::CodeGenTarget::getRegisterClass(llvm::Record*) const’:
CodeGenTarget.h:87: erreur: ‘abort’ was not declared in this scope
AsmWriterEmitter.cpp: In member function ‘unsigned int
llvm::AsmWriterInst::MatchesAllButOneOp(const llvm::AsmWriterInst&) const’:
AsmWriterEmitter.cpp:248: attention : suggest explicit braces to avoid 
ambiguous ‘else’
make[2]: ***
[/home/user/rootIphoneDev/llvm-svn/utils/TableGen/Release/AsmWriterEmitter.o] 
Erreur 1
make[2]: quittant le répertoire « 
/home/user/rootIphoneDev/llvm-svn/utils/TableGen »
make[1]: *** [TableGen/.makeall] Erreur 2
make[1]: quittant le répertoire « /home/user/rootIphoneDev/llvm-svn/utils »
make: *** [all] Erreur 1
___________________

ok I did that for a couple of file ...
and for this AsmWriterEmitter.cpp ... too!
but problem :-(

Original comment by julien.bayle on 4 Jan 2009 at 12:28

GoogleCodeExporter commented 9 years ago
Use "#include <cstdlib>" to correct 'abort' error. I've already finished and
successfully compiled llvm-svn now. But it took me about 5 hours inserting 
#include's...

make ENABLE_OPTIMIZED=1

Read error and solve inserting cstring, cstdlib, memory or limits. And `make'
again... It's tedious but it works.

Original comment by nauj27 on 4 Jan 2009 at 12:33

GoogleCodeExporter commented 9 years ago
I'll try ... again. Cause I did that.

5h?
doesn't it possible to post all your precious work for the whole world :)

Original comment by julien.bayle on 4 Jan 2009 at 1:07

GoogleCodeExporter commented 9 years ago
You can be faster than me =D
Anyway, i don't care to share my work, but whole directory is about 224M and i 
don't
know exactly what files i was change.

Really I think my changes should be maybe pushed into llvm-svn project...

You can contact me at nauj27@gmail.com.

Original comment by nauj27 on 4 Jan 2009 at 4:13

GoogleCodeExporter commented 9 years ago
This is due to GCC 4.3. As previous posters mentioned you need to add headers 
and
change some stuff in the source files.

I've done this and uploaded my changes to a torrent tracker.

Download it and solve it here:
http://axeldoesstockholm.se/techblog/2009/01/19/building-llvm-with-gcc-43/

Original comment by axelmoll...@gmail.com on 19 Jan 2009 at 10:43

GoogleCodeExporter commented 9 years ago
Hello I was adding headers as I go. until I ran into this error:

"ARMInstrInfo.h:176: error: multiple parameters named ‘Pred1’"

How can I solve this? thanks

Original comment by Vitami...@gmail.com on 9 Feb 2009 at 5:38

GoogleCodeExporter commented 9 years ago
Just renaming first Pred1 to Pred2. This maybe broke something but compile can 
continue.

Original comment by nauj27 on 9 Feb 2009 at 7:42

GoogleCodeExporter commented 9 years ago
This might be A stupid question, but after all this tedious work of fixing 
headers,
renaming variables (isn't that really tricky by the way, since we don't know the
scope of the variable?). Did anyone actually finally have a working environment 
where
he was able to develop a decent app for the iphone? thanks

Original comment by Vitami...@gmail.com on 14 Feb 2009 at 6:32

GoogleCodeExporter commented 9 years ago
Seems that installing g++-4.2 then running update-alternatives solve this 
problem for
me. 
$ sudo apt-get install g++-4.2
$ sudo update-alternatives --quiet \
    --install /usr/bin/g++ g++ /usr/bin/g++-4.2 30 \
    --slave /usr/share/man/man1/g++.1.gz g++.1.gz /usr/share/man/man1/g++-4.2.1.gz
$ sudo update-alternatives --quiet \
    --install /usr/bin/g++ g++ /usr/bin/g++-4.3 20 \
    --slave /usr/share/man/man1/g++.1.gz g++.1.gz /usr/share/man/man1/g++-4.3.1.gz

Running Ubuntu Intrepid.

Original comment by and...@gmail.com on 17 Feb 2009 at 7:05

GoogleCodeExporter commented 9 years ago
Hi,

If you still have this problem, here's a patch file that adds the includes and 
fixes
the Pred1 duplicate param names.
My system is 64-bit ubuntu 8.10 with g++ 4.2.3.

Put this file in your home directory, switch to your svn working copy directory 
and run:

patch -p0 -i ~/llvm_patch.diff

Then run the make command again.

Original comment by donald.b...@gmail.com on 28 Feb 2009 at 4:42

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for the patch donald.bleyl.  Unfortunately, I think you missed a file (at
least for my build).

X86JITInfo.cpp:287: error: 'memcpy' was not declared in this scope

had to add "#include <cstring>" to lib/target/X86/X86JITInfo.cpp.  Updated and
attached your patch file.

Original comment by roger.gr...@gmail.com on 11 Mar 2009 at 7:47

Attachments:

GoogleCodeExporter commented 9 years ago
THANKSS it works!!

Original comment by m.mchir...@gmail.com on 26 Mar 2009 at 9:23

GoogleCodeExporter commented 9 years ago
Just wanted to say thanks a million for this patch :D  Saved me a headache.

Original comment by dustin.f...@gmail.com on 1 May 2009 at 4:11

GoogleCodeExporter commented 9 years ago
for the newest version on svn ,you can compile it successfully!

Original comment by TinnyXia on 13 May 2009 at 1:58

GoogleCodeExporter commented 9 years ago
Thanks to donald.bleyl and roger.grayson

Original comment by calderon...@gmail.com on 1 Jun 2009 at 8:12

GoogleCodeExporter commented 9 years ago
Could anyone help? I am stuck again after patch llvm_patch.diff.

make[1]: Entering directory `/home/fish/llvm-svn/lib/System'
llvm[1]: Compiling DynamicLibrary.cpp for Release build 
DynamicLibrary.cpp: In static member function ‘static void* 
llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(const char*)’:
DynamicLibrary.cpp:179: error: ‘stderr’ was not declared in this scope
DynamicLibrary.cpp:180: error: ‘stdout’ was not declared in this scope
DynamicLibrary.cpp:181: error: ‘stdin’ was not declared in this scope
make[1]: *** [/home/fish/llvm-svn/lib/System/Release/DynamicLibrary.o] 
Error 1
make[1]:Leaving directory `/home/fish/llvm-svn/lib/System'
make: *** [all] Error 1

Original comment by fishf...@gmail.com on 2 Dec 2009 at 7:42

GoogleCodeExporter commented 9 years ago
fishfeel: instead of using the patch, try andika's method on an unpatched 
source tree:

$ sudo apt-get install g++-4.2
$ sudo update-alternatives --quiet \
    --install /usr/bin/g++ g++ /usr/bin/g++-4.2 30 \
    --slave /usr/share/man/man1/g++.1.gz g++.1.gz /usr/share/man/man1/g++-4.2.1.gz

Worked for me today on Ubuntu 9.10 Karmic Koala.

Original comment by anthony....@gmail.com on 2 Dec 2009 at 6:44

GoogleCodeExporter commented 9 years ago
Thanks anthony.. was getting the same problem. It's solved now

Original comment by kumarsfr...@gmail.com on 12 Dec 2009 at 11:15

GoogleCodeExporter commented 9 years ago
Thansk Anthony !

Original comment by nono...@gmail.com on 21 Dec 2009 at 6:47

GoogleCodeExporter commented 9 years ago
Anthony's method worked a charm for me also, Ubuntu Karmic.

Original comment by pauldbou...@gmail.com on 7 Mar 2010 at 3:37

GoogleCodeExporter commented 9 years ago
Yes! Worked for me on Ubuntu Karmic (9.10).
Thanks!

Original comment by russt...@gmail.com on 27 Mar 2010 at 9:40

GoogleCodeExporter commented 9 years ago
Ty anthony - simple fix ... downgrade compiler.

Ubuntu 9.10 x64

Original comment by isrne...@gmail.com on 19 Apr 2010 at 10:11

GoogleCodeExporter commented 9 years ago
$ sudo apt-get install g++-4.2
$ sudo update-alternatives --quiet \
    --install /usr/bin/g++ g++ /usr/bin/g++-4.2 30 \
    --slave /usr/share/man/man1/g++.1.gz g++.1.gz /usr/share/man/man1/g++-4.2.1.gz

This is worked on Ubuntu 9.10 Karmic Koala.

Original comment by fangha...@gmail.com on 25 Apr 2010 at 1:14

GoogleCodeExporter commented 9 years ago
Hi !
I was getting the same error while i was compiling llvm,
i'm on archlinux and my gcc version is :

gcc version 4.5.0 20100610 (prerelease) (GCC) 

PS: I'm on a x86_64 system.
I've been patched llvm with patches that i've found here and i get same errors..

[maximz@slimcut llvm-svn]$ make ENABLE_OPTIMIZED=1
make[1]: entrant dans le répertoire « /home/maximz/llvm-svn/lib/System »
llvm[1]: Compiling DynamicLibrary.cpp for Release build 
DynamicLibrary.cpp: In static member function ‘static void* 
llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(const char*)’:
DynamicLibrary.cpp:180:5: erreur: ‘stderr’ was not declared in this scope
DynamicLibrary.cpp:181:5: erreur: ‘stdout’ was not declared in this scope
DynamicLibrary.cpp:182:5: erreur: ‘stdin’ was not declared in this scope
make[1]: *** [/home/maximz/llvm-svn/lib/System/Release/DynamicLibrary.o] Erreur 
1
make[1]: quittant le répertoire « /home/maximz/llvm-svn/lib/System »
make: *** [all] Erreur 1

Original comment by maxiou...@gmail.com on 25 Jun 2010 at 5:32

GoogleCodeExporter commented 9 years ago
@maxionet: Install gcc42 from AUR 
(http://aur.archlinux.org/packages.php?ID=37586) and type:
$ CC=gcc-4.2 CXX=g++-4.2 ./configure --enable-optimized 
$ make ENABLE_OPTIMIZED=1

this worked at least for me, however I'm using i386.

Original comment by lew...@gmail.com on 14 Sep 2010 at 7:46

GoogleCodeExporter commented 9 years ago
Ubuntu 10.04 already contains package llvm-gcc-4.2

Original comment by filinb...@gmail.com on 18 Sep 2010 at 10:57

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
@filinberg
Which path must be for "LLVMOBJDIR=`pwd`", if llvm already installed (Ubuntu 
10.4)?

Or does it means that i dont need to do this:
$ mkdir -p build/llvm-gcc-4.0-iphone
$ pushd build/llvm-gcc-4.0-iphone
$ ../../llvm-gcc-4.0-iphone/configure --enable-llvm=`llvm-config --obj-root` \
--enable-languages=c,c++,objc,obj-c++ --target=arm-apple-darwin 
--enable-sjlj-exceptions \
--with-heavenly=$HEAVENLY --with-as=/usr/local/bin/arm-apple-darwin-as \
--with-ld=/usr/local/bin/arm-apple-darwin-ld --enable-wchar_t=no
$ make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn 
$ sudo make install
$ popd
$ popd

Original comment by mamma...@gmail.com on 23 Sep 2010 at 10:44

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I am stuck at this and i have tried all the suggested solutions .. 

but didn't worked for me :( (please help me)

Environment 
Ubuntu 10.10 (Maverick)
gcc 4.4.5
g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
flex 2.5.4
Bison 2.4.1
LVM version:     2.02.54(1) (2009-10-26)
Library version: 1.02.39 (2009-10-26)
Driver version:  4.17.0

make[1]: Entering directory `/home/gohar/llvm-svn/lib/System'
llvm[1]: Compiling DynamicLibrary.cpp for Release build 
DynamicLibrary.cpp: In static member function ‘static void* 
llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(const char*)’:
DynamicLibrary.cpp:179: error: ‘stderr’ was not declared in this scope
DynamicLibrary.cpp:180: error: ‘stdout’ was not declared in this scope
DynamicLibrary.cpp:181: error: ‘stdin’ was not declared in this scope
make[1]: *** [/home/gohar/llvm-svn/lib/System/Release/DynamicLibrary.o] 
Error 1
make[1]:Leaving directory `/home/gohar/llvm-svn/lib/System'
make: *** [all] Error 1

Please help me, thanks in advance

Original comment by contact2...@gmail.com on 16 Dec 2010 at 11:45

GoogleCodeExporter commented 9 years ago
@contact2gohar:
add a:
#include <cstdio>
to all of these files, I think there's one more.
But don't think, there won't be any errors after that!

Original comment by si...@mail.hw.is on 3 Feb 2011 at 4:44

GoogleCodeExporter commented 9 years ago
Hi ! i've tried many things to compile this llvm but it's really hard.
i've a new error when compiling :
askz@mine:~/Projects/iphone/llvm-svn$ make ENABLE_OPTIMIZED=1
make[1]: entrant dans le répertoire « 
/home/askz/Projects/iphone/llvm-svn/lib/System »
llvm[1]: Compiling Path.cpp for Release build 
Path.cpp: In function ‘llvm::sys::LLVMFileType 
llvm::sys::IdentifyFileType(const char*, unsigned int)’:
Path.cpp:71:10: warning: case label value exceeds maximum value for type
Path.cpp:95:10: warning: case label value exceeds maximum value for type
Path.cpp:96:10: warning: case label value exceeds maximum value for type
Path.cpp:97:10: warning: case label value exceeds maximum value for type
Path.cpp:104:10: warning: case label value exceeds maximum value for type
In file included from Path.cpp:180:0:
Unix/Path.inc: In function ‘bool llvm::sys::CopyFile(const llvm::sys::Path&, 
const llvm::sys::Path&, std::string*)’:
Unix/Path.inc:648:20: error: ‘EINTR’ was not declared in this scope
Unix/Path.inc:648:38: error: ‘EAGAIN’ was not declared in this scope
Unix/Path.inc:658:24: error: ‘EINTR’ was not declared in this scope
Unix/Path.inc:658:42: error: ‘EAGAIN’ was not declared in this scope
Unix/Path.inc: In member function ‘bool llvm::sys::Path::eraseFromDisk(bool, 
std::string*) const’:
Unix/Path.inc:590:24: warning: ignoring return value of ‘int system(const 
char*)’, declared with attribute warn_unused_result
make[1]: *** [/home/askz/Projects/iphone/llvm-svn/lib/System/Release/Path.o] 
Erreur 1
make[1]: quittant le répertoire « 
/home/askz/Projects/iphone/llvm-svn/lib/System »
make: *** [all] Erreur 1

i've an #include <cstdio> in this file. Plz help !

Original comment by as...@me.com on 16 Jun 2011 at 8:44

GoogleCodeExporter commented 9 years ago
I am getting following error. if you have solution please let me know.

In file included from /home/janarbek/Work/llvm/llvm/lib/Support/Path.cpp:279:
/home/janarbek/Work/llvm/llvm/lib/Support/Unix/Path.inc: In member function 
‘bool llvm::sys::Path::eraseFromDisk(bool, std::string*) const’:
/home/janarbek/Work/llvm/llvm/lib/Support/Unix/Path.inc:714: error: 
‘unlink’ was not declared in this scope
/bin/rm: cannot remove 
`/home/janarbek/Work/llvm/llvm_obj/lib/Support/Debug/Path.d.tmp': No such file 
or directory
make[1]: *** [/home/janarbek/Work/llvm/llvm_obj/lib/Support/Debug/Path.o] Error 
1
make[1]: Leaving directory `/home/janarbek/Work/llvm/llvm_obj/lib/Support'
make: *** [all] Error 1
janarbek@ubuntu:~/Work/llvm/llvm_obj$ 

Original comment by janar...@gmail.com on 25 Oct 2011 at 12:30