Thread: BUG #15132: Build fails in src/backend/utils/adt/encode.c
The following bug has been logged on the website: Bug reference: 15132 Logged by: Stefan Krüger Email address: stadtkind2@gmx.de PostgreSQL version: 10.3 Operating system: Solaris 11.4 Beta Description: Hi, Solaris 11.4 has b64_encode/b64_decode in libc. So building PostgreSQL 10.3 fails because they are defined in src/backend/utils/adt/encode.c as well: gmake[4]: Entering directory '/tmp/postgresql-10.3/src/backend/utils/adt' /opt/developerstudio12.6/bin/cc -Xa -m64 -g -Qoption cg -xregs=no%appl -W2,-xwrap_int -xc99=all -KPIC -DPIC -xmemalign=16s -I../../../../src/include -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -D_XPG6 -c -o encode.o encode.c "encode.c", line 218: identifier redeclared: b64_encode current : static function(pointer to const char, unsigned int, pointer to char) returning unsigned int previous: function(restrict pointer to char, unsigned long, restrict pointer to const void, unsigned long, pointer to const char, unsigned long) returning long : "/usr/include/string.h", line 218 "encode.c", line 265: identifier redeclared: b64_decode current : static function(pointer to const char, unsigned int, pointer to char) returning unsigned int previous: function(pointer to void, unsigned long, pointer to const char, pointer to const char, unsigned long) returning long : "/usr/include/string.h", line 221 cc: acomp failed for encode.c
On 3/28/18 07:57, PG Bug reporting form wrote: > Solaris 11.4 has b64_encode/b64_decode in libc. So building PostgreSQL 10.3 > fails because they are defined in src/backend/utils/adt/encode.c as well: This will be fixed in the next minor release. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
On Wed, Mar 28, 2018 at 08:09:11AM -0400, Peter Eisentraut wrote: > On 3/28/18 07:57, PG Bug reporting form wrote: > > Solaris 11.4 has b64_encode/b64_decode in libc. So building PostgreSQL 10.3 > > fails because they are defined in src/backend/utils/adt/encode.c as well: > > This will be fixed in the next minor release. You are looking for this commit if you are interested (see the thread reference as well): commit: aac6286d8fd17f94f3bce5dd8b942b7fcf9e2a61 author: Tom Lane <tgl@sss.pgh.pa.us> date: Wed, 28 Feb 2018 18:33:45 -0500 Rename base64 routines to avoid conflict with Solaris built-in functions. Solaris 11.4 has built-in functions named b64_encode and b64_decode. Rename ours to something else to avoid the conflict (fortunately, ours are static so the impact is limited). One could wish for less duplication of code in this area, but that would be a larger patch and not very suitable for back-patching. Since this is a portability fix, we want to put it into all supported branches. Report and initial patch by Rainer Orth, reviewed and adjusted a bit by Michael Paquier Discussion: https://postgr.es/m/ydd372wk28h.fsf@CeBiTec.Uni-Bielefeld.DE -- Michael