Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZLjQu-0002eV-1F for pgsql-bugs@arkaria.postgresql.org; Sun, 02 Aug 2015 02:55:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZLjQt-0001MW-Hs for pgsql-bugs@arkaria.postgresql.org; Sun, 02 Aug 2015 02:55:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZLjQG-0000bg-KE for pgsql-bugs@postgresql.org; Sun, 02 Aug 2015 02:54:48 +0000 Received: from mail-pa0-x22a.google.com ([2607:f8b0:400e:c03::22a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZLjQC-0003lm-I9 for pgsql-bugs@postgresql.org; Sun, 02 Aug 2015 02:54:47 +0000 Received: by pabkd10 with SMTP id kd10so64002024pab.2 for ; Sat, 01 Aug 2015 19:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=T3fUfdBBb2KwOFY9l7ggsI4bozwYtwP6ZIzhMPxs8X0=; b=SdgYpzw7yAv/xdQHOi/WQYKtxOmPn4YNlZZfFGYji12q0YfUiyUEAfbNkIyhMHyTgg nkgFuhrw0S0ErDKUBbJv5Uk6waUTAoHRganbpRPgVYLk5RzbddWuZ8+E0xejlNR45UXN +gbb7woCiCOrK+buQIX7SjtVGnCrzshUopQEU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=T3fUfdBBb2KwOFY9l7ggsI4bozwYtwP6ZIzhMPxs8X0=; b=LZ5xERIlzDNDHNT1rGIrco7JhdaiXrRFPys6XL0HmTERF3s1omG9+OioT4TMs3OVMb 0dtbLSt2TU9bpJx/HdYQfAlG4rx+RbiKINInTnGZ3q4uAi95SsvoQEXpybGFaggfBkBF IImbe2snsv3q/5XSNW7eIkH7GCy+7U0EUlSjrBeQ/sr5JoCwMjVYHaJxyfdEYov/+QS0 eyxK6dXCqt3smNohKSY4PKyEiQAOd64CCGFjG1Xyzj1rLMvYkaSvA00K+anVdhAJIy1D pk2skSwgBYU7rclDrOIdmJAlDdpxDq7Ts9440rhfXYPIBDg+EDaxYEQg3SQXH1/1s6mM mM8g== X-Gm-Message-State: ALoCoQmr/4/8G4FiZ5nRRAfonpt2m80r27l4yCoVxi4jh6pXxukhaJB1I44tlAIUHoA8mpnFn1Mq X-Received: by 10.68.227.8 with SMTP id rw8mr10866809pbc.74.1438484080656; Sat, 01 Aug 2015 19:54:40 -0700 (PDT) Received: from tornado.leadboat.com (c-98-248-47-228.hsd1.ca.comcast.net. [98.248.47.228]) by smtp.gmail.com with ESMTPSA id zb2sm3425670pbb.46.2015.08.01.19.54.39 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 01 Aug 2015 19:54:39 -0700 (PDT) Date: Sat, 1 Aug 2015 22:54:37 -0400 From: Noah Misch To: Michael Paquier Cc: MauMau , Magnus Hagander , pgsql-bugs Subject: Re: Missing file versions for a bunch of dll/exe files in Windows builds Message-ID: <20150802025437.GA1661249@tornado.leadboat.com> References: <7E6471A0DAC54872AE6DFEB393554C77@maumau> <20140710150244.GA1942769@tornado.leadboat.com> <20140711133439.GB1947575@tornado.leadboat.com> <20140714190328.GB2088773@tornado.leadboat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <20140714190328.GB2088773@tornado.leadboat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jul 14, 2014 at 03:03:28PM -0400, Noah Misch wrote: > On Fri, Jul 11, 2014 at 11:14:54PM -0700, Michael Paquier wrote: > > On Fri, Jul 11, 2014 at 10:34 PM, Noah Misch wrote: > > > Please fix the MODULES case, perhaps by linking $(WIN32RES) into each library > > > implicitly. That idea was somewhat too broad. > > Yes, that's exactly what I did in the patch attached by linking > > WIN32RES and a shared library when the lib is built from a single .o > > file. The rule in src/makefiles/Makefile.win32 has been updated > > accordingly. pgxs.mk has been updated as well to remove WIN32RES when > > clean is invoked for MODULES. > > There remained several binaries versioned under MSVC and not versioned under > MinGW. With those fixed, I committed this work. PostgreSQL 9.5 pgxs tries to link $(WIN32RES) into any single-file module, not just in-tree modules. Unless the module happens to ship a win32ver.rc file, the build fails. MODULE_big modules are unaffected. I plan to fix this as attached, by linking $(WIN32RES) into single-file modules only when PGFILEDESC is set in the Makefile. That better aligns the GNU make build system with the heuristic in the MSVC build system's Project::AddDirResourceFile(). External modules wishing to embed a DLL icon and/or version information should provide a win32ver.rc and set PGFILEDESC. (As in released versions, MODULE_big modules must additionally mention $(WIN32RES) in OBJS.) Modules not desiring Windows file version information should leave PGFILEDESC unset. In-tree, installed modules do set PGFILEDESC; to build one using PGXS, you can first build without PGXS and preserve the generated win32ver.rc. One alternative I considered was to link with $(WIN32RES) only when PGXS is unset. That would omit version information from in-tree, single-file modules built with PGXS. Unlike my plan, it would not break builds of modules that set PGFILEDESC without intending to trigger inclusion of version information. However, a grep of the code in PGXN found no affected module. Thanks, nm --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pgxs-w32-single-file-v1.patch" diff --git a/src/makefiles/Makefile.win32 b/src/makefiles/Makefile.win32 index 176c8b9..fed1243 100644 --- a/src/makefiles/Makefile.win32 +++ b/src/makefiles/Makefile.win32 @@ -62,12 +62,18 @@ ifneq (,$(PGAPPICON)) PGICOSTR = $(subst /,\/,IDI_ICON ICON \"$(top_builddir)/src/port/$(PGAPPICON).ico\") endif +# We do not install src/port/win32ver.rc, its content being specific to +# PostgreSQL Global Development Group software. Any module can ship a +# win32ver.rc or furnish a rule for generating one. Set $(PGFILEDESC) to +# signal win32ver.rc availability to the dll build rule below. +ifndef PGXS win32ver.rc: $(top_srcdir)/src/port/win32ver.rc sed -e 's;FILEDESC;$(PGFILEDESC);' -e 's;VFT_APP;$(PGFTYPE);' -e 's;_ICO_;$(PGICOSTR);' -e 's;\(VERSION.*\),0 *$$;\1,'`date '+%y%j' | sed 's/^0*//'`';' $< >$@ +endif win32ver.o: win32ver.rc $(WINDRES) -i $< -o $@ --include-dir=$(top_builddir)/src/include --include-dir=$(srcdir) # Rule for building a shared library from a single .o file -%.dll: %.o $(WIN32RES) +%.dll: %.o $(if $(PGFILEDESC),$(WIN32RES)) $(CC) $(CFLAGS) -shared -static-libgcc -o $@ $^ -Wl,--export-all-symbols $(LDFLAGS) $(LDFLAGS_SL) $(BE_DLLLIBS) diff --git a/src/makefiles/pgxs.mk b/src/makefiles/pgxs.mk index b6874ce..2b4d684 100644 --- a/src/makefiles/pgxs.mk +++ b/src/makefiles/pgxs.mk @@ -202,7 +202,7 @@ endif # MODULE_big clean: ifdef MODULES - rm -f $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .o, $(MODULES)) $(WIN32RES) + rm -f $(addsuffix $(DLSUFFIX), $(MODULES)) $(addsuffix .o, $(MODULES)) $(if $(PGFILEDESC),$(WIN32RES)) endif ifdef DATA_built rm -f $(DATA_built) --ikeVEW9yuYc//A+q Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs --ikeVEW9yuYc//A+q--