Re: [Update] PostgreSQL 10.6

2018-12-05 Thread Christian Weisgerber
On 2018-12-03, Stuart Henderson  wrote:

> # Defend against clang being used on x86-32 without SSE2 enabled.  As current
> # versions of clang do not understand -fexcess-precision=standard, the use of
> # x87 floating point operations leads to problems like isinf possibly 
> returning
> # false for a value that is infinite when converted from the 80bit register to
> # the 8byte memory representation.
>
> I'm unsure which approach I like least, gcc or -msse2...

A third possibility would be to ignore this corner case and disable
the check.  I think from a practical point of view this would be
fine.  The number of people who do scientific computing in Postgres
on i386 should be very limited.  However, I imagine this would burn
whatever goodwill we have with upstream.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: [Update] PostgreSQL 10.6

2018-12-05 Thread Pierre-Emmanuel André
On Mon, Dec 03, 2018 at 09:47:46PM +, Stuart Henderson wrote:
> On 2018/12/02 11:40, Stuart Henderson wrote:
> > On 2018/11/08 18:35, Pierre-Emmanuel André wrote:
> > > Hi,
> > > 
> > > Here is a diff to update PostgreSQL to it's latest version (10.6).
> > > Release note : https://www.postgresql.org/about/news/1905/
> > > (It fixes CVE-2018-16850)
> > > 
> > > Tested on @amd64.
> > > Comments, ok ?
> > > 
> > > Regards,
> > 
> > Fails on i386:
> > 
> > checking whether the C compiler still works... yes
> > configure: error: Compiling PostgreSQL with clang, on 32bit x86, requires 
> > SSE2 support. Use -msse2 or use gcc.
> > 
> > 
> 
> A special check was added for this, description as follows:
> 
> # Defend against clang being used on x86-32 without SSE2 enabled.  As current
> # versions of clang do not understand -fexcess-precision=standard, the use of
> # x87 floating point operations leads to problems like isinf possibly 
> returning
> # false for a value that is infinite when converted from the 80bit register to
> # the 8byte memory representation.
> 
> I'm unsure which approach I like least, gcc or -msse2...
> 
> Index: Makefile
> ===
> RCS file: /cvs/ports/databases/postgresql/Makefile,v
> retrieving revision 1.246
> diff -u -p -r1.246 Makefile
> --- Makefile  3 Dec 2018 16:22:08 -   1.246
> +++ Makefile  3 Dec 2018 21:46:42 -
> @@ -79,6 +79,18 @@ CONFIGURE_ARGS=--disable-rpath --with-o
>  CONFIGURE_ARGS+=--disable-spinlocks
>  .endif
>  
> +# To avoid problems with missed floating point overflow checks.
> +# pgsql 10.6+ refuses to build on i386 clang unless -msse2 is set.
> +# If clang gains "-fexcess-precision=standard" support then this
> +# should be removed.
> +MODULES+=gcc4
> +MODGCC4_ARCHS=   i386
> +MODGCC4_LANGS=   c
> +# An alternative workaround:
> +# .if ${MACHINE_ARCH} == "i386"
> +# CFLAGS +=  -msse2
> +# .endif
> +
>  MODGNU_CONFIG_GUESS_DIRS=${WRKSRC}/config
>  
>  ALL_TARGET=  world
> 

Go for the fix.
ok pea@



Re: [Update] PostgreSQL 10.6

2018-12-03 Thread Stuart Henderson
On 2018/12/02 11:40, Stuart Henderson wrote:
> On 2018/11/08 18:35, Pierre-Emmanuel André wrote:
> > Hi,
> > 
> > Here is a diff to update PostgreSQL to it's latest version (10.6).
> > Release note : https://www.postgresql.org/about/news/1905/
> > (It fixes CVE-2018-16850)
> > 
> > Tested on @amd64.
> > Comments, ok ?
> > 
> > Regards,
> 
> Fails on i386:
> 
> checking whether the C compiler still works... yes
> configure: error: Compiling PostgreSQL with clang, on 32bit x86, requires 
> SSE2 support. Use -msse2 or use gcc.
> 
> 

A special check was added for this, description as follows:

# Defend against clang being used on x86-32 without SSE2 enabled.  As current
# versions of clang do not understand -fexcess-precision=standard, the use of
# x87 floating point operations leads to problems like isinf possibly returning
# false for a value that is infinite when converted from the 80bit register to
# the 8byte memory representation.

I'm unsure which approach I like least, gcc or -msse2...

Index: Makefile
===
RCS file: /cvs/ports/databases/postgresql/Makefile,v
retrieving revision 1.246
diff -u -p -r1.246 Makefile
--- Makefile3 Dec 2018 16:22:08 -   1.246
+++ Makefile3 Dec 2018 21:46:42 -
@@ -79,6 +79,18 @@ CONFIGURE_ARGS=  --disable-rpath --with-o
 CONFIGURE_ARGS+=--disable-spinlocks
 .endif
 
+# To avoid problems with missed floating point overflow checks.
+# pgsql 10.6+ refuses to build on i386 clang unless -msse2 is set.
+# If clang gains "-fexcess-precision=standard" support then this
+# should be removed.
+MODULES+=  gcc4
+MODGCC4_ARCHS= i386
+MODGCC4_LANGS= c
+# An alternative workaround:
+# .if ${MACHINE_ARCH} == "i386"
+# CFLAGS +=-msse2
+# .endif
+
 MODGNU_CONFIG_GUESS_DIRS=  ${WRKSRC}/config
 
 ALL_TARGET=world



Re: [Update] PostgreSQL 10.6

2018-12-03 Thread Pierre-Emmanuel André
On Mon, Dec 03, 2018 at 01:08:25PM +, Stuart Henderson wrote:
> On 2018/12/02 11:40, Stuart Henderson wrote:
> > On 2018/11/08 18:35, Pierre-Emmanuel André wrote:
> > > Hi,
> > > 
> > > Here is a diff to update PostgreSQL to it's latest version (10.6).
> > > Release note : https://www.postgresql.org/about/news/1905/
> > > (It fixes CVE-2018-16850)
> > > 
> > > Tested on @amd64.
> > > Comments, ok ?
> > > 
> > > Regards,
> > 
> > Fails on i386:
> > 
> > checking whether the C compiler still works... yes
> > configure: error: Compiling PostgreSQL with clang, on 32bit x86, requires 
> > SSE2 support. Use -msse2 or use gcc.
> > 
> > 
> 
> Haven't looked at i386 yet, but here's another fix:
> 
> "Backport fix for using foreign tables with SCRAM authentication" in
> patch-src_Makefile_shlib was mis-merged, it has been committed upstream
> so the patch adds a second copy of the BUILD.exports/exports_file/etc
> lines.
> 
> Diff below fixes that, removes the "zap -soname" patch, and fixes upstream's
> -soname line to use the full library version number.
> 
> $ for i in lib*.so.?.?; do echo $i `objdump -p $i|grep SONAME`; done
> libecpg.so.7.9 SONAME libecpg.so.7.9
> libecpg_compat.so.4.9 SONAME libecpg_compat.so.4.9
> libpgtypes.so.4.8 SONAME libpgtypes.so.4.8
> 
> OK?

Yes, ok pea@
Thanks

> 
> Index: Makefile
> ===
> RCS file: /cvs/ports/databases/postgresql/Makefile,v
> retrieving revision 1.245
> diff -u -p -r1.245 Makefile
> --- Makefile  2 Dec 2018 12:27:12 -   1.245
> +++ Makefile  3 Dec 2018 13:04:24 -
> @@ -17,9 +17,7 @@ PKGNAME-contrib=postgresql-contrib-${VER
>  PKGNAME-plpython=postgresql-plpython-${VERSION}
>  PKGNAME-pg_upgrade=postgresql-pg_upgrade-${VERSION}
>  
> -REVISION-server= 0
> -REVISION-contrib=0
> -REVISION-pg_upgrade= 0
> +REVISION=1
>  
>  CATEGORIES=  databases
>  SHARED_LIBS= ecpg7.9 \
> Index: patches/patch-src_Makefile_shlib
> ===
> RCS file: /cvs/ports/databases/postgresql/patches/patch-src_Makefile_shlib,v
> retrieving revision 1.11
> diff -u -p -r1.11 patch-src_Makefile_shlib
> --- patches/patch-src_Makefile_shlib  4 Oct 2018 14:48:15 -   1.11
> +++ patches/patch-src_Makefile_shlib  3 Dec 2018 13:04:24 -
> @@ -1,22 +1,14 @@
> -$OpenBSD: patch-src_Makefile_shlib,v 1.11 2018/10/04 14:48:15 jeremy Exp $
> -
> -Backport fix for using foreign tables with SCRAM authentication from
> -upstream commit d6ff5322c23272b15af606d7da12f49eca4d4470.
> +$OpenBSD$
>  
>  Index: src/Makefile.shlib
>  --- src/Makefile.shlib.orig
>  +++ src/Makefile.shlib
> -@@ -146,7 +146,12 @@ ifeq ($(PORTNAME), openbsd)
> -   ifdef ELF_SYSTEM
> - LINK.shared = $(COMPILER) -shared
> - ifdef soname
> --  LINK.shared   += -Wl,-x,-soname,$(soname)
> -+  LINK.shared   += -Wl,-x
> -+endif
> -+BUILD.exports   = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf 
> "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
> -+exports_file= $(SHLIB_EXPORTS:%.txt=%.list)
> -+ifneq (,$(exports_file))
> -+  LINK.shared   += -Wl,--version-script=$(exports_file)
> - endif
> - SHLIB_LINK  += -lc
> -   else
> +@@ -80,7 +80,7 @@ shlib_major= 
> lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION
> + shlib_bare  = lib$(NAME)$(DLSUFFIX)
> + # Testing the soname variable is a reliable way to determine whether a
> + # linkable library is being built.
> +-soname  = $(shlib_major)
> ++soname  = $(shlib_major).$(SO_MINOR_VERSION)
> + pkgconfigdir = $(libdir)/pkgconfig
> + else
> + # Naming convention for dynamically loadable modules
> 



Re: [Update] PostgreSQL 10.6

2018-12-03 Thread Stuart Henderson
On 2018/12/02 11:40, Stuart Henderson wrote:
> On 2018/11/08 18:35, Pierre-Emmanuel André wrote:
> > Hi,
> > 
> > Here is a diff to update PostgreSQL to it's latest version (10.6).
> > Release note : https://www.postgresql.org/about/news/1905/
> > (It fixes CVE-2018-16850)
> > 
> > Tested on @amd64.
> > Comments, ok ?
> > 
> > Regards,
> 
> Fails on i386:
> 
> checking whether the C compiler still works... yes
> configure: error: Compiling PostgreSQL with clang, on 32bit x86, requires 
> SSE2 support. Use -msse2 or use gcc.
> 
> 

Haven't looked at i386 yet, but here's another fix:

"Backport fix for using foreign tables with SCRAM authentication" in
patch-src_Makefile_shlib was mis-merged, it has been committed upstream
so the patch adds a second copy of the BUILD.exports/exports_file/etc
lines.

Diff below fixes that, removes the "zap -soname" patch, and fixes upstream's
-soname line to use the full library version number.

$ for i in lib*.so.?.?; do echo $i `objdump -p $i|grep SONAME`; done
libecpg.so.7.9 SONAME libecpg.so.7.9
libecpg_compat.so.4.9 SONAME libecpg_compat.so.4.9
libpgtypes.so.4.8 SONAME libpgtypes.so.4.8

OK?

Index: Makefile
===
RCS file: /cvs/ports/databases/postgresql/Makefile,v
retrieving revision 1.245
diff -u -p -r1.245 Makefile
--- Makefile2 Dec 2018 12:27:12 -   1.245
+++ Makefile3 Dec 2018 13:04:24 -
@@ -17,9 +17,7 @@ PKGNAME-contrib=postgresql-contrib-${VER
 PKGNAME-plpython=postgresql-plpython-${VERSION}
 PKGNAME-pg_upgrade=postgresql-pg_upgrade-${VERSION}
 
-REVISION-server=   0
-REVISION-contrib=  0
-REVISION-pg_upgrade=   0
+REVISION=  1
 
 CATEGORIES=databases
 SHARED_LIBS=   ecpg7.9 \
Index: patches/patch-src_Makefile_shlib
===
RCS file: /cvs/ports/databases/postgresql/patches/patch-src_Makefile_shlib,v
retrieving revision 1.11
diff -u -p -r1.11 patch-src_Makefile_shlib
--- patches/patch-src_Makefile_shlib4 Oct 2018 14:48:15 -   1.11
+++ patches/patch-src_Makefile_shlib3 Dec 2018 13:04:24 -
@@ -1,22 +1,14 @@
-$OpenBSD: patch-src_Makefile_shlib,v 1.11 2018/10/04 14:48:15 jeremy Exp $
-
-Backport fix for using foreign tables with SCRAM authentication from
-upstream commit d6ff5322c23272b15af606d7da12f49eca4d4470.
+$OpenBSD$
 
 Index: src/Makefile.shlib
 --- src/Makefile.shlib.orig
 +++ src/Makefile.shlib
-@@ -146,7 +146,12 @@ ifeq ($(PORTNAME), openbsd)
-   ifdef ELF_SYSTEM
- LINK.shared   = $(COMPILER) -shared
- ifdef soname
--  LINK.shared += -Wl,-x,-soname,$(soname)
-+  LINK.shared += -Wl,-x
-+endif
-+BUILD.exports = ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf 
"%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
-+exports_file  = $(SHLIB_EXPORTS:%.txt=%.list)
-+ifneq (,$(exports_file))
-+  LINK.shared += -Wl,--version-script=$(exports_file)
- endif
- SHLIB_LINK+= -lc
-   else
+@@ -80,7 +80,7 @@ shlib_major  = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION
+ shlib_bare= lib$(NAME)$(DLSUFFIX)
+ # Testing the soname variable is a reliable way to determine whether a
+ # linkable library is being built.
+-soname= $(shlib_major)
++soname= $(shlib_major).$(SO_MINOR_VERSION)
+ pkgconfigdir = $(libdir)/pkgconfig
+ else
+ # Naming convention for dynamically loadable modules



Re: [Update] PostgreSQL 10.6

2018-12-02 Thread Stuart Henderson
On 2018/11/08 18:35, Pierre-Emmanuel André wrote:
> Hi,
> 
> Here is a diff to update PostgreSQL to it's latest version (10.6).
> Release note : https://www.postgresql.org/about/news/1905/
> (It fixes CVE-2018-16850)
> 
> Tested on @amd64.
> Comments, ok ?
> 
> Regards,

Fails on i386:

checking whether the C compiler still works... yes
configure: error: Compiling PostgreSQL with clang, on 32bit x86, requires SSE2 
support. Use -msse2 or use gcc.




[Update] PostgreSQL 10.6

2018-11-08 Thread Pierre-Emmanuel André
Hi,

Here is a diff to update PostgreSQL to it's latest version (10.6).
Release note : https://www.postgresql.org/about/news/1905/
(It fixes CVE-2018-16850)

Tested on @amd64.
Comments, ok ?

Regards,
Index: Makefile
===
RCS file: /cvs/ports/databases/postgresql/Makefile,v
retrieving revision 1.243
diff -u -p -u -p -r1.243 Makefile
--- Makefile	4 Oct 2018 14:48:15 -	1.243
+++ Makefile	8 Nov 2018 17:31:49 -
@@ -7,7 +7,7 @@ COMMENT-contrib=PostgreSQL RDBMS contrib
 COMMENT-plpython=Python procedural language for PostgreSQL
 COMMENT-pg_upgrade=Support for upgrading PostgreSQL data from previous version
 
-VERSION=	10.5
+VERSION=	10.6
 PREV_MAJOR=	9.6
 DISTNAME=	postgresql-${VERSION}
 PKGNAME-main=	postgresql-client-${VERSION}
@@ -16,11 +16,6 @@ PKGNAME-docs=	postgresql-docs-${VERSION}
 PKGNAME-contrib=postgresql-contrib-${VERSION}
 PKGNAME-plpython=postgresql-plpython-${VERSION}
 PKGNAME-pg_upgrade=postgresql-pg_upgrade-${VERSION}
-REVISION-main=		1
-REVISION-server=	4
-REVISION-contrib=	0
-REVISION-plpython=	0
-REVISION-pg_upgrade=	0
 
 CATEGORIES=	databases
 SHARED_LIBS=	ecpg		7.9 \
@@ -35,7 +30,7 @@ MAINTAINER=	Pierre-Emmanuel Andre https://ftp.postgresql.org/pub/source/v${VERSION}/ \
 		ftp://ftp.postgresql.org/pub/source/v${VERSION}/
@@ -93,18 +88,19 @@ WANTLIB-main =	${WANTLIB} xml2
 
 LIB_DEPENDS-server= databases/postgresql=${VERSION} \
 		${LIB_DEPENDS-main}
-WANTLIB-server=	${WANTLIB-main} perl pq>=4
+WANTLIB-server=	${WANTLIB-main} perl
 
 RUN_DEPENDS-contrib= databases/postgresql,-server=${VERSION}
 LIB_DEPENDS-contrib= databases/postgresql=${VERSION} \
 		 ${LIB_DEPENDS-main}
-WANTLIB-contrib=	${WANTLIB-main} pq>=4 perl
+WANTLIB-contrib=	${WANTLIB-main} perl
 
 RUN_DEPENDS-pg_upgrade=	databases/postgresql,-server=${VERSION} \
 			databases/postgresql-previous>=${PREV_MAJOR}
 LIB_DEPENDS-pg_upgrade= databases/postgresql=${VERSION} \
 		 ${LIB_DEPENDS-main}
-WANTLIB-pg_upgrade=	${WANTLIB-main} pq>=4
+
+WANTLIB-pg_upgrade =	${WANTLIB-main}
 
 LIB_DEPENDS-plpython=	${MODPY_LIB_DEPENDS}
 WANTLIB-plpython =	c m pthread util \
Index: distinfo
===
RCS file: /cvs/ports/databases/postgresql/distinfo,v
retrieving revision 1.74
diff -u -p -u -p -r1.74 distinfo
--- distinfo	9 Aug 2018 15:32:36 -	1.74
+++ distinfo	8 Nov 2018 17:31:49 -
@@ -1,2 +1,2 @@
-SHA256 (postgresql-10.5.tar.gz) = E75wU7HYrU4klDsk2AFwV0/HAbSbPxTmil8b2kUs49E=
-SIZE (postgresql-10.5.tar.gz) = 26818092
+SHA256 (postgresql-10.6.tar.gz) = fMtwrJHZaOMvZCpPQKeIUkU1L6t+6FMO3OEn3qbmICs=
+SIZE (postgresql-10.6.tar.gz) = 26902911
Index: patches/patch-src_pl_plperl_GNUmakefile
===
RCS file: patches/patch-src_pl_plperl_GNUmakefile
diff -N patches/patch-src_pl_plperl_GNUmakefile
--- patches/patch-src_pl_plperl_GNUmakefile	14 Aug 2017 11:56:54 -	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,14 +0,0 @@
-$OpenBSD: patch-src_pl_plperl_GNUmakefile,v 1.2 2017/08/14 11:56:54 pea Exp $
-
-Index: src/pl/plperl/GNUmakefile
 src/pl/plperl/GNUmakefile.orig
-+++ src/pl/plperl/GNUmakefile
-@@ -16,7 +16,7 @@ endif
- # probably because it sometimes contains some header files with names
- # that clash with some of ours, or with some that we include, notably on
- # Windows.
--override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) $(perl_embed_ccflags) -I$(perl_archlibexp)/CORE
-+override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS) $(perl_embed_ccflags) -I$(perl_archlibexp)/CORE -DNO_LOCALE_NUMERIC -DNO_LOCALE_COLLATE -DBIG_TIME
- 
- rpathdir = $(perl_archlibexp)/CORE
- 
Index: pkg/PLIST-contrib
===
RCS file: /cvs/ports/databases/postgresql/pkg/PLIST-contrib,v
retrieving revision 1.18
diff -u -p -u -p -r1.18 PLIST-contrib
--- pkg/PLIST-contrib	17 May 2018 18:42:42 -	1.18
+++ pkg/PLIST-contrib	8 Nov 2018 17:31:49 -
@@ -188,6 +188,7 @@ share/postgresql/extension/pg_stat_state
 share/postgresql/extension/pg_stat_statements--1.2--1.3.sql
 share/postgresql/extension/pg_stat_statements--1.3--1.4.sql
 share/postgresql/extension/pg_stat_statements--1.4--1.5.sql
+share/postgresql/extension/pg_stat_statements--1.5--1.6.sql
 share/postgresql/extension/pg_stat_statements--1.4.sql
 share/postgresql/extension/pg_stat_statements--unpackaged--1.0.sql
 share/postgresql/extension/pg_stat_statements.control
Index: pkg/PLIST-docs
===
RCS file: /cvs/ports/databases/postgresql/pkg/PLIST-docs,v
retrieving revision 1.86
diff -u -p -u -p -r1.86 PLIST-docs
--- pkg/PLIST-docs	9 Aug 2018 15:32:36 -	1.86
+++ pkg/PLIST-docs	8 Nov 2018 17:31:49 -
@@ -657,6 +657,7 @@ share/doc/postgresql/html/release-10-2.h
 share/doc/postgresql/html/release-10-3.html
 share/doc/postgresql/html/release-10-4.html
 share/doc/postgresql/html/release-10-5.html