[gmp] [powerpc] GMP build is broken because asm {...} syntax has been removed from latest toolchains

Douglas Mencken dougmencken at gmail.com
Sun Oct 21 03:34:18 CEST 2012


I'm getting errors like the following:

dive_1.s:38: Error: junk at end of line, first unrecognized character is `{'
divrem_1.s:101: Error: junk at end of line, first unrecognized character is `{'

That's what segher from GCC team said:

< segher> GMP should really never have used {} in asm
< segher> it's a GCC internal interface, but you can use it in asm()
< dougmencken> looks like now you can't :(
< segher> indeed, since i removed it
< dougmencken> heh, okay
< segher> GCC no longer supports the old POWER cpus, and that assembler syntax
< segher> btw, you might want to use __builtin_clz() instead of asm there
< segher> GCC can optimise that better than asm -- it cannot optimise
asm statements at all really

I'm currently using a group of sed-s on longlong.h to fix that:

sed -i 's/{cntlz|cntlzw}/cntlzw/' ./longlong.h
sed -i 's/{a%I4|add%I4c}/add%I4c/' ./longlong.h
sed -i 's/{a%I5|add%I5c}/add%I5c/' ./longlong.h
sed -i 's/{sf%I3|subf%I3c}/subf%I3c/' ./longlong.h
sed -i 's/{sf%I4|subf%I4c}/subf%I4c/' ./longlong.h
sed -i 's/{aze|addze}/addze/' ./longlong.h
sed -i 's/{ame|addme}/addme/' ./longlong.h
sed -i 's/{ae|adde}/adde/' ./longlong.h
sed -i 's/{sfze|subfze}/subfze/' ./longlong.h
sed -i 's/{sfme|subfme}/subfme/' ./longlong.h
sed -i 's/{sfe|subfe}/subfe/' ./longlong.h

http://ftp.osuosl.org/pub/manulix/scripts/build-scripts/PATCHCMDS/patchcmds-gmp


More information about the gmp-bugs mailing list