Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
112 user(s) are online (73 user(s) are browsing Forums)

Members: 1
Guests: 111

imagodespira, more...

Headlines

 
  Register To Post  

Cross compilation first steps
Just popping in
Just popping in


See User information
Hello,

I had setup the SDK for cross compiling in my Debian machine (following Joachim Birging's and Nicolas Mendoza's guides) and want to give it a try, but need some help. Practically I'm starting from zero.

So, after getting the source code I'm interested, first thing would be to see what dependencies it has, right? The best way for that would be looking in the makefile or cmakelists if there aren't available in other place?

If those dependencies are available for AmigaOS4.x, where should I put them?

I think that is enough for a start Thanks for any help.

PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.17
Amiga 1200 BPPC/BVision AOS4.1 FE
Go to top
Re: Cross compilation first steps
Quite a regular
Quite a regular


See User information
@emeck

Much like with native SDK: under sdk/local
For example /usr/local/amiga/ppc-amigaos/sdk/local/newlib/lib/libtiff.a

So for much the same reason you put your own additions to debian but also to the SDK, into a dir named local.

Did your hello world work?

Go to top
Re: Cross compilation first steps
Just popping in
Just popping in


See User information
@Thematic

Quote:

Thematic wrote:
Much like with native SDK: under sdk/local
For example /usr/local/amiga/ppc-amigaos/sdk/local/newlib/lib/libtiff.a

Thanks, got that.

Quote:

Did your hello world work?

Yes, I think. An executable was created and no warnings nor errors showed in the console. Don't have a working AOS4.x machine now , so I'll also need to find a willing betatester.

PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.17
Amiga 1200 BPPC/BVision AOS4.1 FE
Go to top
Re: Cross compilation first steps
Just popping in
Just popping in


See User information
@emeck

Ok, next issue.

The C "Hello World" test program compiled without errors and worked in an AOS4.x machine (thanks for testing Thematic). But the C++ "Hello World" test throws many undefined references, like:
/home/zerohero/svn/gcc-build/ppc-amigaos/libstdc++-v3/libsupc++/../../../../adtools-gcc-4.4.2/libstdc++-v3/libsupc++/vterminate.cc:80: undefined reference to `_Unwind_SjLj_Resume'

I have libsupc++ and libstdc++ in /usr/local/amiga/lib/gcc/ppc-amigaos/4.4.3/newlib/lib/ and /usr/local/amiga/lib/gcc/ppc-amigaos/4.4.3/clib2/lib/ in my SDK tree.

How can I fix that problem? Did I missed something?

PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.17
Amiga 1200 BPPC/BVision AOS4.1 FE
Go to top
Re: Cross compilation first steps
Just popping in
Just popping in


See User information
@emeck

4.4.3 is broken, use 4.2.4 instead.


Edited by diegocr on 2010/8/7 12:25:39
Go to top
Re: Cross compilation first steps
Just popping in
Just popping in


See User information
@diegocr

Quote:
4.4.3 is broken, use 4.2.4 instead.


Tried that, but still the same. I'll do it again from scratch; maybe I missed a step.

PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.17
Amiga 1200 BPPC/BVision AOS4.1 FE
Go to top
Re: Cross compilation first steps
Amigans Defender
Amigans Defender


See User information
@emeck

you have to link the exe with -lgcc_eh with 4.4.4

i'm really tired...
Go to top
Re: Cross compilation first steps
Just popping in
Just popping in


See User information
@afxgroup

This works for statically linkage, as suggested by Trev at UtilityBase:

ppc-amigaos-g++ -o hello++ hello++.cpp -lstdc++ -lgcc_eh

But for dinamic linkage I now get

/usr/local/amiga/lib/gcc/ppc-amigaos/4.2.4/../../../../ppc-amigaos/bin/ld: hellocpp: hidden symbol `__gtdf2' in /usr/local/amiga/lib/gcc/ppc-amigaos/4.2.4/libgcc.a(_gt_df.o) is referenced by DSO
/usr/local/amiga/lib/gcc/ppc-amigaos/4.2.4/../../../../ppc-amigaos/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status

using

ppc-amigaos-g++ -use-dynld -o hellocpp hello.cpp

or

ppc-amigaos-g++ -use-dynld -o hellocpp hello.cpp -lstdc++ -lgcc

PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.17
Amiga 1200 BPPC/BVision AOS4.1 FE
Go to top
Re: Cross compilation first steps
Just popping in
Just popping in


See User information
@emeck

Did you compile the cross compilers yourself or did you take precompiled binaries? There were some changes in the mean time, so it would be important to know whether you are using the most recent version of gcc of the 4.2.4 and 4.4.4 branch. Any gcc 4.4.3 is definitively obsolete.

The gcc 4.4.4 branch can be found in the branches directory of the adtools project (http://www.sf.net/projects/adtools). The gcc 4.2.4 branch is trunk at the moment. There is also a file with instructions how to compile a cross compiler (improvements to this file are very welcome). Questions regarding the process should be directed to the adtools mailing list.

After you compiled the cross compiler yourself and the problem persists, please supply a full basic example with Makefile that demonstrates the problem and post it as a bug in the adtools tracker. Thanks!

Go to top
Re: Cross compilation first steps
Just popping in
Just popping in


See User information
@sba

Quote:
Did you compile the cross compilers yourself or did you take precompiled binaries?

No, I downloaded Joachim Birging's x86_64 version.

Quote:
The gcc 4.4.4 branch can be found in the branches directory of the adtools project (http://www.sf.net/projects/adtools). The gcc 4.2.4 branch is trunk at the moment. There is also a file with instructions how to compile a cross compiler (improvements to this file are very welcome). Questions regarding the process should be directed to the adtools mailing list.

Thanks, I'll give it a try then.

PowerBook 5.2 MorphOS 3.15
PowerBook 5.8 MorphOS 3.17
Amiga 1200 BPPC/BVision AOS4.1 FE
Go to top
Re: Cross compilation first steps
Amigans Defender
Amigans Defender


See User information
@emeck

with 4.2.4 (and reading your post, it seems so) you should not use -lgcc_eh.
I think you have mixed 4.4.4 and 4.2.4 library.. try to restart from scratch using only 4.2.4 (or 4.4.4) and avid to mix compiler stuff.
I've compiled both 4.2.4 and 4.4.4 from adtools projects and they works very well on MacOSX x86

i'm really tired...
Go to top
Re: Cross compilation first steps
Just popping in
Just popping in


See User information
Yesterday i've compiled the adtools trunk to get V2 sobjs sup, and hundred of compiler warnings apart (on the first steps only, regarding some gcc macro iirc), the only issue i've noticed is that the libs libstdc++ libsupc++ libssp etc are now placed into a different directory than on the zh cross-compiler.

Trunk: /usr/local/amiga/ppc-amigaos/lib

ZH: /usr/local/amiga/lib/gcc/ppc-amigaos/4.2.4/newlib/lib

However, the new compiler still seems to look for the libs at the zh path, so i just created symlinks.

I've compiled a .so before noticing that and it was linked without using libgcc.so (and reporting no errors), then tried to compile a C++ program (statically linked) and noticed the mixed libs due i get the same undefined references to sjlj functions...

but still using the right libs, i was forced to specify -lgcc_eh (thx afxgroup ;), otherwise it does not link. It's really like that for the last trunk or i might have something wrong somewhere?

Anyhow, despite those little "issues", I really recommend everybody to build his own cross-compiler, it's really easy, well...it compiles OOTB! (great job adtools guys)

Go to top
Re: Cross compilation first steps
Home away from home
Home away from home


See User information
@afxgroup
Quote:
you have to link the exe with -lgcc_eh with 4.4.4

I know this was a looong time ago, but many thanks for this tip. Not sure I would have been able to solve my problem without this obscure solution.

Author of the PortablE programming language.
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project