sheebz / iphone-dev

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

LLVM-GCC fails to build with latest svn version #70

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Follow directions at http://code.google.com/p/iphone-dev/wiki/Building
2. error is encountered when running $ make
LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn 

When building, I receive the following error:
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp: In function 'void
llvm_initialize_backend()':
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp:191: error:
'createBFS_DAGScheduler' was not declared in this scope
make[1]: *** [llvm-backend.o] Error 1
make: *** [all-gcc] Error 2

Instead, I would expect it to compile cleanly.  In case it was a transient
problem, I refreshed the iphone-dev svn checkout, ending up at rev. 42529.
  This did not change the error message.

Again, this is while attempting to follow the "building the toolchain"
directions on an Intel Mac Mini running OS 10.4.10.

When the error is encountered, the makefile is attempting to build the
following target:

$ c++ -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -pedantic -Wno-long-long
-Wno-variadic-macros -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused
-DTARGET_NAME=\"arm-apple-darwin\" -DNDEBUG -DENABLE_LLVM
-I/Users/tom/work/iphone/llvm-svn/include  -D_DEBUG  -D_GNU_SOURCE
-D__STDC_LIMIT_MACROS -DLLVM_VERSION_INFO='"2.0-svn-iphone-dev-0.3-svn"'  
-I. -I. -I../../../llvm-gcc-4.0-iphone/gcc
-I../../../llvm-gcc-4.0-iphone/gcc/.
-I../../../llvm-gcc-4.0-iphone/gcc/../include -I./../intl
-I../../../llvm-gcc-4.0-iphone/gcc/../libcpp/include 
-I/Users/tom/work/iphone/llvm-svn/include
-I/Users/tom/work/iphone/llvm-svn/include
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp -o llvm-backend.o

Note that /Users/tom/work/iphone is where I checked out the source for
llvm-svn and iphone-dev, and that set reports:

HEAVENLY=/usr/local/share/iphone-filesystem
LLVMOBJDIR=/Users/tom/work/iphone/llvm-svn

Original issue reported on code.google.com by tom.manc...@gmail.com on 2 Oct 2007 at 12:25

GoogleCodeExporter commented 9 years ago
Wish I had been clearer with the title of the issue.  If anyone picks this 
issue up,
it might be good to rename it to mention that it's LLVM-GCC that I'm trying to 
build,
not that the compiler I produce can't build iPhone apps.  I fail.

Finally, this might have been nice to include:
$ pwd
/Users/tom/work/iphone/iphone-dev/build/llvm-gcc-4.0-iphone

Let me know if there's any other information I can provide.

Original comment by tom.manc...@gmail.com on 2 Oct 2007 at 1:10

GoogleCodeExporter commented 9 years ago
To continue talking to myself, I did notice that the "use scp to retrieve the 
root
filesystem" approach may be in doubt.  However, the error I'm seeing is 
different
from the one reported in an earlier defect.  

I will attempt to use the restore image and see if I get better results.  The 
wiki
steps don't specify which version of the firmware I should be at, but I'm using 
1.0.2.

Original comment by tom.manc...@gmail.com on 3 Oct 2007 at 2:11

GoogleCodeExporter commented 9 years ago
I am seeing the same issue.  My root filesystem from my iphone was copied 
correctly.

Original comment by fay...@gmail.com on 3 Oct 2007 at 5:13

GoogleCodeExporter commented 9 years ago
The same thing on PC (Ubuntu 7.04): as if LLVM and the LLVM-GCC were 
incompatible. 
If you change the scheduler to whatever is used with "optimized" if-branch, it 
will 
later complain about Intristic sqrt_f32 and sqrt_f64 and few more.

Original comment by marcin.zdun on 3 Oct 2007 at 12:17

GoogleCodeExporter commented 9 years ago
Yes, I believe that my filesystem was copied correctly too, as it can find 
whatever
file is missing in momingstl's "Compile error when Build the toolchain" issue 
while
compiling with -lc.

I hope this gets fixed soon because I'm eager to start playing, but I'd imagine 
the
team probably is busy with the 1.1 unlock effort.  If anyone out there can give 
me a
pair of revision numbers (for LLVM and LLVM-GCC) that are known to work 
together I
can check out up to that rev.

Original comment by tom.manc...@gmail.com on 3 Oct 2007 at 12:50

GoogleCodeExporter commented 9 years ago
I just ran into the same problem under OS X 10.4.10 Intel. I would also be 
interested
in a working LLVM/LLVM-GCC revision set.

Original comment by huber...@gmx.de on 3 Oct 2007 at 5:31

GoogleCodeExporter commented 9 years ago
Same problem here, same platform. 

../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp: In function 'void 
llvm_initialize_backend()':
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp:191: error: 
'createBFS_DAGScheduler' was not declared in 
this scope

HALP!

Original comment by vanderh...@gmail.com on 3 Oct 2007 at 6:03

GoogleCodeExporter commented 9 years ago
I have got the same problem  under Mac OS X (intel) 10.4.10. 

-I/Users/sunghomaeung/Projects/llvm-svn/include 
-I/Users/sunghomaeung/Projects/llvm-svn/
include ../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp -o llvm-backend.o
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp: In function 'void 
llvm_initialize_backend()':
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp:191: error: 
'createBFS_DAGScheduler' was not declared in 
this scope
make[1]: *** [llvm-backend.o] Error 1
make: *** [all-gcc] Error 2

please, help me ... 

Original comment by smae...@gmail.com on 4 Oct 2007 at 6:46

GoogleCodeExporter commented 9 years ago
I made a workaround for the problem by simple only registering the default 
Scheduler:

  // if (optimize) {
    RegisterScheduler::setDefault(createDefaultScheduler);
  // } else {
  //  RegisterScheduler::setDefault(createBFS_DAGScheduler);
  // }

This worked for me. 
I ran then into another problem with llvm-convert.cpp, for which I haven't got 
the
log anymore. It was something like sqrt_f32, sqrt_f64, powi_f32 and powi_f64 
would
not be a member of Intrinsic. I looked these up in
llvm-svn/include/llvm/Intrinsics.gen and found only sqrt and powi, but no
differentiation in _f32 and _f64. So I simply replaced all occurances of *_f32 
and
*_f64 in llvm-convert.cpp by their simpler counterpart (sqrt and powi):
      HANDLE_UNARY_FP(sqrt, sqrt, Amt); // was: sqrt_f32, sqrt_f64
  case Type::FloatTyID:  Id = Intrinsic::powi; break; //was: powi_f32
  case Type::DoubleTyID: Id = Intrinsic::powi; break; //was: powi_f64

With this, I could finish compiling the toolchain. I don't know if it generates
correct code, but I could at least compile some examples with it. Still have to 
test
them with a real phone, though...

Original comment by huberma...@googlemail.com on 4 Oct 2007 at 8:44

GoogleCodeExporter commented 9 years ago
I fear both iphone-dev and llvm-svn are in a state of flux, so neither can be 
guaranteed to build against the 
other at any point in time.

Normally, you would not checkout the trunk of something like llvm. You would 
check out a known version.

I got llvm-backend.cpp to compile by merging in changes from the svn version of 
llvm-gcc-4.0, so that it 
matched the svn trunk of llvm.

I changed:
  if (optimize) {
    RegisterScheduler::setDefault(createDefaultScheduler);
  } else {
    RegisterScheduler::setDefault(createBFS_DAGScheduler);
  }

to:
  RegisterScheduler::setDefault(createDefaultScheduler);

  if (optimize)
    RegisterRegAlloc::setDefault(createLinearScanRegisterAllocator);
  else
    RegisterRegAlloc::setDefault(createLocalRegisterAllocator);

As per the SVN trunk of llvm-gcc-4.0

However, this then led me to another error further on through the build:

/Users/jamesm/Projects/iPhone/build/llvm-gcc-4.0-iphone/gcc/xgcc -
B/Users/jamesm/Projects/iPhone/build/llvm-gcc-4.0-iphone/gcc/ 
-B/usr/local/arm-apple-darwin/bin/ -
B/usr/local/arm-apple-darwin/lib/ -isystem /usr/local/arm-apple-darwin/include 
-isystem /usr/local/arm-
apple-darwin/sys-include -DIN_GCC    -W -Wall -Wwrite-strings 
-Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition  -isystem ./include  -I. -I. 
-I../../../iphone-dev/llvm-gcc-4.0-iphone/gcc -
I../../../iphone-dev/llvm-gcc-4.0-iphone/gcc/. 
-I../../../iphone-dev/llvm-gcc-4.0-iphone/gcc/../include -
I../../../iphone-dev/llvm-gcc-4.0-iphone/gcc/../libcpp/include  
-I/Users/jamesm/Projects/iPhone/llvm-
svn/include -I/Users/jamesm/Projects/iPhone/build/llvm/include  -c 
../../../iphone-dev/llvm-gcc-4.0-
iphone/gcc/config/darwin-crt3.c -o crt3.o
/Users/jamesm/Projects/iPhone/llvm-svn/lib/CodeGen/RegisterScavenging.cpp:113: 
failed assertion `false 
&& "Using an undefined register!"'
../../../iphone-dev/llvm-gcc-4.0-iphone/gcc/config/darwin-crt3.c:535: internal 
compiler error: Abort trap

I'm still trying to figure out what's going on there.

Original comment by jamesfmi...@gmail.com on 4 Oct 2007 at 9:52

GoogleCodeExporter commented 9 years ago
I have compiled using hubermat72 's idea; however, I have to test it whether it 
is working on iphone. 

Thank you. hubermat72.

Original comment by smae...@gmail.com on 4 Oct 2007 at 11:23

GoogleCodeExporter commented 9 years ago
This workaround should allow you to build.  Retrieve the llvm from this date 
using
the following cmd:

svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm-svn -r {2007-09-25}

(this should correspond to revision: 42286)

Follow the instructions on the wiki to build it, install it, and set your VAR.  
After
this, the compilation message should go away and allow you to successfully 
build the
llvm-gcc-4.0-iphone, so continue to follow the other instructions verbatim.  

I was able to successfully compile HelloWorld, but havent tested the app on the
iphone yet.

Original comment by fay...@gmail.com on 5 Oct 2007 at 8:40

GoogleCodeExporter commented 9 years ago
Thanks fayoeu, helped a lot. Now with rev 42286 of llvm and rev 42630 of 
iphone-dev
it works under Ubuntu Feisty for the UIKit HelloWorld

Original comment by vobe...@gmail.com on 5 Oct 2007 at 11:45

GoogleCodeExporter commented 9 years ago
Bravo, fayoeu!  I can confirm that checking out up to the specified revision 
lets me
build on a platform that refused to before.  I don't know whether it was 
necessary or
not, but before beginning from "svn co ..." I blew away the llvm-svn directory 
to
make sure that I wasn't compiling any new files that might have been added 
since that
rev.

I have not yet had time to test the output of the compiler, but will comment 
again
once I have.

Original comment by tom.manc...@gmail.com on 5 Oct 2007 at 1:29

GoogleCodeExporter commented 9 years ago
I tried rev 42286 of llvm and rev 42630 of iphone-dev (voberle's solution) 
under OSX
10.4.10 and an Intel Mac. No success, the comand
"make LLVM_VERSION_INFO=2.0-svn-iphone-dev-0.3-svn"
ends up with
"configure: error: You must specify valid path to your LLVM tree with 
--enable-llvm=DIR
make: *** [configure-gcc] Error 1"

Although in the previous command I was sending:
../../llvm-gcc-4.0-iphone/configure --enable-llvm=$LLVMOBJDIR
--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

and the variable $LLVMOBJDIR = /Users/marc/iphone/toolchain030/llvm-svn

Original comment by mar...@gmail.com on 7 Oct 2007 at 8:00

GoogleCodeExporter commented 9 years ago
>Normally, you would not checkout the trunk of something like llvm. You would 
check
out a known version.

One should just go to llvm-gcc repository and apply needed patches to 
iphone-related
stuff.

Patches in questions:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071001/054160.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20071001/054125.html

Patches for 4.2 can be found easily.

It's LLVM's rule to have both LLVM and llvm-gcc to be always stable and in sync.

Original comment by korobeyn...@gmail.com on 10 Oct 2007 at 1:07

GoogleCodeExporter commented 9 years ago
Anton,

I know llvm and llvm-gcc would be in sync, however llvm-gcc-4.0-iphone, which 
is stored in this SVN 
repository, is currently _out_ of sync with the llvm head in LLVM's SVN 
repository. That was my point.

Have you tried applying those patches? I did the equivalent changes manually, 
but I ended up with internal 
compiler errors in xgcc.

Original comment by jamesfmi...@gmail.com on 11 Oct 2007 at 12:14

GoogleCodeExporter commented 9 years ago
This happened to me as well on Intel Mac 10.4.10. I followed fayoeu's 
suggestion on comment #12 and it now 
compiled. I also compiled, but haven't tested yet, the HelloApplication. 

Original comment by email...@gmail.com on 14 Oct 2007 at 8:23

GoogleCodeExporter commented 9 years ago
Reproduced with Ubuntu 7.10
Change summary, Status and Priority

Original comment by Phi...@gmail.com on 16 Oct 2007 at 1:07

GoogleCodeExporter commented 9 years ago
The problem is revision 42499 of the llvm svn:
------------------------------------------------------------------------
r42499 | evancheng | 2007-10-02 09:44:07 +1300 (Tue, 02 Oct 2007) | 2 lines

Remove simple scheduler.

------------------------------------------------------------------------

I have attached the changes to this post.

Original comment by Phi...@gmail.com on 17 Oct 2007 at 6:30

Attachments:

GoogleCodeExporter commented 9 years ago
Ok, I know how to fix it. But it would be much easier for nightwatch to fix it. 
If
anyone see him on IRC, ask him to read this.

Simply, llvm-gcc-4.0-iphone needs to be fully updated from the llvm-gcc svn, and
the patches re-applied.

Until that, everyone else can downgrade llvm-svn to an older version with:
svn up -r 42498

Original comment by Phi...@gmail.com on 17 Oct 2007 at 7:25

GoogleCodeExporter commented 9 years ago
Using 42498 I still get this problem.  Also tried 42286 and got the same error 
again.  

Original comment by jonaskap...@gmail.com on 21 Oct 2007 at 9:00

GoogleCodeExporter commented 9 years ago
jonaskaplan, is it the exact same error message?

Original comment by Phi...@gmail.com on 21 Oct 2007 at 12:42

GoogleCodeExporter commented 9 years ago
Sorry for the vagueness.  With 42498 I get the exact same error message, yes, 
but with revision 42286 I get 
the following error, this is on PPC Mac OS X 10.4.10:

In file included from /opt/local/lib/llvm/src/include/llvm/ADT/SmallPtrSet.h:20,
                 from /opt/local/lib/llvm/src/include/llvm/ADT/SmallSet.h:18,
                 from /opt/local/lib/llvm/src/include/llvm/ADT/SetVector.h:23,
                 from ../../../llvm-gcc-4.0-iphone/gcc/llvm-internal.h:37,
                 from ../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp:23:
/opt/local/lib/llvm/obj/include/llvm/Support/DataTypes.h:38:3: error: #error 
"Must #define 
__STDC_LIMIT_MACROS before #including Support/DataTypes.h"
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp: In function 'void 
createOptimizationPasses()':
/opt/local/lib/llvm/src/include/llvm/Transforms/Scalar.h:130: error: too many 
arguments to function 
'llvm::LoopPass* llvm::createLoopUnswitchPass()'
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp:342: error: at this point in 
file
../../../llvm-gcc-4.0-iphone/gcc/llvm-backend.cpp:348: error: 'createGVNPass' 
was not declared in this 
scope
make[1]: *** [llvm-backend.o] Error 1
make: *** [all-gcc] Error 2

Original comment by jonaskap...@gmail.com on 21 Oct 2007 at 8:11

GoogleCodeExporter commented 9 years ago
Compiled successfully on Intel mac, so the problem was PPC only. 

Original comment by jonaskap...@gmail.com on 22 Oct 2007 at 7:52

GoogleCodeExporter commented 9 years ago
Nightwatch seams to have disappeared, reassigned back to me.

I'm working on Issue 83, which should fix this problem.

Original comment by Phi...@gmail.com on 30 Oct 2007 at 7:38

GoogleCodeExporter commented 9 years ago
has this issue ever been fixed?

when i compile i keep receiving this error:

c++ -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -pedantic -Wno-long-long 
-Wno-variadic-macros -
mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"arm-apple-darwin\" 
-DNDEBUG -
DENABLE_LLVM -I/opt/local/lib/llvm/src/include  -D_DEBUG  -D_GNU_SOURCE 
-D__STDC_LIMIT_MACROS -
DLLVM_VERSION_INFO='"2.0-svn-iphone-dev-0.3-svn"'   -I. -I. 
-I../../../llvm-gcc-4.0-iphone/gcc -
I../../../llvm-gcc-4.0-iphone/gcc/. 
-I../../../llvm-gcc-4.0-iphone/gcc/../include -I./../intl -I../../../llvm-
gcc-4.0-iphone/gcc/../libcpp/include  -I/opt/local/lib/llvm/src/include 
-I/opt/local/lib/llvm/obj/include 
../../../llvm-gcc-4.0-iphone/gcc/llvm-convert.cpp -o llvm-convert.o
../../../llvm-gcc-4.0-iphone/gcc/llvm-convert.cpp: In member function ‘bool 
TreeToLLVM::EmitBuiltinCall(tree_node*, tree_node*, llvm::Value*, 
llvm::Value*&)’:
../../../llvm-gcc-4.0-iphone/gcc/llvm-convert.cpp:4438: error: ‘annotation’ 
is not a member of 
‘llvm::Intrinsic’
make[1]: *** [llvm-convert.o] Error 1
make: *** [all-gcc] Error 2

using OSX 10.5.1

Original comment by adam%84d...@gtempaccount.com on 8 Feb 2008 at 1:58

GoogleCodeExporter commented 9 years ago
=*SJ99 - iPhone toolchain SDK v2.0.1*=

==Support Leopard & Snow Leopard (MAC OS 10.5.x & 10.6.x) Perfectly.==
==Support iPhone OS v3.x & 4.x==

Please open this link to view detail:  
http://www.sj99.com/toolchain.html

Usually, in order to develop iPhone toolchain applications, the beginners need 
to download several crosslink package and configure many complicated settings, 
it's very hard to config, complie, and link the toolchain successfully in a 
fews days. Almost 99% of the beginners will encounter several problems, and 
more than half them will gave up.

From now on, everything is easy. All you have to do is just buy/download this 
SJ99 iPhone Toolchain SDK, and install it on your Mac computer, only need to 
click the mouse several times.  It's a good news to all of the iPhone toolchain 
developers. 

[http://www.sj99.com/toolchain/TOOLCHAINSDK-en.png]

SJ99 - iPhone Toolchain SDK

Develop and Distribute Toolchain Application, General Flow:

 [http://www.sj99.com/toolchain/flow.jpg] 

SJ99 - iPhone Toolchain SDK, Installation Screen Snap:

[http://www.sj99.com/toolchain/sj99-iphone-toolchain-1.jpg]

After installed successfully, you can found all of the necessary dev-tools is 
ready on your computer:

There are some Demo Apps with source code that you can find them after 
installed the SDK. They are very easy to learn and test on the real iPhone.

For example, If you want to run one of the Demo App: testapp, just step into 
the source code folder, and run command line: $ make

After run make successfully, you can find the new executable program:test was 
created in the same folder.

Now let's run it on the real iPhone, it's very easy: 
1st. Config your iphone WIFI to link your Mac in a same local network, edit the 
iPhone_ip_address config file on your Mac
2nd. Run a simple command line: $ make up
OK, the script will upload the test program file onto your iPhone, and sign it 
automatically.

Example: You can find the executable file:test  in the /tmp folder on your 
iPhone:

Now you can run it by the terminal App on the iPhone:

This is just a very simple demo. You can use this SDK to develop powerful and 
fully functional iPhone applications.
In order to improve the dev efficiency, we recommend developers using Xcode to 
develop the UI and common functions, just leave all of the underlying/bottom 
functions to Toolchain SDK. It's very easy and suitable for the Xcode project 
to link the dylib file which was complied by Toolchain SDK.

The newest v2.1 version now is available. It has been optimized and support all 
of the XCODE versions, all of the iPhone OS versions, and all of the Apple 
iPhone SDK versions. The v2.1 contain more important demo project source code, 
include dylib project and Xcode UI project which can link and call the api that 
was implemented in a dylib library. 

Please open this link to view detail:  
http://www.sj99.com/toolchain.html

Copyright (C) 2010, SJ99.com Innovation for Dev&Art. Email: sj99com@gmail.com

Original comment by SJ99...@gmail.com on 5 Sep 2010 at 2:36