Re: pgsql: Use --disable-auto-import linker switch in Mingw builds, too. - Mailing list pgsql-committers

From Andrew Dunstan
Subject Re: pgsql: Use --disable-auto-import linker switch in Mingw builds, too.
Date
Msg-id 52FF7DEC.30405@dunslane.net
Whole thread Raw
In response to Re: pgsql: Use --disable-auto-import linker switch in Mingw builds, too.  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: pgsql: Use --disable-auto-import linker switch in Mingw builds, too.  (Andres Freund <andres@2ndquadrant.com>)
Re: pgsql: Use --disable-auto-import linker switch in Mingw builds, too.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On 02/14/2014 08:18 PM, Andres Freund wrote:
> On 2014-02-14 19:44:11 -0500, Andrew Dunstan wrote:
>> On 02/12/2014 12:04 PM, Tom Lane wrote:
>>> Use --disable-auto-import linker switch in Mingw builds, too.
>>>
>>> This is evidently the default on buildfarm member narwhal, but that
>>> is a pretty ancient Mingw version, and there is reason to think that
>>> more recent versions of GNU ld have this feature turned on by default.
>>> Since we are trying to achieve consistency of link behavior across
>>> all Windows toolchains, let's just make sure here.
>>
>> This appears to have broken configure on jacana (probably the most modern
>> Mingw animal we have).
> According to a quick search that's caused by a bug in mingw...
>
> http://sourceforge.net/p/mingw/bugs/2020/ and some others.
>
> Any chance you could update to a slighly newer version?


This is not the mingw compiler, it's the mingw-w64 compiler, a subtle
difference.

I installed the compiler from

<http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-release>

and it got over this hurdle. Interestingly it says it's gcc 4.8.0, while
the failing version claimed to be 4.8.1, even though this one is dated
quite a lot later.

However, the build now fails like this:

    make[1]: Entering directory
    `/home/pgrunner/bf/root/HEAD/pgsql.6024/contrib/pg_buffercache'
    x86_64-w64-mingw32-gcc -O2 -Wall -Wmissing-prototypes
    -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
    -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
    -fwrapv -fexcess-precision=standard -g  -I.
    -I/home/pgrunner/bf/root/HEAD/pgsql.6024/../pgsql/contrib/pg_buffercache
    -I../../src/include
    -I/home/pgrunner/bf/root/HEAD/pgsql.6024/../pgsql/src/include
    -I../pgsql/src/include/port/win32 -DEXEC_BACKEND
    -I/c/prog/3p64/include/libxml2  -I/c/prog/3p64/include
    -I/c/prog/3p64/openssl/include
    "-I/home/pgrunner/bf/root/HEAD/pgsql.6024/../pgsql/src/include/port/win32"
    -c -o pg_buffercache_pages.o
    /home/pgrunner/bf/root/HEAD/pgsql.6024/../pgsql/contrib/pg_buffercache/pg_buffercache_pages.c
    x86_64-w64-mingw32-gcc -O2 -Wall -Wmissing-prototypes
    -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
    -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing
    -fwrapv -fexcess-precision=standard -g   -shared -o
    pg_buffercache.dll  pg_buffercache_pages.o -L../../src/port
    -L../../src/common -Wl,--allow-multiple-definition
    -Wl,--disable-auto-import -L/c/prog/3p64/lib  -L/c/prog/3p64/lib
    -L/c/prog/3p64/openssl/lib/VC -Wl,--as-needed -L../../src/backend
    -lpostgres -lpgcommon -lpgport -lintl -lxslt -lxml2 -lz -lwsock32
    -lm  -lws2_32 -lshfolder -Wl,--export-all-symbols
    -Wl,--out-implib=libpg_buffercache.a
    pg_buffercache_pages.o: In function `pg_buffercache_pages':
    c:/MinGW/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.6024/../pgsql/contrib/pg_buffercache/pg_buffercache_pages.c:119:
    undefined reference to `MainLWLockArray'
    c:/MinGW/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.6024/../pgsql/contrib/pg_buffercache/pg_buffercache_pages.c:160:
    undefined reference to `MainLWLockArray'
    collect2.exe: error: ld returned 1 exit status
    make[1]: *** [pg_buffercache.dll] Error 1
    make[1]: Leaving directory
    `/home/pgrunner/bf/root/HEAD/pgsql.6024/contrib/pg_buffercache'


Note that by this time "make check" has already passed.

cheers

andrew




>
> Greetings,
>
> Andres Freund
>



pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: pgsql: psql: Add C comment about gset_prefix being freed later
Next
From: Andres Freund
Date:
Subject: Re: pgsql: Use --disable-auto-import linker switch in Mingw builds, too.