- Jun 20, 2016
-
- May 09, 2016
-
- May 02, 2016
-
-
Tom Lane authored
awk's equality-comparison operator is "==" not "=". We got this right in many places, but not in configure's checks for supported version numbers of flex and perl. It hadn't been noticed because unsupported versions are so old as to be basically extinct in the wild, and because the only consequence is whether or not a WARNING flies by during configure. Daniel Gustafsson noted the problem with respect to the test for flex, I found the other by reviewing other awk calls.
-
- Apr 08, 2016
-
-
Tom Lane authored
Create a "bsd" auth method that works the same as "password" so far as clients are concerned, but calls the BSD Authentication service to check the password. This is currently only available on OpenBSD. Marisa Emerson, reviewed by Thomas Munro
-
- Mar 21, 2016
-
-
Andres Freund authored
Commit ac1d7945 ("Make idle backends exit if the postmaster dies.") introduced a regression on, at least, large linux systems. Constantly adding the same postmaster_alive_fds to the OSs internal datastructures for implementing poll/select can cause significant contention; leading to a performance regression of nearly 3x in one example. This can be avoided by using e.g. linux' epoll, which avoids having to add/remove file descriptors to the wait datastructures at a high rate. Unfortunately the current latch interface makes it hard to allocate any persistent per-backend resources. Replace, with a backward compatibility layer, WaitLatchOrSocket with a new WaitEventSet API. Users can allocate such a Set across multiple calls, and add more than one file-descriptor to wait on. The latter has been added because there's upcoming postgres features where that will be helpful. In addition to the previously existing poll(2), select(2), WaitForMultipleObjects() implementations also provide an epoll_wait(2) based implementation to address the aforementioned performance problem. Epoll is only available on linux, but that is the most likely OS for machines large enough (four sockets) to reproduce the problem. To actually address the aforementioned regression, create and use a long-lived WaitEventSet for FE/BE communication. There are additional places that would benefit from a long-lived set, but that's a task for another day. Thanks to Amit Kapila, who helped make the windows code I blindly wrote actually work. Reported-By: Dmitry Vasilyev Discussion: CAB-SwXZh44_2ybvS5Z67p_CDz=XFn4hNAD=CnMEF+QqkXwFrGg@mail.gmail.com 20160114143931.GG10941@awork2.anarazel.de
-
Andres Freund authored
Previously latches for windows and unix had been implemented in different files. A later patch introduce an expanded wait infrastructure, keeping the implementation separate would introduce too much duplication. This basically just moves the functions, without too much change. The reason to keep this separate is that it allows blame to continue working a little less badly; and to make review a tiny bit easier. Discussion: 20160114143931.GG10941@awork2.anarazel.de
-
- Mar 15, 2016
-
-
Tom Lane authored
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.
-
- Mar 14, 2016
-
-
Tom Lane authored
Previously, configure would take any string, including an empty string, leading to obscure compile failures in guc.c. It seems worth expending a few lines of code to ensure that the argument is a decimal number between 1 and 65535. Report and patch by Jim Nasby; reviews by Alex Shulgin, Peter Eisentraut, Ivan Kartyshov
-
- Mar 13, 2016
-
- Feb 03, 2016
-
-
Peter Eisentraut authored
Insert sd_notify() calls at server start and stop for integration with systemd. This allows the use of systemd service units of type "notify", which greatly simplifies the systemd configuration. Reviewed-by:
Pavel Stěhule <pavel.stehule@gmail.com>
-
- Jan 08, 2016
-
-
Alvaro Herrera authored
This reverts commit e9282e95, which blew up in a pretty spectacular way. Re-introduce the original code while we search for a real fix.
-
Alvaro Herrera authored
Further portability fix for a9676139. Mingw- and MSVC-based builds appear to be working fine, but Cygwin needs an extra tweak whereby the new win32security.c file is explicitely added to the list of files to build in pgport, per Cygwin members brolga and lorikeet. Author: Michael Paquier
-
- Jan 07, 2016
-
-
Alvaro Herrera authored
This seems to fix Mingw's compile that was broken in a9676139, as evidenced by buildfarm.
-
- Jan 02, 2016
-
-
Bruce Momjian authored
Backpatch certain files through 9.1
-
- Dec 16, 2015
-
-
Tom Lane authored
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
-
- Nov 18, 2015
-
-
Tom Lane authored
Per buildfarm member anchovy, 2.6.0 exists in the wild now. Hopefully it works with Postgres; if not, we'll have to do something about that, but in any case claiming it's "too old" is pretty silly.
-
- Oct 08, 2015
-
-
Robert Haas authored
This is like BSWAP32, but for 64-bit values. Since we've got two of them now and they have use cases (like sortsupport) beyond CRCs, move the definitions to their own header file. Peter Geoghegan
-
- Aug 31, 2015
-
-
Tom Lane authored
Remove configure's checks for HAVE_POSIX_SIGNALS, HAVE_SIGPROCMASK, and HAVE_SIGSETJMP. These APIs are required by the Single Unix Spec v2 (POSIX 1997), which we generally consider to define our minimum required set of Unix APIs. Moreover, no buildfarm member has reported not having them since 2012 or before, which means that even if the code is still live somewhere, it's untested --- and we've made plenty of signal-handling changes of late. So just take these APIs as given and save the cycles for configure probes for them. However, we can't remove as much C code as I'd hoped, because the Windows port evidently still uses the non-POSIX code paths for signal masking. Since we're largely emulating these BSD-style APIs for Windows anyway, it might be a good thing to switch over to POSIX-like notation and thereby remove a few more #ifdefs. But I'm not in a position to code or test that. In the meantime, we can at least make things a bit more transparent by testing for WIN32 explicitly in these places.
-
Tom Lane authored
C89 requires <signal.h> to define sig_atomic_t, and there is no evidence in the buildfarm that any supported platforms don't comply. Remove the configure test to stop wasting build cycles on a purely historical issue. (Once upon a time, we cared about supporting C89-compliant compilers on machines with pre-C89 system headers, but that use-case has been dead for quite a few years.) I have some other fixes planned in this area, but let's start with this to see if the buildfarm produces any surprising results.
-
- Aug 17, 2015
-
-
Andres Freund authored
With optimizations enabled at least one compiler, clang 3.7, optimized away the crc intrinsics knowing that the result went on unused and has no side effects. That can trigger errors in code generation when the intrinsic is used, as we chose to use the intrinsics without any additional compiler flag. Return the computed value to prevent that. With some more pedantic warning flags (-Wold-style-definition) the configure test failed to recognize the existence of _mm_crc32_u* intrinsics due to an independent warning in the test because the test turned on -Werror, but that's not actually needed here. Discussion: 20150814092039.GH4955@awork2.anarazel.de Backpatch: 9.5, where the use of crc intrinsics was integrated.
-
- Aug 05, 2015
-
-
Andres Freund authored
So far we have worked around the fact that some very old compilers do not support 'inline' functions by only using inline functions conditionally (or not at all). Since such compilers are very rare by now, we have decided to rely on inline functions from 9.6 onwards. To avoid breaking these old compilers inline is defined away when not supported. That'll cause "function x defined but not used" type of warnings, but since nobody develops on such compilers anymore that's ok. This change in policy will allow us to more easily employ inline functions. I chose to remove code previously conditional on PG_USE_INLINE as it seemed confusing to have code dependent on a define that's always defined. Blacklisting of compilers, like in c53f7387, now has to be done differently. A platform template can define PG_FORCE_DISABLE_INLINE to force inline to be defined empty. Discussion: 20150701161447.GB30708@awork2.anarazel.de
-
- Jul 30, 2015
-
-
Heikki Linnakangas authored
The current version is adding a spurious -pthread option on some Darwin systems that don't need it, which leads to a bunch of "unrecognized option '-pthread'" warnings. There is a proposed fix for that in the upstream autoconf archive's bug tracker, see https://savannah.gnu.org/patch/?8186. This commit updates our version of ax_pthread.m4 to the "draft2" version proposed there by Daniel Richard G. I'm using our buildfarm to help Daniel to test this, before he commits this to the upstream repository.
-
- Jul 17, 2015
-
-
Noah Misch authored
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 85a2a890, it interfered with the test for -qnoansialias. Back-patch to 9.0 (all supported versions).
-
- Jul 09, 2015
-
-
Heikki Linnakangas authored
Autoconf generates additional code for the first AC_CHECK_HEADERS call in the script. If the first call is within an if-block, the additional code is put inside the if-block too, even though it is needed by subsequent AC_CHECK_HEADERS checks and should always be executed. When I moved the pthread-related checks earlier in the script, the pthread.h test inside the block became the very first AC_CHECK_HEADERS call in the script, triggering that problem. To fix, use AS_IF instead of plain shell if. AS_IF knows about that issue, and makes sure the additional code is always executed. To be completely safe from this issue (and others), we should always be using AS_IF instead of plain if, but that seems like excessive caution given that this is the first time we have trouble like this. Plain if-then is more readable than AS_IF. This should fix compilation with --disable-thread-safety, and hopefully the buildfarm failure on forgmouth, related to mingw standard headers, too. I backpatched the previous fixes to 9.5, but it's starting to look like these changes are too fiddly to backpatch, so commit this to master only, and revert all the pthread-related configure changes in 9.5.
-
- Jul 08, 2015
-
-
Heikki Linnakangas authored
On some Linux systems, "-lrt" exposed pthread-functions, so that linking with -lrt was seemingly enough to make a program that uses pthreads to work. However, when linking libpq, the dependency to libpthread was not marked correctly, so that when an executable was linked with -lpq but without -pthread, you got errors about undefined pthread_* functions from libpq. To fix, test for the flags required to use pthreads earlier in the autoconf script, before checking any other libraries. This should fix the failure on buildfarm member shearwater. gharial is also failing; hopefully this fixes that too although the failure looks somewhat different.
-
Heikki Linnakangas authored
Our version was different from the upstream version in that we tried to use all possible pthread-related flags that the compiler accepts, rather than just the first one that works. That change was made in commit e48322a6, to work-around a bug affecting GCC versions 3.2 and below (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=8888), although we didn't realize that it was a GCC bug at the time. We hardly care about that old GCC versions anymore, so we no longer need that workaround. This fixes the macro for compilers that print warnings with the chosen flags. That's pretty annoying on its own right, but it also inconspicuously disabled thread-safety, because we refused to use any pthread-related flags if the compiler produced warnings. Max Filippov reported that problem when linking with uClibc and OpenSSL. The warnings-check was added because the workaround for the GCC bug caused warnings otherwise, so it's no longer needed either. We can just use the upstream version as is. If you really want to compile with GCC version 3.2 or older, you can still work-around it manually by setting PTHREAD_CFLAGS="-pthread -lpthread" manually on the configure command line. Backpatch to 9.5. I don't want to unnecessarily rock the boat on stable branches, but 9.5 seems like fair game.
-
- Jul 02, 2015
-
-
Tom Lane authored
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. Michael Paquier, reviewed by Pavel Stehule
-
Heikki Linnakangas authored
AC_TRY_COMPILE(...) -> AC_COMPILE_IFELSE([AC_LANG_PROGRAM(...)]) AC_TRY_LINK(...) -> AC_LINK_IFELSE([AC_LANG_PROGRAM(...)]) AC_TRY_RUN(...) -> AC_RUN_IFELSE([AC_LANG_PROGRAM(...)]) AC_LANG_SAVE/RESTORE -> AC_LANG_PUSH/POP AC_DECL_SYS_SIGLIST -> AC_CHECK_DECLS(...) (per snippet in autoconf manual) Also use AC_LANG_SOURCE instead of AC_LANG_PROGRAM, where the main() function is not needed. With these changes, autoconf -Wall doesn't complain anymore. Andreas Karlsson
-
- Jun 30, 2015
-
-
Tom Lane authored
Let the hacking begin ...
-
Alvaro Herrera authored
Apparently, this is needed in some Solaris versions. Author: Oskari Saarenmaa
-
- Jun 29, 2015
-
- May 27, 2015
-
-
Tom Lane authored
According to recent tests, this case now works fine, so there's no reason to reject it anymore. (Even if there are still some OpenBSD platforms in the wild where it doesn't work, removing the check won't break any case that worked before.) We can actually remove the entire test that discovers whether libpython is threaded, since without the OpenBSD case there's no need to know that at all. Per report from Davin Potts. Back-patch to all active branches.
-
- May 03, 2015
-
-
Andrew Dunstan authored
-
Andrew Dunstan authored
By converting to using forward slashes at configure time we avoid having to repeat the logic anywhere that this is needed, such as in transforms modules for plpython.
-
- May 02, 2015
-
-
Peter Eisentraut authored
-
Peter Eisentraut authored
Apparently, looking for an appropriately named file doesn't work on some older versions, so put the back the explicit platform detection.
-
Peter Eisentraut authored
For building PL/Perl, PL/Python, and PL/Tcl, we need a shared library of libperl, libpython, and libtcl, respectively. Previously, this was checked in the makefiles, skipping the PL build with a warning if no shared library was available. Now this is checked in configure, with an error if no shared library is available. The previous situation arose because in the olden days, the configure options --with-perl, --with-python, and --with-tcl controlled whether frontend interfaces for those languages would be built. The procedural languages were added later, and shared libraries were often not available in the beginning. So it was decided skip the builds of the procedural languages in those cases. The frontend interfaces have since been removed from the tree, and shared libraries are now available most of the time, so that setup makes much less sense now. Also, the new setup allows contrib modules and pgxs users to rely on the respective PLs being available based on configure flags.
-
- Apr 14, 2015
-
-
Heikki Linnakangas authored
Eliminate the separate 'len' variable from the loops, and also use the 4 byte instruction. This shaves off a few more cycles. Even though this routine that uses the special SSE 4.2 instructions is much faster than a generic routine, it's still a hot spot, so let's make it as fast as possible. Change the configure test to not test _mm_crc32_u64. That variant is only available in the 64-bit x86-64 architecture, not in 32-bit x86. Modify pg_comp_crc32c_sse42 so that it only uses _mm_crc32_u64 on x86-64. With these changes, the SSE accelerated CRC-32C implementation can also be used on 32-bit x86 systems. This also fixes the 32-bit MSVC build.
-
Heikki Linnakangas authored
On gcc and clang, the _mm_crc32_u8 and _mm_crc32_u64 intrinsics are not defined at all, when not building with -msse4.2. But on icc, they are. So we cannot assume that if those intrinsics are defined, we can always use them safely, we might still need the runtime check. To fix, check if the __SSE_4_2__ preprocessor symbol is defined. That's supposed to be defined only when the compiler is targeting a processor that has SSE 4.2 support. Per buildfarm members fulmar and okapi.
-
Heikki Linnakangas authored
Modern x86 and x86-64 processors with SSE 4.2 support have special instructions, crc32b and crc32q, for calculating CRC-32C. They greatly speed up CRC calculation. Whether the instructions can be used or not depends on the compiler and the target architecture. If generation of SSE 4.2 instructions is allowed for the target (-msse4.2 flag on gcc and clang), use them. If they are not allowed by default, but the compiler supports the -msse4.2 flag to enable them, compile just the CRC-32C function with -msse4.2 flag, and check at runtime whether the processor we're running on supports it. If it doesn't, fall back to the slicing-by-8 algorithm. (With the common defaults on current operating systems, the runtime-check variant is what you get in practice.) Abhijit Menon-Sen, heavily modified by me, reviewed by Andres Freund.
-