From mboxrd@z Thu Jan 1 00:00:00 1970 From: peter at colberg.org (Peter Colberg) Date: Fri, 1 Jul 2016 21:33:17 -0400 Subject: [PATCH] Link with -ldl on GNU/kFreeBSD In-Reply-To: References: <1466376953-11504-1-git-send-email-peter@colberg.org> Message-ID: <20160702013317.GA13642@alcyone> On Fri, Jul 01, 2016 at 11:56:55PM +0200, Jason A. Donenfeld wrote: > I wonder if a better way would be match the particular libc out of > uname -o. In this case, GNU libc needs -ldl. Do other libcs also need > libdl? Seems like this might be slightly cleaner. In theory one could detect glibc by grepping for specific macros, cc -E -dM -include dlfcn.h -xc /dev/null but in practice other libcs pretend being glibc: https://git.uclibc.org/uClibc/tree/include/features.h /* There is an unwholesomely huge amount of code out there that depends on the * presence of GNU libc header files. We have GNU libc header files. So here * we commit a horrible sin. At this point, we _lie_ and claim to be GNU libc Peter