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

uClibc support #28

Merged
merged 2 commits into from
Mar 9, 2020
Merged

uClibc support #28

merged 2 commits into from
Mar 9, 2020

Conversation

speidy
Copy link

@speidy speidy commented Mar 1, 2020

uClibc doesn't implement the dlinfo() and dladdr1() dl functions.
The existing Android solution fits for the uClibc case as well.

I’ve ran the test program locally when compiling with uClibc toolchain grabbed from: https://toolchains.bootlin.com.

I'll be happy if you can add the uClibc toolchain to the Travis CI system as well.

The usage message was missing open_by_address test case.
@kubo
Copy link
Owner

kubo commented Mar 7, 2020

@speidy
Could you post the environment information you tested on? I failed to set up a uClibc environment to check your pull request.

I have a question.
Why features.h is included? It is a linux-specific header. It prevent compiling on other platforms.

@speidy
Copy link
Author

speidy commented Mar 8, 2020

Hi @kubo,

  1. Regarding #include <features.h> - its redundant. Iv'e omitted this include now.
  2. I've managed to test it in a chrooted environment by using the sysroot directory provided in the toolchain:
    2.1. Download x86_64 uclibc toolchain from the link iv'e provided (iv'e got x86-64-core-i7--uclibc--stable-2018.11-1)
    2.2. Export the toolchain's bin directory containing the gcc compiler to your $PATH. (e.g. export PATH=$PATH:~/toolchains/x86-64-core-i7--uclibc--stable-2018.11-1/bin).
    2.3. Build plthook tests while specifying the new compiler: make CC=x86_64-buildroot-linux-uclibc-gcc
    2.4. Now, change directory to the toolchain' sysroot directory, e.g.: ~/toolchains/x86-64-core-i7--uclibc--stable-2018.11-1/x86_64-buildroot-linux-uclibc/sysroot
    2.5. Now copy testprog to <sysroot>/usr/bin and libtest.so to <sysroot>/usr/lib.
    2.6. Now you also need to mount the procfs (as plthook using it): sudo mount -t proc none <sysroot>/proc
    2.6. now run the test binary under the chrooted sysroot: sudo chroot . ./usr/bin/testprog (run from sysroot directory)

Let me know if that works for you.

uClibc doesn't implement the dlinfo() and dladdr1() dl functions.
The existing Android solution fits for the uClibc case as well.
@kubo kubo merged commit 6cd556e into kubo:master Mar 9, 2020
@kubo
Copy link
Owner

kubo commented Mar 9, 2020

Thanks. I verified your code.
Merged.

@kubo
Copy link
Owner

kubo commented Mar 10, 2020

Tests for uclibc support was added.
0a4c2a1

@speidy
Copy link
Author

speidy commented Mar 10, 2020

Thanks @kubo !

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

Successfully merging this pull request may close these issues.

2 participants