Commit Graph

698 Commits

Author SHA1 Message Date
Tom Lane e85493559c Stamp 9.1.24. 2016-10-24 16:19:49 -04:00
Tom Lane cb5b88af7d Stamp 9.1.23. 2016-08-08 16:35:15 -04:00
Tom Lane ddb0843d44 Stamp 9.1.22. 2016-05-09 16:57:25 -04:00
Tom Lane 158a0fb254 Stamp 9.1.21. 2016-03-28 16:16:20 -04:00
Tom Lane 0c94970c93 Cope if platform declares mbstowcs_l(), but not locale_t, in <xlocale.h>.
Previously, we included <xlocale.h> only if necessary to get the definition
of type locale_t.  According to notes in PGAC_TYPE_LOCALE_T, this is
important because on some versions of glibc that file supplies an
incompatible declaration of locale_t.  (This info may be obsolete, because
on my RHEL6 box that seems to be the *only* definition of locale_t; but
there may still be glibc's in the wild for which it's a live concern.)

It turns out though that on FreeBSD and maybe other BSDen, you can get
locale_t from stdlib.h or locale.h but mbstowcs_l() and friends only from
<xlocale.h>.  This was leaving us compiling calls to mbstowcs_l() and
friends with no visible prototype, which causes a warning and could
possibly cause actual trouble, since it's not declared to return int.

Hence, adjust the configure checks so that we'll include <xlocale.h>
either if it's necessary to get type locale_t or if it's necessary to
get a declaration of mbstowcs_l().

Report and patch by Aleksander Alekseev, somewhat whacked around by me.
Back-patch to all supported branches, since we have been using
mbstowcs_l() since 9.1.
2016-03-15 13:19:58 -04:00
Tom Lane 3dca6f36fc Stamp 9.1.20. 2016-02-08 16:21:40 -05:00
Tom Lane 03b138e904 Cope with Readline's failure to track SIGWINCH events outside of input.
It emerges that libreadline doesn't notice terminal window size change
events unless they occur while collecting input.  This is easy to stumble
over if you resize the window while using a pager to look at query output,
but it can be demonstrated without any pager involvement.  The symptom is
that queries exceeding one line are misdisplayed during subsequent input
cycles, because libreadline has the wrong idea of the screen dimensions.

The safest, simplest way to fix this is to call rl_reset_screen_size()
just before calling readline().  That causes an extra ioctl(TIOCGWINSZ)
for every command; but since it only happens when reading from a tty, the
performance impact should be negligible.  A more valid objection is that
this still leaves a tiny window during entry to readline() wherein delivery
of SIGWINCH will be missed; but the practical consequences of that are
probably negligible.  In any case, there doesn't seem to be any good way to
avoid the race, since readline exposes no functions that seem safe to call
from a generic signal handler --- rl_reset_screen_size() certainly isn't.

It turns out that we also need an explicit rl_initialize() call, else
rl_reset_screen_size() dumps core when called before the first readline()
call.

rl_reset_screen_size() is not present in old versions of libreadline,
so we need a configure test for that.  (rl_initialize() is present at
least back to readline 4.0, so we won't bother with a test for it.)
We would need a configure test anyway since libedit's emulation of
libreadline doesn't currently include such a function.  Fortunately,
libedit seems not to have any corresponding bug.

Merlin Moncure, adjusted a bit by me
2015-12-16 16:58:56 -05:00
Tom Lane f0ceb25d04 Stamp 9.1.19. 2015-10-05 15:17:54 -04:00
Noah Misch 76fa354c53 AIX: Test the -qlonglong option before use.
xlc provides "long long" unconditionally at C99-compatible language
levels, and this option provokes a warning.  The warning interferes with
"configure" tests that fail in response to any warning.  Notably, before
commit 85a2a8903f, it interfered with the
test for -qnoansialias.  Back-patch to 9.0 (all supported versions).
2015-07-17 03:02:23 -04:00
Tom Lane 9b00885d0f Make numeric form of PG version number readily available in Makefiles.
Expose PG_VERSION_NUM (e.g., "90600") as a Make variable; but for
consistency with the other Make variables holding similar info,
call the variable just VERSION_NUM not PG_VERSION_NUM.

There was some discussion of making this value available as a pg_config
value as well.  However, that would entail substantially more work than
this two-line patch.  Given that there was not exactly universal consensus
that we need this at all, let's just do a minimal amount of work for now.

Back-patch of commit a5d489ccb7, so that this
variable is actually useful for its intended purpose sometime before 2020.

Michael Paquier, reviewed by Pavel Stehule
2015-07-05 12:01:01 -04:00
Alvaro Herrera a9f886f41d Test -lrt for sched_yield
Apparently, this is needed in some Solaris versions.

Author: Oskari Saarenmaa
2015-06-30 14:20:38 -03:00
Tom Lane 2b7c7ac9ab Stamp 9.1.18. 2015-06-09 15:34:46 -04:00
Tom Lane f2044bd49f Stamp 9.1.17. 2015-06-01 15:12:43 -04:00
Tom Lane 46c877ee46 Stamp 9.1.16. 2015-05-18 14:36:42 -04:00
Tom Lane 506a519f3a Stamp 9.1.15. 2015-02-02 15:45:23 -05:00
Noah Misch 8dc83104ed On Darwin, detect and report a multithreaded postmaster.
Darwin --enable-nls builds use a substitute setlocale() that may start a
thread.  Buildfarm member orangutan experienced BackendList corruption
on account of different postmaster threads executing signal handlers
simultaneously.  Furthermore, a multithreaded postmaster risks undefined
behavior from sigprocmask() and fork().  Emit LOG messages about the
problem and its workaround.  Back-patch to 9.0 (all supported versions).
2015-01-07 22:42:42 -05:00
Noah Misch 81af4185ad Diagnose incompatible OpenLDAP versions during build and test.
With OpenLDAP versions 2.4.24 through 2.4.31, inclusive, PostgreSQL
backends can crash at exit.  Raise a warning during "configure" based on
the compile-time OpenLDAP version number, and test the crash scenario in
the dblink test suite.  Back-patch to 9.0 (all supported versions).
2014-07-22 11:02:00 -04:00
Tom Lane 972a21d736 Stamp 9.1.14. 2014-07-21 15:14:13 -04:00
Noah Misch 3243fa391e Add mkdtemp() to libpgport.
This function is pervasive on free software operating systems; import
NetBSD's implementation.  Back-patch to 8.4, like the commit that will
harness it.
2014-06-14 09:41:18 -04:00
Tom Lane 697becf743 Stamp 9.1.13. 2014-03-17 15:37:27 -04:00
Tom Lane ae51ce4c47 Stamp 9.1.12. 2014-02-17 14:40:10 -05:00
Tom Lane c53cbb39f8 Stamp 9.1.11. 2013-12-02 16:02:21 -05:00
Peter Eisentraut b444726ef6 Stamp 9.1.10. 2013-10-07 23:13:47 -04:00
Tom Lane 649839dd9f Disable -faggressive-loop-optimizations in gcc 4.8+ for pre-9.2 branches.
With this optimization flag enabled, recent versions of gcc can generate
incorrect code that assumes variable-length arrays (such as oidvector)
are actually fixed-length because they're embedded in some larger struct.
The known instance of this problem was fixed in 9.2 and up by commit
8137f2c323 and followon work, which hides
actually-variable-length catalog fields from the compiler altogether.
And we plan to gradually convert variable-length fields to official
"flexible array member" notation over time, which should prevent this type
of bug from reappearing as gcc gets smarter.  We're not going to try to
back-port those changes into older branches, though, so apply this
band-aid instead.

Andres Freund
2013-08-21 18:31:48 -04:00
Tom Lane 3ba763bd95 Fix configure probe for sys/ucred.h.
The configure script's test for <sys/ucred.h> did not work on OpenBSD,
because on that platform <sys/param.h> has to be included first.
As a result, socket peer authentication was disabled on that platform.
Problem introduced in commit be4585b1c2.

Andres Freund, slightly simplified by me.
2013-07-25 11:39:18 -04:00
Tom Lane 114fca526e Stamp 9.1.9. 2013-04-01 14:23:05 -04:00
Tom Lane 69c026512f Stamp 9.1.8. 2013-02-04 16:28:27 -05:00
Tom Lane b487c39dfc Ignore libedit/libreadline while probing for standard functions.
Some versions of libedit expose bogus definitions of setproctitle(),
optreset, and perhaps other symbols that we don't want configure to pick up
on.  There was a previous report of similar problems with strlcpy(), which
we addressed in commit 59cf88da91, but the
problem has evidently grown in scope since then.  In hopes of not having to
deal with it again in future, rearrange configure's tests for supplied
functions so that we ignore libedit/libreadline except when probing
specifically for functions we expect them to provide.

Per report from Christoph Berg, though this is slightly more aggressive
than his proposed patch.
2012-12-18 16:23:49 -05:00
Tom Lane c47f643c49 Stamp 9.1.7. 2012-12-03 15:19:35 -05:00
Tom Lane 04a37a5716 Stamp 9.1.6. 2012-09-19 17:50:31 -04:00
Tom Lane 97395185b8 Make configure probe for mbstowcs_l as well as wcstombs_l.
We previously supposed that any given platform would supply both or neither
of these functions, so that one configure test would be sufficient.  It now
appears that at least on AIX this is not the case ... which is likely an
AIX bug, but nonetheless we need to cope with it.  So use separate tests.
Per bug #6758; thanks to Andrew Hastie for doing the followup testing
needed to confirm what was happening.

Backpatch to 9.1, where we began using these functions.
2012-08-31 14:18:08 -04:00
Tom Lane 04e96bc69d Stamp 9.1.5. 2012-08-14 18:41:04 -04:00
Tom Lane 8e61ded616 Stamp 9.1.4. 2012-05-31 19:07:09 -04:00
Tom Lane 64c47e4542 Stamp 9.1.3. 2012-02-23 17:53:36 -05:00
Tom Lane 630fa6f308 Allow MinGW builds to use standardly-named OpenSSL libraries.
In the Fedora variant of MinGW, the openssl libraries have their normal
names, not libeay32 and libssleay32.  Adjust configure probes to allow
that, per bug #6486.

Tomasz Ostrowski
2012-02-23 15:05:17 -05:00
Tom Lane 068e08eebb Use __sync_lock_test_and_set() for spinlocks on ARM, if available.
Historically we've used the SWPB instruction for TAS() on ARM, but this
is deprecated and not available on ARMv6 and later.  Instead, make use
of a GCC builtin if available.  We'll still fall back to SWPB if not,
so as not to break existing ports using older GCC versions.

Eventually we might want to try using __sync_lock_test_and_set() on some
other architectures too, but for now that seems to present only risk and
not reward.

Back-patch to all supported versions, since people might want to use any
of them on more recent ARM chips.

Martin Pitt
2012-01-07 15:38:59 -05:00
Andrew Dunstan 24b96804d5 Disable excessive FP optimization by recent versions of gcc.
Suggested solution from Tom Lane. Problem discovered, probably not
for the first time, while testing the mingw-w64 32 bit compiler.

Backpatched to all live branches.
2011-12-14 17:14:21 -05:00
Tom Lane cfd8cf37d2 Stamp 9.1.2. 2011-12-01 16:47:20 -05:00
Tom Lane 8da4007a4d Stamp 9.1.1. 2011-09-22 17:57:57 -04:00
Tom Lane 1f43001424 Stamp 9.1.0. 2011-09-08 17:13:27 -04:00
Heikki Linnakangas 6952071450 Fix MinGW build, broken by my previous patch to add a setlocale() wrapper
on Windows. ecpglib doesn't link with libpgport, but picks and compiles
the .c files it needs individually. To cope with that, move the setlocale()
wrapper from chklocale.c to a separate setlocale.c file, and include that
in ecpglib.
2011-09-01 14:04:19 +03:00
Tom Lane d89b8daf5e Tag 9.1rc1. 2011-08-18 17:23:13 -04:00
Andrew Dunstan 5c70cc890d Don't build replacement getpeereid function on mingw.
Windows doesn't have Unix sockets, so it's not needed, and moreover causes compile warnings.
2011-07-25 23:46:52 -04:00
Tom Lane 6c76524620 Tag 9.1beta3. 2011-07-07 20:12:33 -04:00
Tom Lane 829ae4bf83 Tag 9.1beta2. 2011-06-09 19:40:42 -04:00
Tom Lane 3980f7fc6e Implement getpeereid() as a src/port compatibility function.
This unifies a bunch of ugly #ifdef's in one place.  Per discussion,
we only need this where HAVE_UNIX_SOCKETS, so no need to cover Windows.

Marko Kreen, some adjustment by Tom Lane
2011-06-02 13:05:01 -04:00
Tom Lane be4585b1c2 Replace use of credential control messages with getsockopt(LOCAL_PEERCRED).
It turns out the reason we hadn't found out about the portability issues
with our credential-control-message code is that almost no modern platforms
use that code at all; the ones that used to need it now offer getpeereid(),
which we choose first.  The last holdout was NetBSD, and they added
getpeereid() as of 5.0.  So far as I can tell, the only live platform on
which that code was being exercised was Debian/kFreeBSD, ie, FreeBSD kernel
with Linux userland --- since glibc doesn't provide getpeereid(), we fell
back to the control message code.  However, the FreeBSD kernel provides a
LOCAL_PEERCRED socket parameter that's functionally equivalent to Linux's
SO_PEERCRED.  That is both much simpler to use than control messages, and
superior because it doesn't require receiving a message from the other end
at just the right time.

Therefore, add code to use LOCAL_PEERCRED when necessary, and rip out all
the credential-control-message code in the backend.  (libpq still has such
code so that it can still talk to pre-9.1 servers ... but eventually we can
get rid of it there too.)  Clean up related autoconf probes, too.

This means that libpq's requirepeer parameter now works on exactly the same
platforms where the backend supports peer authentication, so adjust the
documentation accordingly.
2011-05-31 16:10:46 -04:00
Tom Lane 44404f3945 Adjust configure to use "+Olibmerrno" with HP-UX C compiler, if possible.
This is reported to be necessary on some versions of that OS.  In service
of this, cause PGAC_PROG_CC_CFLAGS_OPT to reject switches that result in
compiler warnings, since on yet other versions of that OS, the switch does
nothing except provoke a warning.

Report and patch by Ibrar Ahmed, further tweaking by me.
2011-05-26 17:29:33 -04:00
Tom Lane 8ff1f6a78c Adjust configure's probe for libselinux so it rejects too-old versions.
We need at least version 2.0.93, so probe for a function that was added
in that version.

Kaigai Kohei
2011-05-24 15:50:50 -04:00
Peter Eisentraut 51ad1784cc Clarify the documentation of the --with-ossp-uuid option 2011-05-22 14:29:36 +03:00