From 8eeb5150ed99914e252a84f1637f179e3de04659 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Fri, 5 Apr 2019 18:55:24 +0200 Subject: QDnsLookup: fix "Resolver functions not found" error on FreeBSD The current code only tries to load the required functions from LIBRESOLV_SO (if defined) and resolv, but on FreeBSD they are in libc: https://www.freebsd.org/cgi/man.cgi?query=res_query&sektion=3&apropos=0&manpath=freebsd This commit changes the code so that, after failing to load the non-existent libraries, it attempts to load the functions with dlsym() using the special handle RTLD_DEFAULT, which searches for the specified symbol in the loaded libraries. Task-number: QTBUG-74844 Change-Id: If97aaae233cabbfa01c30d26d9a7fb01ec3ff5c2 Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- src/network/kernel/kernel.pri | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/network/kernel/kernel.pri') diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri index 11b80d59d5..d7a92a12eb 100644 --- a/src/network/kernel/kernel.pri +++ b/src/network/kernel/kernel.pri @@ -38,7 +38,11 @@ qtConfig(dnslookup) { } unix { - !integrity:qtConfig(dnslookup): SOURCES += kernel/qdnslookup_unix.cpp + !integrity:qtConfig(dnslookup) { + SOURCES += kernel/qdnslookup_unix.cpp + qtConfig(dlopen): QMAKE_USE_PRIVATE += libdl + } + SOURCES += kernel/qhostinfo_unix.cpp qtConfig(linux-netlink): SOURCES += kernel/qnetworkinterface_linux.cpp -- cgit v1.2.3 From e199710d0ea804e4481042f41b91b5234540f5d5 Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Sat, 6 Apr 2019 08:01:11 +0200 Subject: QHostInfo: use dlsym() with RTLD_DEFAULT in case libs cannot be loaded The current code only tries to load the required functions from LIBRESOLV_SO (if defined) and resolv, but on FreeBSD they are in libc: https://www.freebsd.org/cgi/man.cgi?query=res_query&sektion=3&apropos=0&manpath=freebsd This commit changes the code so that, after failing to load the non-existent libraries, it attempts to load the functions with dlsym() using the special handle RTLD_DEFAULT, which searches for the specified symbol in the loaded libraries. This is a follow-up to 8eeb5150ed99914e252a84f1637f179e3de04659. Change-Id: I19d90b0ca8703398bf4f5f4edd5ae31e346ef251 Reviewed-by: Thiago Macieira --- src/network/kernel/kernel.pri | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/network/kernel/kernel.pri') diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri index d7a92a12eb..7074fcd5eb 100644 --- a/src/network/kernel/kernel.pri +++ b/src/network/kernel/kernel.pri @@ -38,13 +38,12 @@ qtConfig(dnslookup) { } unix { - !integrity:qtConfig(dnslookup) { - SOURCES += kernel/qdnslookup_unix.cpp - qtConfig(dlopen): QMAKE_USE_PRIVATE += libdl - } + !integrity:qtConfig(dnslookup): SOURCES += kernel/qdnslookup_unix.cpp SOURCES += kernel/qhostinfo_unix.cpp + qtConfig(dlopen): QMAKE_USE_PRIVATE += libdl + qtConfig(linux-netlink): SOURCES += kernel/qnetworkinterface_linux.cpp else: SOURCES += kernel/qnetworkinterface_unix.cpp } -- cgit v1.2.3