building arm-elf with newlib

AKubbat AKubbat@necelam.com
Wed Jun 30 21:54:00 GMT 2004



On Fri, 25 Jun 2004 14:36:26 -0700  Daniel Kegel <dank@kegel.com> wrote:

> AKubbat wrote:
> > I have tried to build arm-elf cross-compiler and use Bills Gatliff's
> > script and the following components to build a version of ARM-ELF
> > (using newlib) :
> > BINUTILSDISTO=binutils-2.15
> > GCCDISTO=gcc-2.95.3
> > NEWLIBDISTO=newlib-1.11.0
> > 
> > Host : Redhat 9, i686, latest patches.
> > Host   gcc version 3.3.2, 
> > 
> > ...
> > /tmp/ccEugNg3.s: Assembler messages:
> > /tmp/ccEugNg3.s:889: Error: junk at end of line, first unrecognized
> > character is `,'
> 
> This sounds similar to a known issue in binutils-2.15.
> Does the following patch help?
> 
> http://www.kegel.com/crosstool/crosstool-0.28-rc25/patches/binutils-2.15/binutils-skip-comments.patch
> 
> - Dan

Hello again,

Finally I've solved it and here is the explanation / solution :


ARM-ELF Crosscompiler build with binutils 2.14 and older issued a warning
when building GCC whenever `@` occured at the wrong place in the ASM code
With binutils2.15 that was changed to be an error and not a warning. Thus
the compilation failed with a message like :

/tmp/ccEugNg3.s: Assembler messages:
/tmp/ccEugNg3.s:889: Error: junk at end of line, first unrecognized character is `,'
   
REASON :
   
        .section .gnu.linkonce.t.__tf9type_info,"ax",@progbits
                                                    ^^^^
The `@` is the comment symbol for ARM assembler. So the line expands to
"[...], <nothing>",   The , at the end causes the error and arm-elf-as
complains and stops the compilation process


To fix this, GCC must not use `@` but `%` instead when targeting ARM.
The place to patch is in gcc-2.95.3/gcc/config/arm/unknown-elf.h



Thanks for your support

Andreas
   
============================================
  
--- gcc-2.95.3-core/gcc/config/arm/unknown-elf.h	1999-04-09 06:07:56.000000000 -0700
+++ ./unknown-elf.h	2004-06-30 11:51:16.000000000 -0700
@@ -100,7 +100,7 @@
 #define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC) \
 do {								\
   if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL)		\
-    fprintf (STREAM, "\t.section %s,\"ax\",@progbits\n", (NAME)); \
+    fprintf (STREAM, "\t.section %s,\"ax\",%%progbits\n", (NAME)); \
   else if ((DECL) && DECL_READONLY_SECTION (DECL, RELOC))	\
     fprintf (STREAM, "\t.section %s,\"a\"\n", (NAME));		\
   else								\


==
Andreas 

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list