Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sctincman opened this issue May 28, 2014 · 1 comment
Open

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

sctincman opened this issue May 28, 2014 · 1 comment

Comments

@sctincman
Copy link

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
Copy link
Owner

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
#17.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants