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

Use uClibc to build libressl will get error: uClibc on noMMU doesn't provide __register_atfork() #538

Closed
redbirdtek opened this issue Jul 1, 2019 · 7 comments

Comments

@redbirdtek
Copy link

#ifdef GLIBC
extern void __dso_handle;
extern int __register_atfork(void (
)(void), void()(void), void ()(void), void *);
#define _ARC4_ATFORK(f) __register_atfork(NULL, NULL, (f), __dso_handle)
#else
#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
#endif

@kinichiro
Copy link
Contributor

kinichiro commented Jul 1, 2019 via email

@redbirdtek
Copy link
Author

I found same kind of issue. https://gitlab.freedesktop.org/ffontaine/libbsd/commit/1220b3b758030f1717558980d60ade9a33628383 Using pthread_atfork would solve this with uClibc on noMMU ?

Yes, code-building pass if use pthread_atfork,hope someone can fix this issue in the master branch.

@kinichiro
Copy link
Contributor

Does this arc4random_linux.h patch work for you with uClibc ?
And regression tests succeed ?

--- crypto/compat/arc4random_linux.h.orig	Mon Jul  1 20:23:38 2019
+++ crypto/compat/arc4random_linux.h	Mon Jul  1 20:25:37 2019
@@ -32,7 +32,7 @@ static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_
 #define _ARC4_LOCK()   pthread_mutex_lock(&arc4random_mtx)
 #define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
 
-#ifdef __GLIBC__
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
 extern void *__dso_handle;
 extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void *);
 #define _ARC4_ATFORK(f) __register_atfork(NULL, NULL, (f), __dso_handle)

I had tested this diff by travis-ci here, to verify before send this to upstream.
To test in travis-ci, I put this diff as patches/arc4random_linux.h.patch.
https://travis-ci.org/kinichiro/portable/builds/552726084

@busterb
Copy link
Contributor

busterb commented Jul 9, 2019

That works fine for me. I think we intended for arc4random_linux.h to be able to work without any autoconf help since it lives upstream in the openbsd source, or I might have suggested a symbol check in the configuration phase instead.

@kinichiro
Copy link
Contributor

kinichiro commented Jul 9, 2019 via email

@busterb
Copy link
Contributor

busterb commented Jul 9, 2019

Sounds like the right thing to do. That'll fixup any other users as well on uclibc.

bob-beck pushed a commit to openbsd/src that referenced this issue Jul 11, 2019
uClibc on noMMU doesn't provide __register_atfork().
Reported by redbirdtek on Github issue.
libressl/portable#538

ok bcook@
busterb pushed a commit to libressl/openbsd that referenced this issue Jul 12, 2019
uClibc on noMMU doesn't provide __register_atfork().
Reported by redbirdtek on Github issue.
libressl/portable#538

ok bcook@
@kinichiro
Copy link
Contributor

@redbirdtek
commit libressl/openbsd@8fa1a42 fixes this issue.
I'll close this issue.

cjeker pushed a commit to openbgpd-portable/openbgpd-openbsd that referenced this issue Jul 30, 2019
uClibc on noMMU doesn't provide __register_atfork().
Reported by redbirdtek on Github issue.
libressl/portable#538

ok bcook@
cjeker pushed a commit to openbgpd-portable/openbgpd-openbsd that referenced this issue Oct 2, 2019
uClibc on noMMU doesn't provide __register_atfork().
Reported by redbirdtek on Github issue.
libressl/portable#538

ok bcook@
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

3 participants