pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gene Selkov Jr. <selkovjr@mcs.anl.gov>
To: Michael Olivier <molivier@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] binary operators / C func getting "invalid ELF header"
Date: Mon, 18 Jan 1999 20:47:25 -0500
Message-ID: <199901190245.UAA00925@mail.xnet.com> (raw)
In-Reply-To: <19990119005130.1209.rocketmail@send105.yahoomail.com>

> 
> I've gone down the path of trying to write a C function to
> do this... and am getting this error:
> 
>     db=3D> select not_a_and__a_xor_b(1,1);
>     ERROR:  Load of file /home/michael/sql/funcs.so failed:
>      =A8=B8t@=A8=B8t@chael/sql/funcs.so: invalid ELF header
> 
> I'm compiling with the -fpic option for Linux (under gcc)
> 
>     cc -c -O2 -fpic -g -I. -I./include -I. -I./include  -c funcs.c -o
> funcs.o
>     /bin/rm -f funcs.so
>     /usr/bin/ar cr funcs.so funcs.o =20

Try to adapt the Makefile from src/tutorial to your purposes. Make sure it includes the right
rules by changing

SRCDIR= ..
include ../Makefile.global

to:

SRCDIR= /path/to/your/postgres/source/tree/src
include $(SRCDIR)/Makefile.global

Then name your target files in $(DLOBJS).

You may also want to note the sed rules that substitute anchors such
as _OBJWD_ with the absolute path. They make your sql scripts more
portable (see funcs.source for example.

--Gene



view thread (6+ messages)  latest in thread

Message-ID: <199901190245.UAA00925@mail.xnet.com>
Permalink:  ../199901190245.UAA00925@mail.xnet.com/
Also on:    postgresql.org/message-id/199901190245.UAA00925@mail.xnet.com

 · 

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-sql@postgresql.org
  Cc: selkovjr@mcs.anl.gov, molivier@yahoo.com
  Subject: Re: [SQL] binary operators / C func getting "invalid ELF header"
  In-Reply-To: <199901190245.UAA00925@mail.xnet.com>
  References: <19990119005130.1209.rocketmail@send105.yahoomail.com> <199901190245.UAA00925@mail.xnet.com>

* 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