pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: code@legitimatesounding.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15414: extension compilation fails when c++ files are named with .cc
Date: Mon, 1 Oct 2018 13:31:28 -0700
Message-ID: <20181001203128.hszyqe7g7jybxdrf@alap3.anarazel.de> (raw)
In-Reply-To: <20181001202548.tt6xc2aqu3phakly@alap3.anarazel.de>
References: <15414-df6868d261e60784@postgresql.org>
	<20181001202548.tt6xc2aqu3phakly@alap3.anarazel.de>

On 2018-10-01 13:25:48 -0700, Andres Freund wrote:
> On 2018-10-01 19:46:03 +0000, PG Bug reporting form wrote:
> > The following bug has been logged on the website:
> > 
> > Bug reference:      15414
> > Logged by:          Jerry Sievert
> > Email address:      code@legitimatesounding.com
> > PostgreSQL version: 11beta4
> > Operating system:   any
> > Description:        
> > 
> > when --with-llvm is configured, compiling c++ extensions that use .cc and
> > not .cpp fail with no rule to create .bc files.
> 
> We currently have two rules to compile .bc files from source code:
> 
> src/Makefile.global.in
> 
> %.bc : %.c
> 	$(COMPILE.c.bc) -o $@ $<
> 
> %.bc : %.cpp
> 	$(COMPILE.cxx.bc) -o $@ $<
> 
> I'm a bit worried that supporting extensions that PG itself doesn't use
> - and thus necessarily built by a buildsystem that's not just PGXS -
> will be a, let's say iterative, process.  Before v11 there wasn't a C++
> integration PGXS wise, so extensions really can't be faulted for
> developing their own PGXS extensions.
> 
> I guess we have two choices:
> 1) Add rules for ".cpp", ".cc", ".C", ".cxx", and ".c++" and whatever
>    else we can think of. Add additional variants whenever somebody
>    presents one (and backpatch it).
> 2) Insist that pg extensions follow PGXS rules, which atm are to use
>    .cpp for c++ source files.
> 
> I don't really have an opinion here.

Just to be clear, every extension can avoid that by just adding
something like:

%.bc : %.cxx
	$(COMPILE.cxx.bc) -o $@ $<

To their makefile.  It appears in plv8's case that additionally required
modifications to include some additional compiler flags - but that's
pretty fundamentally something we can't solve. If PGXS should know about
some compiler flags, it needs to be told via PG_CPPFLAGS et al.

- Andres




view thread (7+ messages)  latest in thread

Message-ID: <20181001203128.hszyqe7g7jybxdrf@alap3.anarazel.de>
Permalink:  ../20181001203128.hszyqe7g7jybxdrf@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20181001203128.hszyqe7g7jybxdrf@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@anarazel.de, code@legitimatesounding.com
  Subject: Re: BUG #15414: extension compilation fails when c++ files are named with .cc
  In-Reply-To: <20181001203128.hszyqe7g7jybxdrf@alap3.anarazel.de>
  References: <15414-df6868d261e60784@postgresql.org> <20181001202548.tt6xc2aqu3phakly@alap3.anarazel.de> <20181001203128.hszyqe7g7jybxdrf@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox