This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Alignment not a power of 2, I can't solve the problem with the old posts found into the discuss group


Hansjörg Petriffer wrote:
> 
> I work with cygwin 1.1.8.
> By making an cross assembler for i386-coff I receive the following error
> message
> _floatdidf
> /tmp/ccKOIPkR.s: Assembler messages:
> /tmp/ccKOIPkR.s:113: Error: Alignment not a power of 2
> make[1]: *** [libgcc2.a] Error 1
> 
> Have anyone an idea what can cause this?

 Whether you didn't seach the CrossGCC-archives or there are selective purging
happening, anyway I found several questions about the same subject and at least
one answer from me to recycle here:

----------------------- clip --------------------------------------------------
     Subject: 
            Re: i386-elf/coff cross build
       Date: 
            Sun, 02 Apr 2000 21:57:46 +0300
      From: 
            Kai Ruottu <karuottu@freenet.hut.fi>
        To: 
            Alagu Sankar <alagu@nettaxi.com>
        CC: 
            crossgcc@sourceware.cygnus.com
 References: 
            1 , 2



Alagu Sankar wrote :

>I am in the process of building cross compiler tools for intel 386 embedded target with a custom
>RTOS.  Has anybody succeded in installing the i[3456]-elf or i[3456]-coff gcc cross compilers
with
>linux or windows(cygwin) host. I'm seeing lot of failure stories in building i386 cross tools in
the
>mailing list
              
>I am using gcc-2.95.2 with newlib-1.8.2.  I am able to build bin utils for i386-coff
successfully. But
>when i try to install gcc i am getting the follwoing errors (I tried with both cygwin and linux
host but
>the result is same).  Any help in solving the problem is very much appreciated.
              
>I did explore to some more extend.  The xgcc compiler generates an assembly file for libgcc2.c
file with >_floatdidf option, which contains a '.align  3' directive and hence the 'alignment not
power of 2' error.
>But i dont understand why the compiler generates this alignment and how to overcome it.

 The bug comes from the difference between 'aout' and 'coff/elf'
assemblers. The 'aout'-one takes the
'.align 3' as "align to 2**3', but the 'coff/elf' ones take it just as
written.

 This is an old problem which surprisingly hasn't been corrected in the
GCC sources. It has been fixed in
those 'system' targets like SCO3.2, but not in the embedded
i386-coff/elf.

 Ok, here is my fix from '98' :

------------------ clip ------------------------
*** i386-coff.bak       Mon Aug 11 18:57:16 1997
--- i386-coff.h Mon Nov 16 22:08:06 1998
***************
*** 93,97 ****
--- 93,100 ----
      fprintf (FILE, "\n");                                             \
    } while (0)
  
+ #undef ASM_OUTPUT_ALIGN
+ #define ASM_OUTPUT_ALIGN(FILE,LOG)    \
+     if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
  
  /* end of i386-coff.h */
------------------ clip ------------------------

Cheers, Kai


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]