Fix the build issue under ia64. Close bug #5715

Thanks to Luca Falavigna for the help and most of the patch.