browndeer / coprthr

The CO-PRocessing THReads (COPRTHR) SDK - latest release is v1.6.2 (Freewill)
http://www.browndeertechnology.com/coprthr.html
Other
94 stars 35 forks source link

Compilation on 32-bit [Arch] Linux platforms #17

Open sctincman opened 10 years ago

sctincman commented 10 years ago

The system libelf and "legacy" libelf conflict on compilation under Arch Linux. Forcing to compile with just legacy-libelf under 32-bit fails as legacy-libelf does not define Elf32_Xword -- saying in a source file that there is no such thing ({libelf_path}/src/lib/32.size.c). The system libelf on Arch (from elfutils) defines Elf32_Xword as uint64 (same as Elf64_Xword), and this is confirmed in the elf(5) manpage (http://man7.org/linux/man-pages/man5/elf.5.html).

From previous discussions here and looking at the source, it seems Android is currently the only platform that deviates from this definition (please correct me if I'm wrong).

Therefore, perhaps it'd be best to define Elf_Xword as Elf64_Xword for 64 and 32-bit platforms, and have Android cross-compilation typedef Elf64_Xword as Elf32_Word

browndeer commented 10 years ago

Thanks for the info. I will take a look at the patch described in the coprthr app note for android and try to remember why I did things the way I did them. Getting Android ELF to work was tricky. Possibly this additional info will suggest a better solution. The original issues was that I had to patch libelf, I tried half dozen ways around it and none worked.

sctincman wrote:

The system libelf and "legacy" libelf conflict on compilation under Arch Linux. Forcing to compile with just legacy-libelf under 32-bit fails as legacy-libelf does not define Elf32_Xword -- saying in a source file that there is no such thing ({libelf_path}/src/lib/32.size.c). The system libelf on Arch (from elfutils) defines Elf32_Xword as uint64 (same as Elf64_Xword), and this is confirmed in the elf(5) manpage (http://man7.org/linux/man-pages/man5/elf.5.html).

From previous discussions here and looking at the source, it seems Android is currently the only platform that deviates from this definition (please correct me if I'm wrong).

Therefore, perhaps it'd be best to define Elf_Xword as Elf64_Xword for 64 and 32-bit platforms, and have Android cross-compilation typedef Elf64_Xword as Elf32_Word

— Reply to this email directly or view it on GitHub https://github.com/browndeer/coprthr/issues/17.

David Richie, Ph.D. Brown Deer Technology 1641 Denwright Court Forest Hill, MD 21050 410-459-3848 drichie@browndeertechnology.com www.browndeertechnology.com