bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vasnwprintf: Port to older platforms without swprintf


From: Bruno Haible
Subject: Re: vasnwprintf: Port to older platforms without swprintf
Date: Wed, 22 Mar 2023 14:45:33 +0100

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 via email to

[Prev in Thread] Current Thread [Next in Thread]