Garrett D'Amore wrote: > Roland Mainz wrote: [snip] > > The problem doesn't affect you directly. > > The issue is that we need a way to distingish between 32bit and 64bit > > because we merge arch/${platform}/inlcude/ast/ includes from 32bit and > > 64bit builds via "/usr/bin/diff -D<symbol>". The problem is that we > > can't use |_LP64| for <symbol> since the Sun Workshop/Forte/Studio > > compilers do not set |_LP64| (gcc set it, e.g. > > -- snip -- > > $ (touch foo.h; /usr/sfw/bin/cpp -m64 -dM foo.h) | fgrep _LP64 > > #define __LP64__ 1 > > #define _LP64 1 > > -- snip -- > > ) and "injecting" a |#include <sys/isa_defs.h>| will fork() the includes > > in a completely unpredictable manner (I've tried that - the sources > > compile and the code doesn't pass the test suite anymore (and I really > > don't have the time to figure out why it breaks somewhere in the ~~1000 > > source files we have... that's more a job for Mr. Sisyphus)). > > Huh? sys/isa_defs.h should come in via sys/types.h. If you're not > getting sys/types.h, then all bets are off.
Erm, the code which generates the final headers works like this (shell pseudocode): -- snip -- ( print "/* header */" /usr/bin/diff -D<symbol>" 32bitinclude/foo.h 64bitinclude/foo.h ) >${ROOT}/usr/include/ast/foo.h -- snip -- We can't "inject" a "#include <sys/isa_defs.h>" between "header" and the "diff" because this will alter the behaviour of the AST includes (they are not designed to handle this kind of hackery). Right now we use either |__amd64| (on x86) or |__sparcv9| (on SPARC) instead of |_LP64| which I thought that this would be a acceptable compromise. > isa_defs.h gets the _LP64 by looking at __amd64 or __sparcv9. You could > use the same tests, but I would discourage you from doing so. > > Also, looking at Forte, it looks like it defines __x86_64 and __amd64, > so you have options there. (I've not checked the sparc output. Use "cc > -# -xarch=amd64 -E /dev/null" to show the flags passed to the preprocessor. Thanks for the tip... :-) ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.mainz at nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 7950090 (;O/ \/ \O;)