It is not a toolchain issue here. In H5detect.c:ALIGNMENT, a testing to
mis-aligned access is performed, as below,
*((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/
\
_val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/
\
and SIGBUS and SIGSEGV is handled. However, on ARM, at least in thumb2, SIGILL
is generated. This can be verified by this small case,
int main()
{
char c[20];
int i =0; float f;
for (i = 0; i < 4; i++)
{
printf ("address is %x\n", (unsigned int) &c[i]);
f = *((float*) &c[i]);
}
return 0;
}
$ gcc align.c -o align
$ ./align
address is be8ebc20
address is be8ebc21
Illegal instruction
However, everything is OK with -march=armv5t,
$ gcc -march=armv5t align.c -o align
$ ./align
address is bedfbc20
address is bedfbc21
address is bedfbc22
address is bedfbc23
To fix this problem here, we may can either modify source code of hdf5
to handle SIGILL, or change kernel to use SIGBUS for unalinged access
instead of SIGILL (http://www.spinics.net/lists/arm-
kernel/msg93601.html).
--
[armel] the ./H5detect test segfaults when built for armv7
https://bugs.launchpad.net/bugs/635199
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs