Re: Linking backend in one piece

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Linking backend in one piece
Date: 2008-02-22 15:15:21
Message-ID: 20080222151521.GA9392@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Here is a patch so that the backend is linked in one piece instead of using
> the SUBSYS.o files.
>
> The question is how we want to activate that. I currently used make
> BIGLINK=1, which is obviously just for testing. Should we just turn it on by
> default and see if anyone complains?

Hmm. Do we need the text file? I was kinda hoping we could just aggregate
each subdir's OBJS into a big variable listing all the needed files, and then
invoking the linker with that.

Also, the concatenating thing looks weird. Did you try using
.SECOND_EXPANSION? Sometime ago I came up with this trick to link
files from the backend into a src/bin/ subdirectory, which we use to
build a Replicator utility that links some files from the backend. It
looks like this:

# Common makefile to symlink files from the backend directory. The subdir
# makefile should define a LN_OBJS variable, listing the files it wants to
# compile from any particular backend directory, which is defined in the
# BACKEND_DIR variable. If those files are in turn inside another directory
# then use the name including that directory, and replace the / with __.
# For example, files in src/backend/access/ should be listed with
# BACKEND_DIR = access
# and the files themselves would be
# LN_OBJS = transam__xact.o gist__gistget.o
#
# Then include this file. Extra files may be declared in the variable OBJS.

mammoth_includedir=$(top_srcdir)/src/bin/mammoth/include

OBJS += $(LN_OBJS)

LN_SRC = $(LN_OBJS:.o=.c)

.SECONDEXPANSION:
$(LN_SRC): %: $$(subst __,/,$(top_srcdir)/src/backend/$(BACKEND_DIR)/%)
rm -f $@ && $(LN_S) $(subst __,/,$<) $@

I think we should be able to use something like this here.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-02-22 15:16:45 Re: Linking backend in one piece
Previous Message Alvaro Herrera 2008-02-22 14:15:06 Re: Including PL/PgSQL by default