bug-gnulib
[Top][All Lists]
Advanced

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

Re: setlocale: make calls with NULL argument multithread-safe


From: Bruno Haible
Subject: Re: setlocale: make calls with NULL argument multithread-safe
Date: Wed, 01 Jan 2020 16:53:54 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-170-generic; KDE/5.18.0; x86_64; ; )

On 2019-12-18 I wrote:
> Use of setlocale(), with the gnulib override, now requires linking
> with $(LIB_SETLOCALE) - to avoid link errors on AIX.

I see such a link error on AIX:

xlC -q64 -qthreaded -qtls -DHAVE_CONFIG_H -I. -I../../gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-I/home/haible/prefix64/include -D_THREAD_SAFE   -c -o test-locale-c++2.o 
../../gltests/test-locale-c++2.cc
xlC -q64 -qthreaded -qtls    -L/home/haible/prefix64/lib -o test-locale-c++ 
test-locale-c++.o test-locale-c++2.o 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
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
Makefile:3165: recipe for target 'test-locale-c++' failed

This patch fixes it.


2020-01-01  Bruno Haible  <address@hidden>

        locale C++ tests: Fix link error on AIX (regression from 2019-12-18).
        * modules/locale-c++-tests (Makefile.am): Link test-locale-c++ with
        $(LIB_SETLOCALE).

diff --git a/modules/locale-c++-tests b/modules/locale-c++-tests
index 684402d..1b6b7d9 100644
--- a/modules/locale-c++-tests
+++ b/modules/locale-c++-tests
@@ -16,4 +16,5 @@ if ANSICXX
 TESTS += test-locale-c++
 check_PROGRAMS += test-locale-c++
 test_locale_c___SOURCES = test-locale-c++.cc test-locale-c++2.cc
+test_locale_c___LDADD = $(LDADD) $(LIB_SETLOCALE)
 endif




reply via email to

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