1 Aug 2008 16:37
gen-classlist.sh problem while building gcc 4.2.4
David Eisner <deisner <at> gmail.com>
2008-08-01 14:37:33 GMT
2008-08-01 14:37:33 GMT
Still trying to build gcc-4.2.4 on a Solaris 9 box. During stage 3, I
run into this problem:
cannes [lib]$ make
true
top_builddir=..
top_srcdir=../../../../../../gcc-4.2.4/libjava/classpath /bin/sh
./gen-classlist.sh standard
Adding java source files from srcdir
'../../../../../../gcc-4.2.4/libjava/classpath'.
Adding java source files from VM directory
/export/data/software/cradle/build/gcc/gcc-4.2.4/libjava
Adding java source files from VM directory
/export/data/software/cradle/build/gcc/objdir/sparc-sun-solaris2.9/sparcv9/libjava
./gen-classlist.sh: test: unknown operator -ef
make: *** [genclasses] Error 1
The problem appears to be that the built-in 'test' operator in the
/bin/sh Bourne shell that ships with Solaris 9 doesn't understand the
-ef operator, though bash does:
cannes [lib]$ /bin/sh -c 'test foo -ef bar && echo same'
/bin/sh: test: unknown operator -ef
cannes [lib]$ /usr/bin/bash -c 'test foo -ef bar && echo same'
cannes [lib]$
I couldn't find this in the bug database. Should I report it?
Workaround: in gen-classlist.sh, change
if test ! "${top_builddir}" -ef
(Continue reading)
>> static unsigned long HashDouble(double* pdfVal)
>> {
>> unsigned int* pnValue = (unsigned int*)pdfVal;
>
> You're accessing a variable of type double through a pointer of type
> unsigned int. For the purposes of optimization the compiler is allowed
> to assume that values of type double will only be accessed through
> variables of type double, and thus it can assume that pdfVal and pnValue
> can't refer to the same thing. It may seem nonsensical in this instance
> that it would assume that, but it's still legal for the compiler to do
> so.
> [...]
Thank you very much for in-depth explanation of the problem.
It was greatly helpful.
> If you want to rewrite your code in a conformant way you can use a union
> or memcpy; or you can disable strict aliasing with
RSS Feed