diff options
Diffstat (limited to 'libpq')
33 files changed, 273 insertions, 521 deletions
diff --git a/libpq/.gitignore b/libpq/.gitignore index 4c4fec7..d4a1da2 100644 --- a/libpq/.gitignore +++ b/libpq/.gitignore @@ -3,11 +3,17 @@ *.d *.t *.i +*.i.* *.ii +*.ii.* *.o *.obj +*.gcm +*.pcm +*.ifc *.so *.so.* +*.dylib *.dll *.a *.lib diff --git a/libpq/README-DEV b/libpq/README-DEV index 5d7f717..6ccf1cc 100644 --- a/libpq/README-DEV +++ b/libpq/README-DEV @@ -4,8 +4,8 @@ understanding will be useful when upgrading to a new upstream version. See The upstream package builds the common and ports static libraries and links them to the libpq library. These static libraries are generic enough to fit -all the binaries built by the package. We will build libpq selecting only the -required static libraries source files, relying on the linker diagnostics +all the binaries built by the package. We will build libpq by only selecting +the required static libraries source files, relying on the linker diagnostics (unresolved symbol errors, etc). Symlink the required upstream components and provide our own implementations @@ -19,33 +19,31 @@ directory prefixes. $ ln -s ../../upstream/src/interfaces/libpq libpq/pq -Note that while we could symlink the upstream's top source directories, this -would potentially bloat the distribution, uglify the buildfile, and complicate -pg_config.h change tracking on upgrade (see below). Thus, we selectively -symlink only the required files. - -$ mkdir libpq/mb -$ ln -s ../../../upstream/src/backend/utils/mb/{encnames,wchar}.c libpq/mb +Note that symlinking all the upstream's top source directories is a bad idea +since this would potentially bloat the distribution, uglify the buildfile, and +complicate pg_config.h change tracking on upgrade (see below). Also note that +some of the source files are shared with the psql package and this sharing +doesn't align with such an approach. Thus, we selectively symlink only the +required files. $ mkdir -p libpq/include/libpq libpq/include/mb libpq/include/port $ ln -s ../../../upstream/src/include/{c,getaddrinfo,pg_config_manual,port,postgres_ext,postgres_fe}.h libpq/include +$ ln -s ../../../upstream/src/include/common libpq/include $ ln -s ../../../../upstream/src/include/libpq/{libpq-fs,pqcomm}.h libpq/include/libpq $ ln -s ../../../../upstream/src/include/mb/pg_wchar.h libpq/include/mb $ ln -s ../../../../upstream/src/include/port/{linux,freebsd,darwin,win32,win32_port,pg_bswap}.h libpq/include/port $ ln -s ../../../../upstream/src/include/port/{win32,win32_msvc} libpq/include/port $ mkdir libpq/common -$ ln -s ../../../upstream/src/common/{md5,scram-common,ip,sha2_openssl,link-canary,base64,saslprep,unicode_norm}.c \ - libpq/common +$ ln -s ../../../upstream/src/common/{base64,cryptohash_openssl,encnames,hmac_openssl,ip,link-canary,md5,md5_common,saslprep,scram-common,string,unicode_norm,wchar}.c libpq/common +$ ln -s ../../../upstream/src/common/md5_int.h libpq/common $ mkdir libpq/port -$ ln -s ../../../upstream/src/port/{pgstrcasecmp,snprintf,getpeereid,pg_strong_random,thread,strerror,chklocale,noblock,inet_net_ntop,strlcpy,win32setlocale,getaddrinfo,open,inet_aton,pgsleep,win32error,system}.c libpq/port +$ ln -s ../../../upstream/src/port/{chklocale,explicit_bzero,getaddrinfo,getpeereid,gettimeofday,inet_aton,inet_net_ntop,noblock,open,pg_strong_random,pgsleep,pgstrcasecmp,snprintf,strerror,strlcpy,system,thread,win32error,win32setlocale,win32stat}.c libpq/port $ ln -s ../../../upstream/src/port/pthread-win32.h libpq/port $ ln -s ../../upstream/src/include/pg_config_ext.h.in libpq/pg_config_ext.h.in.orig -$ ln -s ../../upstream/src/include/pg_config_ext.h.win32 libpq/pg_config_ext.h.win32.orig $ ln -s ../../upstream/src/include/pg_config.h.in libpq/pg_config.h.in.orig -$ ln -s ../../upstream/src/include/pg_config.h.win32 libpq/pg_config.h.win32.orig $ ln -s ../../../upstream/src/interfaces/libpq/test/uri-regress.c tests/conninfo @@ -58,10 +56,10 @@ a new upstream version would be a real pain. Instead we can only (un)define the newly introduced macros, comparing the already defined and currently used macro sets: -$ for m in `cat libpq/pg_config.h.in.orig libpq/pg_config.h.win32.orig | \ +$ for m in `cat libpq/pg_config.h.in.orig | \ sed -n 's/^.*#\s*\(define\|undef\)\s\{1,\}\([_A-Z0-9]\{1,\}\)\(\s.*\)\{0,1\}$/\2/p' | \ sort -u`; do - if grep -q -e "\b$m\b" `find -L . -name '*.h' -a ! -name 'pg_config.h' -o -name '*.c'`; then + if grep -q -e "\b$m\b" `find -L . ../psql -name '*.h' -a ! -name 'pg_config.h' -o -name '*.c'`; then echo "$m" fi done >used-macros @@ -71,7 +69,3 @@ $ cat libpq/pg_config.h | \ sort -u >defined-macros $ diff defined-macros used-macros - -Copy upstream's auto-generated src/interfaces/libpq/{exports.list,libpqdll.def} -to libpq/{libpqdll.map,libpqdll.def} or create them manually based on -pq/exports.txt. Comment out the "LIBRARY LIBPQ" line in libpqdll.def. diff --git a/libpq/build/bootstrap.build b/libpq/build/bootstrap.build index 378e284..4219553 100644 --- a/libpq/build/bootstrap.build +++ b/libpq/build/bootstrap.build @@ -30,10 +30,10 @@ using install # been for the several last major version releases). And so_minor is equal to # the package major version. # -if ($version.major == 12 && $version.minor == 1) +if ($version.major == 14 && $version.minor == 1) { abi_major = 5 - abi_minor = 12 + abi_minor = 14 } else fail "increment the ABI version?" diff --git a/libpq/build/export.build b/libpq/build/export.build index bb54707..6c8c87c 100644 --- a/libpq/build/export.build +++ b/libpq/build/export.build @@ -6,4 +6,4 @@ $out_root/ include libpq/ } -export $out_root/libpq/lib{pq} +export $out_root/libpq/$import.target diff --git a/libpq/buildfile b/libpq/buildfile index a013a31..c1d9e0e 100644 --- a/libpq/buildfile +++ b/libpq/buildfile @@ -1,7 +1,7 @@ # file : buildfile -# license : PostgreSQL Licene; see accompanying COPYRIGHT file +# license : PostgreSQL License; see accompanying COPYRIGHT file -./: {*/ -build/} doc{COPYRIGHT INSTALL README} manifest +./: {*/ -build/} doc{INSTALL README} legal{COPYRIGHT} manifest # Don't install tests or the INSTALL file. # diff --git a/libpq/libpq/.gitattributes b/libpq/libpq/.gitattributes new file mode 100644 index 0000000..05ef788 --- /dev/null +++ b/libpq/libpq/.gitattributes @@ -0,0 +1 @@ +pq symlink=dir diff --git a/libpq/libpq/.gitignore b/libpq/libpq/.gitignore index 620b4c8..5db6a52 100644 --- a/libpq/libpq/.gitignore +++ b/libpq/libpq/.gitignore @@ -1,3 +1,8 @@ # Generated version.h. # version.h + +# Generated symbols export files. +# +libpqdll.map +libpqdll.def diff --git a/libpq/libpq/buildfile b/libpq/libpq/buildfile index bf7f844..94fa06b 100644 --- a/libpq/libpq/buildfile +++ b/libpq/libpq/buildfile @@ -1,25 +1,30 @@ # file : libpq/buildfile -# license : PostgreSQL Licene; see accompanying COPYRIGHT file +# license : PostgreSQL License; see accompanying COPYRIGHT file +define map: file +map{*}: extension = map + +# Note that libz is only used in the backend server. +# import imp_libs = libssl%lib{ssl} import imp_libs += libcrypto%lib{crypto} # Exclude source code of unused features (authentication methods, etc). # -# @@ When it becomes possible (probably with ad hoc rules), generate -# libpqdll.map and libpqdll.def on the fly from pq/exports.txt applying -# regex replace to its lines and adding prologue/epilogue. -# -lib{pq}: {h }{* -version} \ - {h }{ version} \ - pq/{h c}{* -fe-gssapi-common -fe-secure-gssapi -*win32*} \ - mb/{ c}{* } \ - port/{h c}{* -strlcpy -getaddrinfo -inet_aton -*win32*} \ - common/{ c}{* } \ - include/{h }{** } \ - {def }{libpqdll } \ - pq/{file}{pg_service.conf.sample } \ - $imp_libs +lib{pq}: {h }{* -version} \ + {h }{ version} \ + pq/{h c}{* -fe-gssapi-common \ + -fe-secure-gssapi \ + -*win32*} \ + port/{h c}{* -explicit_bzero \ + -getaddrinfo \ + -gettimeofday \ + -inet_aton \ + -strlcpy \ + -*win32*} \ + common/{h c}{* } \ + include/{h }{** } \ + pq/{file}{pg_service.conf.sample} tclass = $c.target.class tsys = $c.target.system @@ -29,12 +34,49 @@ bsd = ($tclass == 'bsd') macos = ($tclass == 'macos') windows = ($tclass == 'windows') -lib{pq}: file{libpqdll.map}: include = ($linux || $bsd ? adhoc : false) -lib{pq}: port/c{strlcpy}: include = (!$bsd && !$macos) +# Note that upstream also uses native explicit_bzero() on Linux for glibc +# versions equal or greater than 2.25. It's, however, not easy to check the +# glibc's version in the buildfile, so we always fallback to the custom +# explicit_bzero() implementation on Linux. +# +# Also note that linking the native explicit_bzero() would prevent us running +# against older glibc versions. +# +lib{pq}: port/c{explicit_bzero}: include = (!$bsd) +lib{pq}: port/c{gettimeofday}: include = ($tsys == 'win32-msvc') + +# Note that we never compile port/strlcpy.c directly but rather conditionally +# include it from our strlcpy.c if HAVE_DECL_STRLCAT is 0 (see +# libpq/pg_config.h for the macro definition). +# +lib{pq}: port/c{strlcpy}: include = adhoc +lib{pq}: c{strlcpy}: include = (!$bsd && !$macos) lib{pq}: pq/{h c}{*win32* } \ port/{h c}{*win32* +getaddrinfo +inet_aton}: include = $windows +lib{pq}: $imp_libs + +libs{pq}: map{libpqdll}: include = ($linux || $bsd ? adhoc : false) +libs{pq}: def{libpqdll}: include = $windows + +map{libpqdll}: pq/file{exports.txt} +{{ + diag gen $> + f = $path($>) + echo '{ global:' >$f + sed -n -e 's/^\s*([^#]\S*)\s+\d+\s*$/\1;/p' $path($<) >>$f + echo ' local: *; };' >>$f +}} + +def{libpqdll}: pq/file{exports.txt} +{{ + diag gen $> + f = $path($>) + echo 'EXPORTS' >$f + sed -n -e 's/^\s*([^#]\S*)\s+(\d+)\s*$/ \1 @ \2/p' $path($<) >>$f +}} + # The version file is an internal one (it is only included from pg_config.h) # so we don't distribute nor install it (see below). # @@ -48,14 +90,7 @@ h{version}: in{version} $src_root/manifest # c.poptions += -DFRONTEND -DUNSAFE_STAT_OK -DSO_MAJOR_VERSION=$abi_major -if! $windows - # Note that the upstream package uses the -pthread compiler/linker option. - # The option is unsupported by build2 so we pass -D_REENTRANT and -lpthread - # preprocessor/linker options instead. We also omit -D_THREAD_SAFE (synonym - # for -D_REENTRANT) and Solaris-specific -D_POSIX_PTHREAD_SEMANTICS. - # - c.poptions += -D_REENTRANT -else +if $windows # Note that the upstream package defines the WIN32 macro for VC only, # relying on the fact that MinGW GCC defines it by default. However, the # macro disappears from the default ones if to compile with -std=c9x (as we @@ -80,7 +115,7 @@ switch $tclass, $tsys case 'windows', 'mingw32' { - c.poptions += -DBUILDING_DLL -DEXEC_BACKEND + c.poptions += -DBUILDING_DLL c.poptions =+ "-I$src_base/include/port/win32" } case 'windows' @@ -88,7 +123,7 @@ switch $tclass, $tsys # Probably some of the *WIN* macro definitions are not really required, # but let's keep all of them for good measure. # - c.poptions += -DEXEC_BACKEND -D_WINDLL -D__WINDOWS__ -D__WIN32__ -D_MBCS \ + c.poptions += -D_WINDLL -D__WINDOWS__ -D__WIN32__ -D_MBCS \ -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE c.poptions =+ "-I$src_base/include/port/win32_msvc" \ @@ -156,7 +191,9 @@ switch $c.class # way that works across compilers/version (some -Wno-* options are only # recognized in newer versions). # - c.coptions += -Wno-all -Wno-extra + # @@ TMP: try to re-enable on next release. + # + c.coptions += -Wno-all -Wno-extra -Wno-deprecated-declarations } case 'msvc' { @@ -197,13 +234,13 @@ switch $tclass, $tsys # c.loptions += -Wl,--no-undefined - c.loptions += "-Wl,--version-script=$src_base/libpqdll.map" + c.loptions += "-Wl,--version-script=$out_base/libpqdll.map" - c.libs += -lpthread + c.libs += -pthread } default - c.libs += -lpthread + c.libs += -pthread } # Export options. diff --git a/libpq/libpq/common/cryptohash_openssl.c b/libpq/libpq/common/cryptohash_openssl.c new file mode 120000 index 0000000..8a03d82 --- /dev/null +++ b/libpq/libpq/common/cryptohash_openssl.c @@ -0,0 +1 @@ +../../../upstream/src/common/cryptohash_openssl.c
\ No newline at end of file diff --git a/libpq/libpq/common/encnames.c b/libpq/libpq/common/encnames.c new file mode 120000 index 0000000..36b2bb4 --- /dev/null +++ b/libpq/libpq/common/encnames.c @@ -0,0 +1 @@ +../../../upstream/src/common/encnames.c
\ No newline at end of file diff --git a/libpq/libpq/common/hmac_openssl.c b/libpq/libpq/common/hmac_openssl.c new file mode 120000 index 0000000..70fd6d7 --- /dev/null +++ b/libpq/libpq/common/hmac_openssl.c @@ -0,0 +1 @@ +../../../upstream/src/common/hmac_openssl.c
\ No newline at end of file diff --git a/libpq/libpq/common/md5_common.c b/libpq/libpq/common/md5_common.c new file mode 120000 index 0000000..4ceb269 --- /dev/null +++ b/libpq/libpq/common/md5_common.c @@ -0,0 +1 @@ +../../../upstream/src/common/md5_common.c
\ No newline at end of file diff --git a/libpq/libpq/common/md5_int.h b/libpq/libpq/common/md5_int.h new file mode 120000 index 0000000..24576cb --- /dev/null +++ b/libpq/libpq/common/md5_int.h @@ -0,0 +1 @@ +../../../upstream/src/common/md5_int.h
\ No newline at end of file diff --git a/libpq/libpq/common/sha2_openssl.c b/libpq/libpq/common/sha2_openssl.c deleted file mode 120000 index 4d52df2..0000000 --- a/libpq/libpq/common/sha2_openssl.c +++ /dev/null @@ -1 +0,0 @@ -../../../upstream/src/common/sha2_openssl.c
\ No newline at end of file diff --git a/libpq/libpq/common/string.c b/libpq/libpq/common/string.c new file mode 120000 index 0000000..1887054 --- /dev/null +++ b/libpq/libpq/common/string.c @@ -0,0 +1 @@ +../../../upstream/src/common/string.c
\ No newline at end of file diff --git a/libpq/libpq/common/wchar.c b/libpq/libpq/common/wchar.c new file mode 120000 index 0000000..e929657 --- /dev/null +++ b/libpq/libpq/common/wchar.c @@ -0,0 +1 @@ +../../../upstream/src/common/wchar.c
\ No newline at end of file diff --git a/libpq/libpq/include/.gitattributes b/libpq/libpq/include/.gitattributes new file mode 100644 index 0000000..8cb5c4f --- /dev/null +++ b/libpq/libpq/include/.gitattributes @@ -0,0 +1 @@ +common symlink=dir diff --git a/libpq/libpq/include/port/.gitattributes b/libpq/libpq/include/port/.gitattributes new file mode 100644 index 0000000..2ba6a7e --- /dev/null +++ b/libpq/libpq/include/port/.gitattributes @@ -0,0 +1,2 @@ +win32 symlink=dir +win32_msvc symlink=dir diff --git a/libpq/libpq/libpqdll.def b/libpq/libpq/libpqdll.def deleted file mode 100644 index eb2d1c7..0000000 --- a/libpq/libpq/libpqdll.def +++ /dev/null @@ -1,178 +0,0 @@ -;LIBRARY LIBPQ -EXPORTS - PQconnectdb @ 1 - PQsetdbLogin @ 2 - PQconndefaults @ 3 - PQfinish @ 4 - PQreset @ 5 - PQrequestCancel @ 6 - PQdb @ 7 - PQuser @ 8 - PQpass @ 9 - PQhost @ 10 - PQport @ 11 - PQtty @ 12 - PQoptions @ 13 - PQstatus @ 14 - PQerrorMessage @ 15 - PQsocket @ 16 - PQbackendPID @ 17 - PQtrace @ 18 - PQuntrace @ 19 - PQsetNoticeProcessor @ 20 - PQexec @ 21 - PQnotifies @ 22 - PQsendQuery @ 23 - PQgetResult @ 24 - PQisBusy @ 25 - PQconsumeInput @ 26 - PQgetline @ 27 - PQputline @ 28 - PQgetlineAsync @ 29 - PQputnbytes @ 30 - PQendcopy @ 31 - PQfn @ 32 - PQresultStatus @ 33 - PQntuples @ 34 - PQnfields @ 35 - PQbinaryTuples @ 36 - PQfname @ 37 - PQfnumber @ 38 - PQftype @ 39 - PQfsize @ 40 - PQfmod @ 41 - PQcmdStatus @ 42 - PQoidStatus @ 43 - PQcmdTuples @ 44 - PQgetvalue @ 45 - PQgetlength @ 46 - PQgetisnull @ 47 - PQclear @ 48 - PQmakeEmptyPGresult @ 49 - PQprint @ 50 - PQdisplayTuples @ 51 - PQprintTuples @ 52 - lo_open @ 53 - lo_close @ 54 - lo_read @ 55 - lo_write @ 56 - lo_lseek @ 57 - lo_creat @ 58 - lo_tell @ 59 - lo_unlink @ 60 - lo_import @ 61 - lo_export @ 62 - pgresStatus @ 63 - PQmblen @ 64 - PQresultErrorMessage @ 65 - PQresStatus @ 66 - termPQExpBuffer @ 67 - appendPQExpBufferChar @ 68 - initPQExpBuffer @ 69 - resetPQExpBuffer @ 70 - PQoidValue @ 71 - PQclientEncoding @ 72 - PQenv2encoding @ 73 - appendBinaryPQExpBuffer @ 74 - appendPQExpBufferStr @ 75 - destroyPQExpBuffer @ 76 - createPQExpBuffer @ 77 - PQconninfoFree @ 78 - PQconnectPoll @ 79 - PQconnectStart @ 80 - PQflush @ 81 - PQisnonblocking @ 82 - PQresetPoll @ 83 - PQresetStart @ 84 - PQsetClientEncoding @ 85 - PQsetnonblocking @ 86 - PQfreeNotify @ 87 - PQescapeString @ 88 - PQescapeBytea @ 89 - printfPQExpBuffer @ 90 - appendPQExpBuffer @ 91 - pg_encoding_to_char @ 92 - pg_utf_mblen @ 93 - PQunescapeBytea @ 94 - PQfreemem @ 95 - PQtransactionStatus @ 96 - PQparameterStatus @ 97 - PQprotocolVersion @ 98 - PQsetErrorVerbosity @ 99 - PQsetNoticeReceiver @ 100 - PQexecParams @ 101 - PQsendQueryParams @ 102 - PQputCopyData @ 103 - PQputCopyEnd @ 104 - PQgetCopyData @ 105 - PQresultErrorField @ 106 - PQftable @ 107 - PQftablecol @ 108 - PQfformat @ 109 - PQexecPrepared @ 110 - PQsendQueryPrepared @ 111 - PQdsplen @ 112 - PQserverVersion @ 113 - PQgetssl @ 114 - pg_char_to_encoding @ 115 - pg_valid_server_encoding @ 116 - pqsignal @ 117 - PQprepare @ 118 - PQsendPrepare @ 119 - PQgetCancel @ 120 - PQfreeCancel @ 121 - PQcancel @ 122 - lo_create @ 123 - PQinitSSL @ 124 - PQregisterThreadLock @ 125 - PQescapeStringConn @ 126 - PQescapeByteaConn @ 127 - PQencryptPassword @ 128 - PQisthreadsafe @ 129 - enlargePQExpBuffer @ 130 - PQnparams @ 131 - PQparamtype @ 132 - PQdescribePrepared @ 133 - PQdescribePortal @ 134 - PQsendDescribePrepared @ 135 - PQsendDescribePortal @ 136 - lo_truncate @ 137 - PQconnectionUsedPassword @ 138 - pg_valid_server_encoding_id @ 139 - PQconnectionNeedsPassword @ 140 - lo_import_with_oid @ 141 - PQcopyResult @ 142 - PQsetResultAttrs @ 143 - PQsetvalue @ 144 - PQresultAlloc @ 145 - PQregisterEventProc @ 146 - PQinstanceData @ 147 - PQsetInstanceData @ 148 - PQresultInstanceData @ 149 - PQresultSetInstanceData @ 150 - PQfireResultCreateEvents @ 151 - PQconninfoParse @ 152 - PQinitOpenSSL @ 153 - PQescapeLiteral @ 154 - PQescapeIdentifier @ 155 - PQconnectdbParams @ 156 - PQconnectStartParams @ 157 - PQping @ 158 - PQpingParams @ 159 - PQlibVersion @ 160 - PQsetSingleRowMode @ 161 - lo_lseek64 @ 162 - lo_tell64 @ 163 - lo_truncate64 @ 164 - PQconninfo @ 165 - PQsslInUse @ 166 - PQsslStruct @ 167 - PQsslAttributeNames @ 168 - PQsslAttribute @ 169 - PQsetErrorContextVisibility @ 170 - PQresultVerboseErrorMessage @ 171 - PQencryptPasswordConn @ 172 - PQresultMemorySize @ 173 - PQhostaddr @ 174 - PQgssEncInUse @ 175 - PQgetgssctx @ 176 diff --git a/libpq/libpq/libpqdll.map b/libpq/libpq/libpqdll.map deleted file mode 100644 index 893dc86..0000000 --- a/libpq/libpq/libpqdll.map +++ /dev/null @@ -1,178 +0,0 @@ -{ global: -PQconnectdb; -PQsetdbLogin; -PQconndefaults; -PQfinish; -PQreset; -PQrequestCancel; -PQdb; -PQuser; -PQpass; -PQhost; -PQport; -PQtty; -PQoptions; -PQstatus; -PQerrorMessage; -PQsocket; -PQbackendPID; -PQtrace; -PQuntrace; -PQsetNoticeProcessor; -PQexec; -PQnotifies; -PQsendQuery; -PQgetResult; -PQisBusy; -PQconsumeInput; -PQgetline; -PQputline; -PQgetlineAsync; -PQputnbytes; -PQendcopy; -PQfn; -PQresultStatus; -PQntuples; -PQnfields; -PQbinaryTuples; -PQfname; -PQfnumber; -PQftype; -PQfsize; -PQfmod; -PQcmdStatus; -PQoidStatus; -PQcmdTuples; -PQgetvalue; -PQgetlength; -PQgetisnull; -PQclear; -PQmakeEmptyPGresult; -PQprint; -PQdisplayTuples; -PQprintTuples; -lo_open; -lo_close; -lo_read; -lo_write; -lo_lseek; -lo_creat; -lo_tell; -lo_unlink; -lo_import; -lo_export; -pgresStatus; -PQmblen; -PQresultErrorMessage; -PQresStatus; -termPQExpBuffer; -appendPQExpBufferChar; -initPQExpBuffer; -resetPQExpBuffer; -PQoidValue; -PQclientEncoding; -PQenv2encoding; -appendBinaryPQExpBuffer; -appendPQExpBufferStr; -destroyPQExpBuffer; -createPQExpBuffer; -PQconninfoFree; -PQconnectPoll; -PQconnectStart; -PQflush; -PQisnonblocking; -PQresetPoll; -PQresetStart; -PQsetClientEncoding; -PQsetnonblocking; -PQfreeNotify; -PQescapeString; -PQescapeBytea; -printfPQExpBuffer; -appendPQExpBuffer; -pg_encoding_to_char; -pg_utf_mblen; -PQunescapeBytea; -PQfreemem; -PQtransactionStatus; -PQparameterStatus; -PQprotocolVersion; -PQsetErrorVerbosity; -PQsetNoticeReceiver; -PQexecParams; -PQsendQueryParams; -PQputCopyData; -PQputCopyEnd; -PQgetCopyData; -PQresultErrorField; -PQftable; -PQftablecol; -PQfformat; -PQexecPrepared; -PQsendQueryPrepared; -PQdsplen; -PQserverVersion; -PQgetssl; -pg_char_to_encoding; -pg_valid_server_encoding; -pqsignal; -PQprepare; -PQsendPrepare; -PQgetCancel; -PQfreeCancel; -PQcancel; -lo_create; -PQinitSSL; -PQregisterThreadLock; -PQescapeStringConn; -PQescapeByteaConn; -PQencryptPassword; -PQisthreadsafe; -enlargePQExpBuffer; -PQnparams; -PQparamtype; -PQdescribePrepared; -PQdescribePortal; -PQsendDescribePrepared; -PQsendDescribePortal; -lo_truncate; -PQconnectionUsedPassword; -pg_valid_server_encoding_id; -PQconnectionNeedsPassword; -lo_import_with_oid; -PQcopyResult; -PQsetResultAttrs; -PQsetvalue; -PQresultAlloc; -PQregisterEventProc; -PQinstanceData; -PQsetInstanceData; -PQresultInstanceData; -PQresultSetInstanceData; -PQfireResultCreateEvents; -PQconninfoParse; -PQinitOpenSSL; -PQescapeLiteral; -PQescapeIdentifier; -PQconnectdbParams; -PQconnectStartParams; -PQping; -PQpingParams; -PQlibVersion; -PQsetSingleRowMode; -lo_lseek64; -lo_tell64; -lo_truncate64; -PQconninfo; -PQsslInUse; -PQsslStruct; -PQsslAttributeNames; -PQsslAttribute; -PQsetErrorContextVisibility; -PQresultVerboseErrorMessage; -PQencryptPasswordConn; -PQresultMemorySize; -PQhostaddr; -PQgssEncInUse; -PQgetgssctx; - local: *; }; diff --git a/libpq/libpq/mb/encnames.c b/libpq/libpq/mb/encnames.c deleted file mode 120000 index c4e83b6..0000000 --- a/libpq/libpq/mb/encnames.c +++ /dev/null @@ -1 +0,0 @@ -../../../upstream/src/backend/utils/mb/encnames.c
\ No newline at end of file diff --git a/libpq/libpq/mb/wchar.c b/libpq/libpq/mb/wchar.c deleted file mode 120000 index fdacab3..0000000 --- a/libpq/libpq/mb/wchar.c +++ /dev/null @@ -1 +0,0 @@ -../../../upstream/src/backend/utils/mb/wchar.c
\ No newline at end of file diff --git a/libpq/libpq/pg_config.h b/libpq/libpq/pg_config.h index fcea042..e0e61ad 100644 --- a/libpq/libpq/pg_config.h +++ b/libpq/libpq/pg_config.h @@ -3,8 +3,8 @@ */ /* - * For the semantics of the following macros refer to pg_config.h.in.orig, - * pg_config.h.win32.orig, and the upstream's configure.in. + * For the semantics of the following macros refer to pg_config.h.in.orig and + * the upstream's configure.in. * * Note that we will explicitly undefine macros that are present in the libpq * source code but should not be defined. While this is not technically @@ -15,14 +15,23 @@ #include <stddef.h> /* offsetof() */ +#if defined(__linux__) +# include <features.h> /* __GLIBC__, __GLIBC_MINOR__ */ +#endif + #include <openssl/opensslv.h> /* OPENSSL_VERSION_NUMBER */ +#define PACKAGE_NAME "PostgreSQL" +#define PACKAGE_URL "https://www.postgresql.org/" +#define PACKAGE_BUGREPORT "pgsql-bugs@lists.postgresql.org" + /* * Version. */ #undef PG_VERSION #undef PG_VERSION_NUM #undef PG_MAJORVERSION +#undef PG_VERSION_STR #include <libpq/version.h> /* @@ -71,47 +80,71 @@ */ #ifndef _WIN32 # if __SIZEOF_LONG__ == 8 -# define HAVE_LONG_INT_64 1 +# define HAVE_LONG_INT_64 1 # endif # ifdef __SIZEOF_LONG_LONG__ -# define HAVE_LONG_LONG_INT 1 +# define HAVE_LONG_LONG_INT 1 # endif # if __SIZEOF_LONG_LONG__ == 8 -# define HAVE_LONG_LONG_INT_64 1 +# define HAVE_LONG_LONG_INT_64 1 # endif # if __SIZEOF_LONG_LONG__ > __SIZEOF_DOUBLE__ -# define MAXIMUM_ALIGNOF __SIZEOF_LONG_LONG__ +# define MAXIMUM_ALIGNOF __SIZEOF_LONG_LONG__ # else -# define MAXIMUM_ALIGNOF __SIZEOF_DOUBLE__ +# define MAXIMUM_ALIGNOF __SIZEOF_DOUBLE__ # endif # ifdef __SIZEOF_INT128__ # define PG_INT128_TYPE __int128 # define ALIGNOF_PG_INT128_TYPE 16 # endif -# define PG_INT64_TYPE __INT64_TYPE__ -# define ACCEPT_TYPE_ARG3 socklen_t -# define SIZEOF_SIZE_T __SIZEOF_SIZE_T__ +# define PG_INT64_TYPE __INT64_TYPE__ +# define ACCEPT_TYPE_ARG3 socklen_t +# define SIZEOF_SIZE_T __SIZEOF_SIZE_T__ +# define SIZEOF_VOID_P __SIZEOF_POINTER__ #else -# define HAVE_LONG_LONG_INT 1 -# define HAVE_LONG_LONG_INT_64 1 -# define MAXIMUM_ALIGNOF 8 -# define PG_INT64_TYPE long long int -# define ACCEPT_TYPE_ARG3 int +# define HAVE_LONG_LONG_INT 1 +# define HAVE_LONG_LONG_INT_64 1 +# define MAXIMUM_ALIGNOF 8 +# define PG_INT64_TYPE long long int +# define ACCEPT_TYPE_ARG3 int # ifdef _WIN64 -# define SIZEOF_SIZE_T 8 +# define SIZEOF_SIZE_T 8 +# define SIZEOF_VOID_P 8 # else -# define SIZEOF_SIZE_T 4 +# define SIZEOF_SIZE_T 4 +# define SIZEOF_VOID_P 4 # endif #endif #define INT64_MODIFIER "ll" -#define SIZEOF_BOOL 1 + +/* + * GNU libc added strlcpy() and strlcat() in version 2.38 (in anticipation + * of their addition to POSIX). + */ +#if defined(__FreeBSD__) || \ + defined(__APPLE__) || \ + (defined(__GLIBC__) && \ + defined(__GLIBC_MINOR__) && \ + (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 38)) +# define HAVE_DECL_STRLCAT 1 +# define HAVE_DECL_STRLCPY 1 +#else +# define HAVE_DECL_STRLCAT 0 +# define HAVE_DECL_STRLCPY 0 +#endif /* * Specific for FreeBSD. */ #ifdef __FreeBSD__ # define HAVE_STRUCT_CMSGCRED 1 + +/* + * Note that upstream also defines this macro for newer glibc versions (see + * buildfile for details). + */ +# define HAVE_EXPLICIT_BZERO 1 #endif /* @@ -134,8 +167,6 @@ * Specific for FreeBSD and Mac OS. */ #if defined(__FreeBSD__) || defined(__APPLE__) -# define HAVE_DECL_STRLCAT 1 -# define HAVE_DECL_STRLCPY 1 # define STRERROR_R_INT 1 # define HAVE_FLS 1 # define HAVE_GETPEEREID 1 @@ -143,51 +174,45 @@ # define HAVE_STRTOUQ 1 # define HAVE_STRUCT_SOCKADDR_SA_LEN 1 # define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1 -# define HAVE_SYS_SOCKIO_H 1 # define HAVE_SYS_UCRED_H 1 # define HAVE_UNION_SEMUN 1 -#else -# define HAVE_DECL_STRLCAT 0 -# define HAVE_DECL_STRLCPY 0 +# define HAVE_MEMSET_S 1 +# define HAVE_INT_OPTRESET 1 #endif /* * Specific for POSIX. */ #ifndef _WIN32 -# define HAVE_CRYPT 1 # define HAVE_DECL_FDATASYNC 1 # define HAVE_DECL_RTLD_GLOBAL 1 # define HAVE_DECL_RTLD_NOW 1 # define HAVE_FDATASYNC 1 # define HAVE_GETADDRINFO 1 -# define HAVE_GETIFADDRS 1 -# define HAVE_IFADDRS_H 1 # define HAVE_GETPWUID_R 1 # define HAVE_INET_ATON 1 # define HAVE_LANGINFO_H 1 # define HAVE_MKDTEMP 1 # define HAVE_NETINET_TCP_H 1 -# define HAVE_NET_IF_H 1 # define HAVE_DECL_POSIX_FADVISE 1 # define HAVE_POSIX_FADVISE 1 # define HAVE_RANDOM 1 # define HAVE_SRANDOM 1 # define HAVE_STRERROR_R 1 # define HAVE_STRINGS_H 1 -# define HAVE_SYS_IOCTL_H 1 # define HAVE_POLL 1 # define HAVE_POLL_H 1 -# define HAVE_SYS_POLL_H 1 # define HAVE_SYS_SELECT_H 1 # define HAVE_SYS_UN_H 1 # define HAVE_TERMIOS_H 1 -# define HAVE_UNIX_SOCKETS 1 # define HAVE_UNSETENV 1 -# define USE_INTEGER_DATETIMES 1 # define HAVE_DLOPEN 1 # define HAVE_PREAD 1 # define HAVE_PWRITE 1 +# define HAVE_LINK 1 +# define HAVE_STRUCT_SOCKADDR_UN 1 +# define HAVE_READLINK 1 +# define HAVE_STRSIGNAL 1 /* * Specific for Windows. @@ -197,14 +222,11 @@ # define HAVE_DECL_RTLD_GLOBAL 0 # define HAVE_DECL_RTLD_NOW 0 # define HAVE_DECL_POSIX_FADVISE 0 -# define HAVE_ISINF 1 # define HAVE_FUNCNAME__FUNCTION 1 -# define USE_REPL_SNPRINTF 1 -/* - * This is not a mistake, the macro is defined opposite to the norm. - */ -# define HAVE_GETTIMEOFDAY 1 +# ifdef __MINGW32__ +# define HAVE_GETTIMEOFDAY 1 +# endif #endif /* @@ -224,52 +246,54 @@ # define HAVE__BUILTIN_BSWAP32 1 # define HAVE__BUILTIN_BSWAP64 1 # define HAVE__BUILTIN_OP_OVERFLOW 1 +# define HAVE_SETENV 1 +# define HAVE_CLOCK_GETTIME 1 +# define HAVE_GETOPT 1 +# define HAVE_GETOPT_H 1 +# define HAVE_GETOPT_LONG 1 +# define HAVE_INT_OPTERR 1 +# define HAVE_STRUCT_OPTION 1 + +/* + * _Static_assert() was introduced in C11. However, all the latest major + * compilers, except for MSVC, support it for C99 as well. + */ +# define HAVE__STATIC_ASSERT 1 #endif /* * Relates to the enabled OpenSSL. */ -#define USE_OPENSSL 1 -#define HAVE_OPENSSL_INIT_SSL 1 -#define HAVE_ASN1_STRING_GET0_DATA 1 -#define HAVE_BIO_GET_DATA 1 -#define HAVE_BIO_METH_NEW 1 -#define HAVE_SSL_CLEAR_OPTIONS 1 - -#if OPENSSL_VERSION_NUMBER < 0x10100000L -# define HAVE_CRYPTO_LOCK 1 +#define USE_OPENSSL 1 +#define HAVE_OPENSSL_INIT_SSL 1 +#define HAVE_ASN1_STRING_GET0_DATA 1 +#define HAVE_BIO_GET_DATA 1 +#define HAVE_BIO_METH_NEW 1 + +#if OPENSSL_VERSION_NUMBER >= 0x10100000L +# define HAVE_HMAC_CTX_FREE 1 +# define HAVE_HMAC_CTX_NEW 1 +#else +# define HAVE_CRYPTO_LOCK 1 #endif #if OPENSSL_VERSION_NUMBER >= 0x10002000L # define HAVE_X509_GET_SIGNATURE_NID 1 #endif -#define USE_OPENSSL_RANDOM 1 -#undef USE_DEV_URANDOM -#undef USE_WIN32_RANDOM - /* * Common for all supported OSes/compilers. */ #define ENABLE_THREAD_SAFETY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_RINT 1 -#define HAVE_DECL_SNPRINTF 1 -#define HAVE_DECL_VSNPRINTF 1 +#define PG_USE_STDBOOL 1 #define HAVE_DECL_STRNLEN 1 #define HAVE_DECL_STRTOLL 1 #define HAVE_DECL_STRTOULL 1 -#define HAVE_FSEEKO 1 #define HAVE_FUNCNAME__FUNC 1 #define HAVE_IPV6 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDBOOL_H 1 #define HAVE_STRTOLL 1 #define HAVE_STRTOULL 1 #define HAVE_STRTOF 1 -#define HAVE_TOWLOWER 1 -#define HAVE_WCSTOMBS 1 -#define HAVE_SSL_GET_CURRENT_COMPRESSION 1 #define HAVE_STRUCT_ADDRINFO 1 #define HAVE_STRUCT_SOCKADDR_STORAGE 1 #define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 @@ -277,18 +301,11 @@ #define XLOG_BLCKSZ 8192 #define PG_KRB_SRVNAM "postgres" #define PG_PRINTF_ATTRIBUTE printf -#define FLEXIBLE_ARRAY_MEMBER #define MEMSET_LOOP_LIMIT 1024 #define DEF_PGPORT 5432 #define DEF_PGPORT_STR "5432" /* - * _Static_assert() was introduced in C11. However, all the latest major - * compilers support it for C99 as well. - */ -#define HAVE__STATIC_ASSERT 1 - -/* * Undefined macros. */ @@ -300,11 +317,7 @@ #undef ENABLE_GSS #undef USE_LDAP -/* - * Is meaningless if NLS support is disabled (see above and libpq/buildfile for - * details). - */ -#undef LOCALEDIR +#undef HAVE_LIBREADLINE /* * Is meaningless if GSSAPI support is disabled (see above). It also seems that @@ -314,11 +327,6 @@ #undef HAVE_GSSAPI_H /* - * Integer literal LL suffix is optional for C99. - */ -#undef HAVE_LL_CONSTANTS - -/* * Windows-specific. <crtdefs.h> is included for the latest (>= 1400) VC * unconditionally. */ @@ -371,3 +379,53 @@ */ #undef HAVE___STRTOLL #undef HAVE___STRTOULL + +/* + * None of the supported platforms provides append_history(). + */ +#undef HAVE_APPEND_HISTORY + +/* + * None of the supported OSes have <editline/history.h> or + * <editline/readline.h>. + */ +#undef HAVE_EDITLINE_HISTORY_H +#undef HAVE_EDITLINE_READLINE_H + +/* + * None of the supported OSes have <history.h>. + */ +#undef HAVE_HISTORY_H +#undef HAVE_HISTORY_TRUNCATE_FILE + +/* + * None of the supported OSes have <readline.h>, <readline/history.h>, or + * <readline/readline.h>. + */ +#undef HAVE_READLINE_H +#undef HAVE_READLINE_HISTORY_H +#undef HAVE_READLINE_READLINE_H + +/* + * None of the supported platforms provides rl_completion_append_character and + * rl_completion_suppress_quote global variables and rl_completion_matches(). + */ +#undef HAVE_RL_COMPLETION_APPEND_CHARACTER +#undef HAVE_RL_COMPLETION_MATCHES +#undef HAVE_RL_COMPLETION_SUPPRESS_QUOTE + +/* + * None of the supported platforms provides rl_filename_quote_characters and + * rl_filename_quoting_function global variables and + * rl_filename_completion_function(). + */ +#undef HAVE_RL_FILENAME_COMPLETION_FUNCTION +#undef HAVE_RL_FILENAME_QUOTE_CHARACTERS +#undef HAVE_RL_FILENAME_QUOTING_FUNCTION + +/* + * None of the supported platforms provides rl_reset_screen_size(). + */ +#undef HAVE_RL_RESET_SCREEN_SIZE + +#define pg_restrict __restrict diff --git a/libpq/libpq/pg_config.h.win32.orig b/libpq/libpq/pg_config.h.win32.orig deleted file mode 120000 index 9c4d1e1..0000000 --- a/libpq/libpq/pg_config.h.win32.orig +++ /dev/null @@ -1 +0,0 @@ -../../upstream/src/include/pg_config.h.win32
\ No newline at end of file diff --git a/libpq/libpq/pg_config_ext.h b/libpq/libpq/pg_config_ext.h index 22ec6d9..48d9e15 100644 --- a/libpq/libpq/pg_config_ext.h +++ b/libpq/libpq/pg_config_ext.h @@ -3,8 +3,8 @@ */ /* - * For the semantics of the following macros refer to pg_config_ext.h.in.orig, - * pg_config_ext.h.win32.orig, and the upstream's configure.in. + * For the semantics of the following macros refer to pg_config_ext.h.in.orig + * and the upstream's configure.in. */ /* diff --git a/libpq/libpq/pg_config_ext.h.win32.orig b/libpq/libpq/pg_config_ext.h.win32.orig deleted file mode 120000 index e401e39..0000000 --- a/libpq/libpq/pg_config_ext.h.win32.orig +++ /dev/null @@ -1 +0,0 @@ -../../upstream/src/include/pg_config_ext.h.win32
\ No newline at end of file diff --git a/libpq/libpq/port/explicit_bzero.c b/libpq/libpq/port/explicit_bzero.c new file mode 120000 index 0000000..94fd116 --- /dev/null +++ b/libpq/libpq/port/explicit_bzero.c @@ -0,0 +1 @@ +../../../upstream/src/port/explicit_bzero.c
\ No newline at end of file diff --git a/libpq/libpq/port/gettimeofday.c b/libpq/libpq/port/gettimeofday.c new file mode 120000 index 0000000..335ecce --- /dev/null +++ b/libpq/libpq/port/gettimeofday.c @@ -0,0 +1 @@ +../../../upstream/src/port/gettimeofday.c
\ No newline at end of file diff --git a/libpq/libpq/port/win32stat.c b/libpq/libpq/port/win32stat.c new file mode 120000 index 0000000..0041ec4 --- /dev/null +++ b/libpq/libpq/port/win32stat.c @@ -0,0 +1 @@ +../../../upstream/src/port/win32stat.c
\ No newline at end of file diff --git a/libpq/libpq/strlcpy.c b/libpq/libpq/strlcpy.c new file mode 100644 index 0000000..2dd9f29 --- /dev/null +++ b/libpq/libpq/strlcpy.c @@ -0,0 +1,6 @@ +/* file : libpq/strlcpy.c -*- C -*- + * license : PostgreSQL License; see accompanying COPYRIGHT file + */ +#if !HAVE_DECL_STRLCPY +# include <port/strlcpy.c> +#endif diff --git a/libpq/manifest b/libpq/manifest index 4e1734c..a71dc42 100644 --- a/libpq/manifest +++ b/libpq/manifest @@ -3,23 +3,24 @@ name: libpq # Note: remember to update doc-url below! # -version: 12.1.0+2 -upstream-version: 12.1 +version: 14.1.0+2 +upstream-version: 14.1 project: postgresql summary: PostgreSQL C API client library -license: PostgreSQL License ; Permissive free software license. +license: PostgreSQL ; Permissive free software license. topics: C, PostgreSQL, SQL, relational database description-file: README url: https://www.postgresql.org/ -doc-url: https://www.postgresql.org/docs/12/libpq.html +doc-url: https://www.postgresql.org/docs/14/libpq.html src-url: https://git.build2.org/cgit/packaging/postgresql/postgresql/tree/libpq/ package-url: https://git.build2.org/cgit/packaging/postgresql/ -email: pgsql-general@postgresql.org ; Mailing list. +email: pgsql-general@lists.postgresql.org ; Mailing list. package-email: packaging@build2.org ; Mailing list. -build-email: builds@build2.org +build-warning-email: builds@build2.org builds: all -depends: * build2 >= 0.12.0 -depends: * bpkg >= 0.12.0 +builds: -wasm +depends: * build2 >= 0.15.0 +depends: * bpkg >= 0.15.0 depends: libcrypto >= 1.1.1 depends: libssl >= 1.1.1 diff --git a/libpq/tests/conninfo/driver.c b/libpq/tests/conninfo/driver.c index 2107ac9..a924b0b 100644 --- a/libpq/tests/conninfo/driver.c +++ b/libpq/tests/conninfo/driver.c @@ -2,16 +2,14 @@ * license : PostgreSQL License; see accompanying COPYRIGHT file */ -/* - * Include the upstream package test and rename it's main() function to test() +/* Include the upstream package test and rename it's main() function to test() * (see below for details). */ #define main test #include <uri-regress.c> #undef main -/* - * Enable assertions. +/* Enable assertions. */ #ifdef NDEBUG # undef NDEBUG @@ -21,8 +19,7 @@ #include <assert.h> #include <string.h> /* strlen() */ -/* - * Usage: argv[0] +/* Usage: argv[0] * * Read connection info strings from STDIN and call upstream test main() * function for each of them. The function prints the parsed connection info to @@ -37,13 +34,11 @@ main (int argc, char* argv[]) while (fgets (s, sizeof(s), stdin) != NULL) { - /* - * Print the conninfo string that will be tested. + /* Print the conninfo string that will be tested. */ printf ("trying %s", s); - /* - * Strip the newline character and make sure it is printed to stdout. + /* Strip the newline character and make sure it is printed to stdout. */ size_t n = strlen (s); if (n != 0 && s[n - 1] == '\n') @@ -51,14 +46,12 @@ main (int argc, char* argv[]) else printf ("\n"); - /* - * Make sure the output make sense if stderr is redirected to stdout (and + /* Make sure the output make sense if stderr is redirected to stdout (and * vice versa). */ fflush (stdout); - /* - * Run the test. + /* Run the test. * * Note that we need to print the trailing newline character ourselves. */ diff --git a/libpq/tests/conninfo/postgres_fe.h b/libpq/tests/conninfo/postgres_fe.h index d22d43c..c1e94e1 100644 --- a/libpq/tests/conninfo/postgres_fe.h +++ b/libpq/tests/conninfo/postgres_fe.h @@ -2,8 +2,7 @@ * license : PostgreSQL License; see accompanying COPYRIGHT file */ -/* - * The upstream's uri-regress.c includes src/include/postgres_fe.h that is +/* The upstream's uri-regress.c includes src/include/postgres_fe.h that is * located in libpq/include/ in our source tree. This file is not installed, * so to keep the test as a subproject and be able to test against the * installed libpq library we replace it with the header stub, containing the |