pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Incorporate strerror_r() into src/port/snprintf.c, too.
5+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2018-09-26 a6b88d682c  Fix link failures due to snprintf/strerror changes.
* pgsql: Incorporate strerror_r() into src/port/snprintf.c, too.
@ 2018-09-26 16:36 Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 18:04 ` Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2018-09-26 16:36 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Incorporate strerror_r() into src/port/snprintf.c, too.

This provides the features that used to exist in useful_strerror()
for users of strerror_r(), too.  Also, standardize on the GNU convention
that strerror_r returns a char pointer that may not be NULL.

I notice that libpq's win32.c contains a variant version of strerror_r
that probably ought to be folded into strerror.c.  But lacking a
Windows environment, I should leave that to somebody else.

Discussion: https://postgr.es/m/2975.1526862605@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/758ce9b7794845f95473c569155d29fcf0e2751b

Modified Files
--------------
src/include/port.h                       |  7 ++-
src/interfaces/libpq/fe-auth.c           |  6 +--
src/interfaces/libpq/fe-connect.c        | 18 +++----
src/interfaces/libpq/fe-lobj.c           | 14 +++---
src/interfaces/libpq/fe-misc.c           |  2 +-
src/interfaces/libpq/fe-secure-openssl.c | 12 ++---
src/interfaces/libpq/fe-secure.c         |  4 +-
src/interfaces/libpq/libpq-int.h         |  2 +-
src/port/strerror.c                      | 85 +++++++++++++++++++++++---------
src/port/thread.c                        | 27 ----------
src/test/thread/thread_test.c            |  5 +-
11 files changed, 99 insertions(+), 83 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too.
  2018-09-26 16:36 pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Tom Lane <tgl@sss.pgh.pa.us>
@ 2018-09-26 18:04 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  2018-09-26 20:28   ` Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Peter Eisentraut @ 2018-09-26 18:04 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-committers@lists.postgresql.org

On 26/09/2018 18:36, Tom Lane wrote:
> Incorporate strerror_r() into src/port/snprintf.c, too.
> 
> This provides the features that used to exist in useful_strerror()
> for users of strerror_r(), too.  Also, standardize on the GNU convention
> that strerror_r returns a char pointer that may not be NULL.

Somehow, this is not working for me:

Undefined symbols for architecture x86_64:
  "_libintl_gettext", referenced from:
      _pg_strerror_r in strerror.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[4]: *** [../../../../src/Makefile.shlib:303: libpgtypes.3.12.dylib]
Error 1

It works if I don't use --enable-nls.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too.
  2018-09-26 16:36 pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 18:04 ` Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
@ 2018-09-26 20:28   ` Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 20:49     ` Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2018-09-26 20:28 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: pgsql-committers@lists.postgresql.org

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> Somehow, this is not working for me:

> Undefined symbols for architecture x86_64:
>   "_libintl_gettext", referenced from:
>       _pg_strerror_r in strerror.o
> ld: symbol(s) not found for architecture x86_64
> collect2: error: ld returned 1 exit status
> make[4]: *** [../../../../src/Makefile.shlib:303: libpgtypes.3.12.dylib]
> Error 1

> It works if I don't use --enable-nls.

More context please?  I'm guessing this is on macOS?  Where did you get
libintl from?  Is it, as it looks, getting through libpq and failing in
ecpg?

My first bet would be that ecpg for some reason lacks needed NLS
infrastructure ... have we ever tried to internationalize it?
Right now might not be the best time to try --- perhaps the path
of least resistance is to defeat strerror.c's NLS support when
it's being compiled in ecpg.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too.
  2018-09-26 16:36 pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 18:04 ` Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  2018-09-26 20:28   ` Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Tom Lane <tgl@sss.pgh.pa.us>
@ 2018-09-26 20:49     ` Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-27 12:08       ` Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2018-09-26 20:49 UTC (permalink / raw)
  To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: pgsql-committers@lists.postgresql.org

I wrote:
> My first bet would be that ecpg for some reason lacks needed NLS
> infrastructure ... have we ever tried to internationalize it?

Oh, I see the problem: for some reason pgtypeslib fails to pull in
-lintl, unlike its siblings.  Please try that again.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too.
  2018-09-26 16:36 pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 18:04 ` Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  2018-09-26 20:28   ` Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Tom Lane <tgl@sss.pgh.pa.us>
  2018-09-26 20:49     ` Re: pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Tom Lane <tgl@sss.pgh.pa.us>
@ 2018-09-27 12:08       ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Peter Eisentraut @ 2018-09-27 12:08 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org

On 26/09/2018 22:49, Tom Lane wrote:
> I wrote:
>> My first bet would be that ecpg for some reason lacks needed NLS
>> infrastructure ... have we ever tried to internationalize it?
> 
> Oh, I see the problem: for some reason pgtypeslib fails to pull in
> -lintl, unlike its siblings.  Please try that again.

Works now, thanks.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-09-27 12:08 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26 16:36 pgsql: Incorporate strerror_r() into src/port/snprintf.c, too. Tom Lane <tgl@sss.pgh.pa.us>
2018-09-26 18:04 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2018-09-26 20:28   ` Tom Lane <tgl@sss.pgh.pa.us>
2018-09-26 20:49     ` Tom Lane <tgl@sss.pgh.pa.us>
2018-09-27 12:08       ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox