public inbox for gwml@vger.gnuweeb.org
 help / color / mirror / Atom feed
From: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
To: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Cc: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>,
	GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>
Subject: [PATCH gwproxy v2 2/2] configure: Append `-lanl` lib to fix missing `getaddrinfo_a()`
Date: Fri,  1 Aug 2025 05:25:43 +0700	[thread overview]
Message-ID: <20250731222543.303821-3-alviro.iskandar@gnuweeb.org> (raw)
In-Reply-To: <20250731222543.303821-1-alviro.iskandar@gnuweeb.org>

Compiling on GNU CC version 8.5.0 20210514 (Red Hat 8.5.0-26) with
glibc version 2.28 throws this error:

  undefined reference to `getaddrinfo_a'

As such, `getaddrinfo_a()` is never used in that environment eventhough
it's available. Append `-lanl` if on `getaddrinfo_a()` check.

Signed-off-by: Alviro Iskandar Setiawan <alviro.iskandar@gnuweeb.org>
---
 Makefile  | 2 +-
 configure | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index d0d6d85..6c2e9be 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,6 @@ ifndef OPTIMIZE
 	OPTIMIZE = -O2
 endif
 INCLUDE_FLAGS = -I./src/
-LIBS = -lpthread
 DEPFLAGS = -MMD -MP -MF $@.d
 LDFLAGS_SHARED = $(LDFLAGS) -shared
 GWPROXY_DIR = ./src/gwproxy
@@ -80,6 +79,7 @@ config.make: configure
 endif
 endif
 -include config.make
+LIBS=$(LIB_LDFLAGS)
 
 ifeq ($(CONFIG_IO_URING),y)
 	GWPROXY_CC_SOURCES += $(GWPROXY_DIR)/ev/io_uring.c
diff --git a/configure b/configure
index 0b5815d..17bdf6f 100755
--- a/configure
+++ b/configure
@@ -356,20 +356,20 @@ fi;
 
 # ------ Check for getaddrinfo_a() ------
 cat > $tmp_c << EOF
-#define _GNU_SOURCE
 #include <netdb.h>
 int main(void)
 {
 	struct sigevent ev;
-	struct gaicb gc;
+	struct gaicb *gc = (void *)0;
 	getaddrinfo_a(GAI_NOWAIT, &gc, 1, &ev);
 	return 0;
 }
 EOF
 l="Do we have getaddrinfo_a()?";
-if compile_cc "" "" "getaddrinfo_a()"; then
+if compile_cc "" "-lanl" "getaddrinfo_a()"; then
 	add_config "CONFIG_HAVE_GETADDRINFO_A";
 	print_supp "yes" "${l}";
+	LIB_LDFLAGS="${LIB_LDFLAGS} -lanl";
 else
 	print_supp "no" "${l}";
 fi;
-- 
Alviro Iskandar Setiawan


  parent reply	other threads:[~2025-07-31 22:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31 22:25 [PATCH gwproxy v2 0/2] Fixes for older glibc version Alviro Iskandar Setiawan
2025-07-31 22:25 ` [PATCH gwproxy v2 1/2] log: Fix missing `gettid()` syscall on " Alviro Iskandar Setiawan
2025-07-31 22:25 ` Alviro Iskandar Setiawan [this message]
2025-07-31 22:32 ` [PATCH gwproxy v2 0/2] Fixes for " Ammar Faizi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250731222543.303821-3-alviro.iskandar@gnuweeb.org \
    --to=alviro.iskandar@gnuweeb.org \
    --cc=ammarfaizi2@gnuweeb.org \
    --cc=gwml@vger.gnuweeb.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox