From: jca Date: Fri, 17 Dec 2021 12:03:16 +0000 (+0000) Subject: Declare pthread_atfork as weak to avoid a fatal error with LLVM 13 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0b9027416dbe2d075117c785c315d9663c8d8c6f;p=openbsd Declare pthread_atfork as weak to avoid a fatal error with LLVM 13 Fixes behavior with current clang, which marks the symbol as GLOBAL instead of WEAK. LLVM change: https://reviews.llvm.org/D90108 base-gcc is unaffected. Keep asm(".weak") for gcc3 until a cleanup can be tested there. Initial diff from mortimer@, input and ok kettenis@, ok guenther@ --- diff --git a/lib/csu/crtbeginS.c b/lib/csu/crtbeginS.c index a4a7cd19fce..cfaf7e40609 100644 --- a/lib/csu/crtbeginS.c +++ b/lib/csu/crtbeginS.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crtbeginS.c,v 1.20 2019/01/09 16:42:38 visa Exp $ */ +/* $OpenBSD: crtbeginS.c,v 1.21 2021/12/17 12:03:16 jca Exp $ */ /* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */ /* @@ -83,6 +83,8 @@ asm(".hidden atexit"); */ int _thread_atfork(void (*)(void), void (*)(void), void (*)(void), void *) __attribute__((weak)); +int pthread_atfork(void (*)(void), void (*)(void), void (*)(void)) + __attribute__((weak)); int pthread_atfork(void (*prep)(void), void (*parent)(void), void (*child)(void))