------- Additional Comments From Michael dot Abshoff at googlemail dot com 2008-07-14 17:52 ------- (In reply to comment #4) > Subject: Re: division doesn't work on solaris/x86 > > Hi Clint,
[My first journey into the world of binutils, so please be gentle :)] Hi Clint, Alan, Nick, > > You are saying there is no way to do division in integer expressions with > > gas on > > solaris, even though it works on all other OSes? Isn't that less than > > ideal? > > Actually Alan was saying that you should look at the assembler source > file gas/app.c and see how you can modify it to interpret "\/" as a > division operator and not a comment. > > Cheers > Nick > I hit the problem Clint reported when building his project (ATLAS 3.8.1+Errata applied specifically) on Solaris 10/Intel with compiled from vanilla sources binutils 2.18. The solution is exposed when looking at gas/config/tc-i386.c: [quote] #if (defined (TE_I386AIX) \ || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \ && !defined (TE_GNU) \ && !defined (TE_LINUX) \ && !defined (TE_NETWARE) \ && !defined (TE_FreeBSD) \ && !defined (TE_NetBSD))) /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful. The option --divide will remove '/' from this list. */ const char *i386_comment_chars = "#/"; [Remove the "/" here ] #define SVR4_COMMENT_CHARS 1 #define PREFIX_SEPARATOR '\\' #else const char *i386_comment_chars = "#"; #define PREFIX_SEPARATOR '/' #endif [end quote] There are two solutions: a) Brute force, i.e. remove "/" as indicated above or b) add '-Wa,--divide' to the CFLAGS of ATLAS as suggested by the comments in the source code (a) worked on my Solaris 10 box, i.e. it build ATLAS and the rest of Sage, but (b) seems like a much better solution since most people don't build their custom binutils ;). I have not tried it yet, but on Solaris 10 on Intel (b) ought to work universally since Sun's version of gas is from binutils 2.15 and the issue you hit was allegedly introduced between 2.13 and 2.15 - see http://osdir.com/ml/gnu.binutils.bugs/2005-02/msg00054.html for that statement I have not verified. I attempted to build binutils 2.13 and 2.14 on Solaris 10 and it did not work, so this workaround (b) ought to work on all Intel Solaris 10 boxen. Since I could not get any gcc to build using Sun's as it also seems pretty save to me, but caution ought to be applied. Clint: I will file a bug report against ATLAS in case you do not respond to this ticket in the next couple days. Cheers, Michael -- http://sourceware.org/bugzilla/show_bug.cgi?id=4572 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils