[U-Boot-Users] [PPCBoot-users] Using gcc-3.4 to compile u-boot on powerpc

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[U-Boot-Users] [PPCBoot-users] Using gcc-3.4 to compile u-boot on powerpc

Murray Jensen
Hi All, a small but important thing... I am using the latest gcc from cvs
(3.4 20030608 (experimental)) and if you build the cross compiler for a
powerpc/linux target, it leaves out the "fixup" stuff for the "-mrelocatable"
command line option. If you then want to use that cross compiler to build
"u-boot", it stuffs up with messages from the Assembler that looks something
like this (on certain C files):

... Error: Relocation cannot be done when using -mrelocatable

Since "-mrelocatable" is usually not used for Linux programs, I can't see why
they did this. Rather than have two different cross compilers, one for linux
and one for "other", which you use to compile u-boot, I chose a simple fix -
patch the file "gcc/config/rs6000/linux.h" as follows:

--- linux.h     2003/06/13 16:41:53     1.3
+++ linux.h     2003/06/20 01:28:53
@@ -84,7 +84,8 @@
 #define TARGET_64BIT 0
 /* We don't need to generate entries in .fixup.  */
+/* well I do need them! */
 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack

Hope this helps someone. Cheers!
Murray Jensen, CSIRO Manufacturing & Infra. Tech.      Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia.         Fax: +61 3 9662 7853
Internet: Murray.Jensen at csiro.au

Hymod project: http://www.msa.cmst.csiro.au/projects/Hymod/

To the extent permitted by law, CSIRO does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained or
that the communication is free of errors, virus, interception or interference.

The information contained in this e-mail may be confidential or privileged.
Any unauthorised use or disclosure is prohibited. If you have received this
e-mail in error, please delete it immediately and notify Murray Jensen on
+61 3 9662 7763. Thank you.

This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
PPCBoot-users mailing list
PPCBoot-users at lists.sourceforge.net