Re: Cross-compiling under linux for Windows

From: Markku Tavasti <tavasti(at)tavastisolutions(dot)com>
To: pgsql-ports(at)postgresql(dot)org
Subject: Re: Cross-compiling under linux for Windows
Date: 2006-07-06 14:48:33
Message-ID: m2k66qbxha.fsf@aladobix.i.tavastisolutions.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports

Markku Tavasti <tavasti(at)tavastisolutions(dot)com> writes:

> - I have to run i586-mingw32msvc-ranlib manually for
> src/port/libpgport.a and src/port/libpgport_srv.a
> - have to edit few makefiles to change windres to 586-mingw32msvc-windres
>
> In fact all I would essentially need is static libpq.a, but even that doesn't
> look very good:
>
> -rw-rw-r-- 1 tavasti tavasti 8 Jun 28 10:55 libpq.a

At least one problem was here:

0
tavasti(at)aladobix:~/work/postgres/postgresql-8.1.4/src/interfaces/libpq$make
ar crs libpq.a `lorder fe-auth.o fe-connect.o fe-exec.o fe-misc.o \
fe-print.o fe-lobj.o fe-protocol2.o fe-protocol3.o pqexpbuffer.o \
pqsignal.o fe-secure.o md5.o ip.o wchar.o encnames.o noblock.o \
pgstrcasecmp.o thread.o crypt.o inet_aton.o getaddrinfo.o open.o \
snprintf.o win32.o libpqrc.o | tsort`
nm: fe-auth.o: File format not recognized ...

Running lorder to find what to link is problem. lorder did not
understand file format, so nothing get's into the library.

This works:

ar crs libpq.a fe-auth.o fe-connect.o fe-exec.o fe-misc.o fe-print.o \
fe-lobj.o fe-protocol2.o fe-protocol3.o pqexpbuffer.o pqsignal.o \
fe-secure.o md5.o ip.o wchar.o encnames.o noblock.o pgstrcasecmp.o \
thread.o crypt.o inet_aton.o getaddrinfo.o open.o snprintf.o win32.o \
libpqrc.o

So I got what I needed, so I didn't start checking whole build system
to make it cross-compiling compatible. Hopefully this helps someone
else in future.

--
M. Tavasti / tavasti(at)tavastisolutions(dot)com / +358-40-5078254

In response to

Browse pgsql-ports by date

  From Date Subject
Next Message ben sewell 2006-07-17 12:35:25 MS Access to PostgreSQL Migration
Previous Message Tom Lane 2006-07-03 03:39:13 Re: PostgreSQL and Kerberos 5 on Solaris