Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 75f79d7

Browse files
author
Marina Polyakova
committed
Merge remote-tracking branch 'origin/PGPRO10' into PGPRO-626-ICU
2 parents 13501cd + 72b34a5 commit 75f79d7

File tree

1,198 files changed

+134904
-39953
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,198 files changed

+134904
-39953
lines changed

COPYRIGHT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PostgreSQL Database Management System
22
(formerly known as Postgres, then as Postgres95)
33

4-
Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
4+
Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
55

66
Portions Copyright (c) 1994, The Regents of the University of California
77

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
# GNUmakefile won't exist yet, so we catch that case as well.
1212

1313

14+
# AIX make defaults to building *every* target of the first rule. Start with
15+
# a single-target, empty rule to make the other targets non-default.
16+
all:
17+
1418
all check install installdirs installcheck installcheck-parallel uninstall clean distclean maintainer-clean dist distcheck world check-world install-world installcheck-world:
1519
@if [ ! -f GNUmakefile ] ; then \
1620
echo "You need to run the 'configure' program first. See the file"; \

config/c-compiler.m4

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,38 +96,72 @@ undefine([Ac_cachevar])dnl
9696
# PGAC_TYPE_128BIT_INT
9797
# ---------------------
9898
# Check if __int128 is a working 128 bit integer type, and if so
99-
# define PG_INT128_TYPE to that typename. This currently only detects
100-
# a GCC/clang extension, but support for different environments may be
101-
# added in the future.
99+
# define PG_INT128_TYPE to that typename, and define ALIGNOF_PG_INT128_TYPE
100+
# as its alignment requirement.
101+
#
102+
# This currently only detects a GCC/clang extension, but support for other
103+
# environments may be added in the future.
102104
#
103105
# For the moment we only test for support for 128bit math; support for
104106
# 128bit literals and snprintf is not required.
105107
AC_DEFUN([PGAC_TYPE_128BIT_INT],
106108
[AC_CACHE_CHECK([for __int128], [pgac_cv__128bit_int],
107109
[AC_LINK_IFELSE([AC_LANG_PROGRAM([
108110
/*
111+
* We don't actually run this test, just link it to verify that any support
112+
* functions needed for __int128 are present.
113+
*
109114
* These are globals to discourage the compiler from folding all the
110115
* arithmetic tests down to compile-time constants. We do not have
111-
* convenient support for 64bit literals at this point...
116+
* convenient support for 128bit literals at this point...
112117
*/
113118
__int128 a = 48828125;
114-
__int128 b = 97656255;
119+
__int128 b = 97656250;
115120
],[
116121
__int128 c,d;
117122
a = (a << 12) + 1; /* 200000000001 */
118123
b = (b << 12) + 5; /* 400000000005 */
119-
/* use the most relevant arithmetic ops */
124+
/* try the most relevant arithmetic ops */
120125
c = a * b;
121126
d = (c + b) / b;
122-
/* return different values, to prevent optimizations */
127+
/* must use the results, else compiler may optimize arithmetic away */
123128
if (d != a+1)
124-
return 0;
125-
return 1;
129+
return 1;
126130
])],
127131
[pgac_cv__128bit_int=yes],
128132
[pgac_cv__128bit_int=no])])
129133
if test x"$pgac_cv__128bit_int" = xyes ; then
130-
AC_DEFINE(PG_INT128_TYPE, __int128, [Define to the name of a signed 128-bit integer type.])
134+
# Use of non-default alignment with __int128 tickles bugs in some compilers.
135+
# If not cross-compiling, we can test for bugs and disable use of __int128
136+
# with buggy compilers. If cross-compiling, hope for the best.
137+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83925
138+
AC_RUN_IFELSE([AC_LANG_PROGRAM([
139+
/* This must match the corresponding code in c.h: */
140+
#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__)
141+
#define pg_attribute_aligned(a) __attribute__((aligned(a)))
142+
#endif
143+
typedef __int128 int128a
144+
#if defined(pg_attribute_aligned)
145+
pg_attribute_aligned(8)
146+
#endif
147+
;
148+
int128a holder;
149+
void pass_by_val(void *buffer, int128a par) { holder = par; }
150+
],[
151+
long int i64 = 97656225L << 12;
152+
int128a q;
153+
pass_by_val(main, (int128a) i64);
154+
q = (int128a) i64;
155+
if (q != holder)
156+
return 1;
157+
])],
158+
[pgac_cv__128bit_int_bug=ok],
159+
[pgac_cv__128bit_int_bug=broken],
160+
[pgac_cv__128bit_int_bug="assuming ok"])
161+
if test x"$pgac_cv__128bit_int_bug" != xbroken ; then
162+
AC_DEFINE(PG_INT128_TYPE, __int128, [Define to the name of a signed 128-bit integer type.])
163+
AC_CHECK_ALIGNOF(PG_INT128_TYPE)
164+
fi
131165
fi])# PGAC_TYPE_128BIT_INT
132166

133167

config/perl.m4

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,23 @@ AC_DEFUN([PGAC_CHECK_PERL_CONFIGS],
4848

4949
# PGAC_CHECK_PERL_EMBED_CCFLAGS
5050
# -----------------------------
51-
# We selectively extract stuff from $Config{ccflags}. We don't really need
52-
# anything except -D switches, and other sorts of compiler switches can
53-
# actively break things if Perl was compiled with a different compiler.
54-
# Moreover, although Perl likes to put stuff like -D_LARGEFILE_SOURCE and
55-
# -D_FILE_OFFSET_BITS=64 here, it would be fatal to try to compile PL/Perl
56-
# to a different libc ABI than core Postgres uses. The available information
57-
# says that all the symbols that affect Perl's own ABI begin with letters,
58-
# so it should be sufficient to adopt -D switches for symbols not beginning
59-
# with underscore. An exception is that we need to let through
60-
# -D_USE_32BIT_TIME_T if it's present. (We probably could restrict that to
61-
# only get through on Windows, but for the moment we let it through always.)
62-
# For debugging purposes, let's have the configure output report the raw
63-
# ccflags value as well as the set of flags we chose to adopt.
51+
# We selectively extract stuff from $Config{ccflags}. For debugging purposes,
52+
# let's have the configure output report the raw ccflags value as well as the
53+
# set of flags we chose to adopt. We don't really need anything except -D
54+
# switches, and other sorts of compiler switches can actively break things if
55+
# Perl was compiled with a different compiler. Moreover, although Perl likes
56+
# to put stuff like -D_LARGEFILE_SOURCE and -D_FILE_OFFSET_BITS=64 here, it
57+
# would be fatal to try to compile PL/Perl to a different libc ABI than core
58+
# Postgres uses. The available information says that most symbols that affect
59+
# Perl's own ABI begin with letters, so it's almost sufficient to adopt -D
60+
# switches for symbols not beginning with underscore. Some exceptions are the
61+
# Windows-specific -D_USE_32BIT_TIME_T and -D__MINGW_USE_VC2005_COMPAT; see
62+
# Mkvcbuild.pm for details. We absorb the former when Perl reports it. Perl
63+
# never reports the latter, and we don't attempt to deduce when it's needed.
64+
# Consequently, we don't support using MinGW to link to MSVC-built Perl. As
65+
# of 2017, all supported ActivePerl and Strawberry Perl are MinGW-built. If
66+
# that changes or an MSVC-built Perl distribution becomes prominent, we can
67+
# revisit this limitation.
6468
AC_DEFUN([PGAC_CHECK_PERL_EMBED_CCFLAGS],
6569
[AC_REQUIRE([PGAC_PATH_PERL])
6670
AC_MSG_CHECKING([for CFLAGS recommended by Perl])
@@ -83,12 +87,19 @@ AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS],
8387
[AC_REQUIRE([PGAC_PATH_PERL])
8488
AC_MSG_CHECKING(for flags to link embedded Perl)
8589
if test "$PORTNAME" = "win32" ; then
86-
perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib`
87-
test -e "$perl_archlibexp/CORE/$perl_lib.lib" && perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
90+
perl_lib=`basename $perl_archlibexp/CORE/perl[[5-9]]*.lib .lib`
91+
if test -e "$perl_archlibexp/CORE/$perl_lib.lib"; then
92+
perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
93+
else
94+
perl_lib=`basename $perl_archlibexp/CORE/libperl[[5-9]]*.a .a | sed 's/^lib//'`
95+
if test -e "$perl_archlibexp/CORE/lib$perl_lib.a"; then
96+
perl_embed_ldflags="-L$perl_archlibexp/CORE -l$perl_lib"
97+
fi
98+
fi
8899
else
89-
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
90-
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
91-
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
100+
pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
101+
pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
102+
perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
92103
fi
93104
AC_SUBST(perl_embed_ldflags)dnl
94105
if test -z "$perl_embed_ldflags" ; then

0 commit comments

Comments
 (0)