On Sat, Apr 30, 2011 at 4:55 AM, Nathan Kunkee nkunkee42@hotmail.com wrote:
On 04/28/11 11:08 AM, Mark Cave-Ayland wrote:
On 28/04/11 13:52, Nathan Kunkee wrote:
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
Great - thanks!
I figured it out!
/bin/sh, the default choice if you just run switch-arch, on OpenSolaris is ksh93, which silently fails on the $...bigendian tests. If I run switch-arch with /usr/xpg4/bin/sh or bash, it works fine and my builds from x86 and sparc are now correct and load. It looks like testing for $KSH_VERSION would be a way to find out if the shell isn't going to work, but I don't know if this would come up enough to warrant adding logic to check it.
Maybe we have a bashism somewhere (should be fixed), or more likely since ksh93 is not fully Posix compatible, we use some Posix features which are not implemented by ksh93 (maybe avoidable). Please send again the output from sh -x for the bigendian test.