This patch is necessary to make PolyML work on FreeBSD x86_64, because the elf.h header in FreeBSD is missing a typecast that exists in the corresponding header file on Linux. Without this patch the compiled polyml immediately segfaults on FreeBSD x86_64. This issue also affects other *BSD systems (e.g. NetBSD/amd64). It should not do any harm to simply include this cast as in the patch unconditionally.
Regards, Imre Vadasz
--- libpolyml/elfexport.h.orig Tue Sep 11 16:27:04 2007 +++ libpolyml/elfexport.h Sat Jan 26 22:33:22 2013 @@ -37,7 +37,7 @@ #define ElfXX_Sym Elf64_Sym #define ElfXX_Ehdr Elf64_Ehdr #define ElfXX_Shdr Elf64_Shdr -#define ELFXX_R_INFO(_y, _z) ELF64_R_INFO(_y, _z) +#define ELFXX_R_INFO(_y, _z) ELF64_R_INFO((Elf64_Xword)(_y), _z) #define ELFXX_ST_INFO(_y, _z) ELF64_ST_INFO(_y, _z) #define ELFCLASSXX ELFCLASS64 #else
On 08/02/2013 00:13, Imre Vadasz wrote:
This patch is necessary to make PolyML work on FreeBSD x86_64, because the elf.h header in FreeBSD is missing a typecast that exists in the corresponding header file on Linux. Without this patch the compiled polyml immediately segfaults on FreeBSD x86_64. This issue also affects other *BSD systems (e.g. NetBSD/amd64). It should not do any harm to simply include this cast as in the patch unconditionally.
Regards, Imre Vadasz
Thanks, I've included it in SVN trunk. I may backport it to fixes-5.5 in due course.
Regards, David