This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/15790] Alignment error building gcc with i686-coff target


------- Additional Comments From wilson at specifixinc dot com  2004-06-08 22:29 -------
Subject: Re:  New: Alignment error building gcc with i686-coff
 target

richard dot parratt at netiq dot com wrote:
> I was trying to build a GCC cross compiler with a target of "i686-coff". 
> It failed with "Error: Alignment not a power of 2"

The problem here is that there is some historical confusion over whether 
the argument to the .align directive is the number of bytes or the log 
of the number of bytes.  Gas changed a few times long ago, and 
eventually settled on using number of bytes for all x86 targets except 
aout and go32.  The gcc i386-coff port defaults to using the log of the 
number of bytes, and hence conflicts with gas.

Hoewver, if gcc is configured right, this shouldn't be a problem.  gcc 
will find the cross assembler, gas, and do a test to determine how to 
emit assembler align directives.  I know of at least 3 ways to get this 
right.
1) Configure gcc and gas in a combined source tree.
2) Configure, build, and install gas using the same prefix as is used 
for gcc, before configuring gcc.
3) Use the --with-as= option when configuring gcc to point at the cross 
assembler.

If you don't do one of these things, then gcc won't build correctly 
anyways, so you actually have to do something wrong to end up with this 
problem.  I noticed that if I configured gcc wrong, and then configured 
it correctly, I ended up with this problem because bad data was read 
from the config.cache file produced by the first configure run.

Anyways, this is easy enough to fix, so I will check in a patch for it.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15790


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