* [PATCH] Link with -ldl on GNU/kFreeBSD
@ 2016-06-19 22:55 peter
2016-07-01 21:56 ` Jason
2016-07-02 1:50 ` peter
0 siblings, 2 replies; 7+ messages in thread
From: peter @ 2016-06-19 22:55 UTC (permalink / raw)
GNU/kFreeBSD uses the FreeBSD kernel with the GNU C library.
---
cgit.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cgit.mk b/cgit.mk
index 369f309..35e40dc 100644
--- a/cgit.mk
+++ b/cgit.mk
@@ -54,7 +54,7 @@ endif
endif
# Add -ldl to linker flags on non-BSD systems.
-ifeq ($(findstring BSD,$(uname_S)),)
+ifeq (,$(filter $(uname_S),DragonFly FreeBSD NetBSD OpenBSD))
CGIT_LIBS += -ldl
endif
--
2.8.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Link with -ldl on GNU/kFreeBSD
2016-06-19 22:55 [PATCH] Link with -ldl on GNU/kFreeBSD peter
@ 2016-07-01 21:56 ` Jason
2016-07-02 1:33 ` peter
2016-07-02 1:50 ` peter
1 sibling, 1 reply; 7+ messages in thread
From: Jason @ 2016-07-01 21:56 UTC (permalink / raw)
Hey Peter,
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.
Any opinions on this list?
Jason
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Link with -ldl on GNU/kFreeBSD
2016-07-01 21:56 ` Jason
@ 2016-07-02 1:33 ` peter
0 siblings, 0 replies; 7+ messages in thread
From: peter @ 2016-07-02 1:33 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Link with -ldl on GNU/kFreeBSD
2016-06-19 22:55 [PATCH] Link with -ldl on GNU/kFreeBSD peter
2016-07-01 21:56 ` Jason
@ 2016-07-02 1:50 ` peter
2016-07-02 2:00 ` [PATCH v2] " peter
1 sibling, 1 reply; 7+ messages in thread
From: peter @ 2016-07-02 1:50 UTC (permalink / raw)
On Sun, Jun 19, 2016 at 06:55:53PM -0400, Peter Colberg wrote:
> +ifeq (,$(filter $(uname_S),DragonFly FreeBSD NetBSD OpenBSD))
> CGIT_LIBS += -ldl
> endif
LuaJIT adds -ldl for specific OSes, which seems a better choice:
https://github.com/LuaJIT/LuaJIT/blob/master/src/Makefile
ifeq (Linux,$(TARGET_SYS))
TARGET_XLIBS+= -ldl
endif
ifeq (GNU/kFreeBSD,$(TARGET_SYS))
TARGET_XLIBS+= -ldl
endif
I will post a revised patch.
Peter
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] Link with -ldl on GNU/kFreeBSD
2016-07-02 1:50 ` peter
@ 2016-07-02 2:00 ` peter
2016-07-06 21:30 ` peter
0 siblings, 1 reply; 7+ messages in thread
From: peter @ 2016-07-02 2:00 UTC (permalink / raw)
GNU/kFreeBSD uses the FreeBSD kernel with the GNU C library.
Signed-off-by: Peter Colberg <peter at colberg.org>
---
cgit.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cgit.mk b/cgit.mk
index 369f309..8d4f5e0 100644
--- a/cgit.mk
+++ b/cgit.mk
@@ -53,8 +53,8 @@ endif
endif
-# Add -ldl to linker flags on non-BSD systems.
-ifeq ($(findstring BSD,$(uname_S)),)
+# Add -ldl to linker flags on systems that commonly use GNU libc.
+ifneq (,$(filter $(uname_S),Linux GNU/kFreeBSD))
CGIT_LIBS += -ldl
endif
--
2.8.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] Link with -ldl on GNU/kFreeBSD
2016-07-02 2:00 ` [PATCH v2] " peter
@ 2016-07-06 21:30 ` peter
2016-07-06 21:57 ` Jason
0 siblings, 1 reply; 7+ messages in thread
From: peter @ 2016-07-06 21:30 UTC (permalink / raw)
On Fri, Jul 01, 2016 at 10:00:37PM -0400, Peter Colberg wrote:
> GNU/kFreeBSD uses the FreeBSD kernel with the GNU C library.
>
> Signed-off-by: Peter Colberg <peter at colberg.org>
> ---
> cgit.mk | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cgit.mk b/cgit.mk
> index 369f309..8d4f5e0 100644
> --- a/cgit.mk
> +++ b/cgit.mk
> @@ -53,8 +53,8 @@ endif
>
> endif
>
> -# Add -ldl to linker flags on non-BSD systems.
> -ifeq ($(findstring BSD,$(uname_S)),)
> +# Add -ldl to linker flags on systems that commonly use GNU libc.
> +ifneq (,$(filter $(uname_S),Linux GNU/kFreeBSD))
> CGIT_LIBS += -ldl
> endif
>
> --
> 2.8.1
>
Any objections to merging this? While it is not a perfect solution,
it is better than the status quo and allows Debian to drop a patch.
Peter
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] Link with -ldl on GNU/kFreeBSD
2016-07-06 21:30 ` peter
@ 2016-07-06 21:57 ` Jason
0 siblings, 0 replies; 7+ messages in thread
From: Jason @ 2016-07-06 21:57 UTC (permalink / raw)
Seems like a more sensible approach. I'll merge this and see if
anybody complains.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-07-06 21:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-19 22:55 [PATCH] Link with -ldl on GNU/kFreeBSD peter
2016-07-01 21:56 ` Jason
2016-07-02 1:33 ` peter
2016-07-02 1:50 ` peter
2016-07-02 2:00 ` [PATCH v2] " peter
2016-07-06 21:30 ` peter
2016-07-06 21:57 ` Jason
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).