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

Kai Ruottu
Thu Mar 22 03:31:00 GMT 2001

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 --------------------------------------------------
            Re: i386-elf/coff cross build
            Sun, 02 Apr 2000 21:57:46 +0300
            Kai Ruottu <>
            Alagu Sankar <>
            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
>linux or windows(cygwin) host. I'm seeing lot of failure stories in building i386 cross tools in
>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

 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

 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)
+     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,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list