bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: Re: vasnwprintf: Port to older platforms without swprintf
Date: Wed, 22 Mar 2023 14:45:33 +0100	[thread overview]
Message-ID: <61415429.matp6XCIr4@nimes> (raw)
In-Reply-To: <7410120.GJh79HuArf@nimes>

Yesterday I did:
> 	* modules/vasnwprintf (Depends-on): Add mbrtowc. Remove mbsrtowcs.

This causes link errors on AIX 7.1, such as:

xlc -q64 -qthreaded -qtls  -g  -L/home/haible/prefix64/lib -o test-vasnwprintf-posix test-vasnwprintf-posix.o libtests.a ../gllib/libgnu.a libtests.a ../gllib/libgnu.a libtests.a  
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock

Fixed as follows.


2023-03-22  Bruno Haible  <bruno@clisp.org>

	vasnwprintf tests: Fix link errors on AIX.
	* modules/vasnwprintf (Link): New section.
	* modules/vasnwprintf-posix (Link): New section.
	* modules/vasnwprintf-tests (Makefile.am): Link test-vasnwprintf with
	$(MBRTOWC_LIB).
	* modules/vasnwprintf-posix-tests (Makefile.am): Link
	test-vasnwprintf-posix, test-vasnwprintf-posix2, test-vasnwprintf-posix3
	with $(MBRTOWC_LIB).

diff --git a/modules/vasnwprintf b/modules/vasnwprintf
index 91c4ca64ed..82eb83675f 100644
--- a/modules/vasnwprintf
+++ b/modules/vasnwprintf
@@ -50,6 +50,9 @@ lib_SOURCES += asnwprintf.c
 Include:
 "vasnwprintf.h"
 
+Link:
+$(MBRTOWC_LIB)
+
 License:
 LGPLv2+
 
diff --git a/modules/vasnwprintf-posix b/modules/vasnwprintf-posix
index ca14e64866..554efe1707 100644
--- a/modules/vasnwprintf-posix
+++ b/modules/vasnwprintf-posix
@@ -35,6 +35,9 @@ Makefile.am:
 Include:
 "vasnwprintf.h"
 
+Link:
+$(MBRTOWC_LIB)
+
 License:
 LGPLv2+
 
diff --git a/modules/vasnwprintf-posix-tests b/modules/vasnwprintf-posix-tests
index d9729e9dcb..667eb61103 100644
--- a/modules/vasnwprintf-posix-tests
+++ b/modules/vasnwprintf-posix-tests
@@ -28,5 +28,6 @@ Makefile.am:
 TESTS += test-vasnwprintf-posix test-vasnwprintf-posix2.sh test-vasnwprintf-posix3
 TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
 check_PROGRAMS += test-vasnwprintf-posix test-vasnwprintf-posix2 test-vasnwprintf-posix3
-test_vasnwprintf_posix2_LDADD = $(LDADD) $(SETLOCALE_LIB)
-test_vasnwprintf_posix3_LDADD = $(LDADD) $(SETLOCALE_LIB)
+test_vasnwprintf_posix_LDADD = $(LDADD) $(MBRTOWC_LIB)
+test_vasnwprintf_posix2_LDADD = $(LDADD) $(SETLOCALE_LIB) $(MBRTOWC_LIB)
+test_vasnwprintf_posix3_LDADD = $(LDADD) $(SETLOCALE_LIB) $(MBRTOWC_LIB)
diff --git a/modules/vasnwprintf-tests b/modules/vasnwprintf-tests
index 37ed08de56..5eb8a67d0c 100644
--- a/modules/vasnwprintf-tests
+++ b/modules/vasnwprintf-tests
@@ -12,3 +12,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-vasnwprintf
 check_PROGRAMS += test-vasnwprintf
+test_vasnwprintf_LDADD = $(LDADD) $(MBRTOWC_LIB)





  reply	other threads:[~2023-03-22 13:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 18:29 vasnwprintf: Port to older platforms without swprintf Bruno Haible
2023-03-21 16:52 ` Bruno Haible
2023-03-22 13:45   ` Bruno Haible [this message]
2023-03-22 18:42   ` Bruno Haible
2023-03-22 20:28     ` Bruno Haible
2023-03-22 20:34     ` Bruno Haible

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=61415429.matp6XCIr4@nimes \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).