Thread: Re: [HACKERS] Should libedit be preferred to libreadline?

Re: [HACKERS] Should libedit be preferred to libreadline?

From
"Zeugswetter Andreas DCP SD"
Date:
> With AIX 5, the easiest way to get a shared object is to pass
"-bexpall"
> to the linker. This results in all symbols being exported.

Yes, that is another reason not to use this broken switch.
And last time I checked (AIX 4.3.3), -bexpall did not export all needed
symbols
(e.g. globals) from the backend eighter. And the counterpart -bimpall
did also not work.
Dynamic loading did not work without the .imp and .exp files :-(

Andreas

PS: I'd prefer if readline was only linked where it is needed, namely in
psql.

Re: [HACKERS] Should libedit be preferred to libreadline?

From
Martijn van Oosterhout
Date:
On Tue, Nov 22, 2005 at 10:07:15AM +0100, Zeugswetter Andreas DCP SD wrote:
> PS: I'd prefer if readline was only linked where it is needed, namely in
> psql.

The problem as stated is that people don't want to maintain lists of
libraries as needed by each program, so we link all of them.

Since it seems to always be the same few libraries that cause us
problems, maybe a simpler approach would be to, in the Makefile, use
filter-out to exclude libraries you *know* aren't needed. Like in the
Makefile we put:

postgres: $(OBJS)
        $(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(filter-out -lreadline -ledit, $(LIBS)) -o $@

So instead of maintaining lists of what each binary needs, we can
maintain a few lists of what certain binaries *don't* need. Actually, I
think the backend is the only thing important enough to worry about
this, although if readline is exporting memcpy that it's quite possible
other binaries might be affected. Maybe create a BACKEND_LIBS which
contains a shorter list.

Even the GCC --as-needed flag can't save you from libs exporting
functions they shouldn't...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Re: [HACKERS] Should libedit be preferred to libreadline?

From
Bruce Momjian
Date:
Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> On Tue, Nov 22, 2005 at 10:07:15AM +0100, Zeugswetter Andreas DCP SD wrote:
> > PS: I'd prefer if readline was only linked where it is needed, namely in
> > psql.
>
> The problem as stated is that people don't want to maintain lists of
> libraries as needed by each program, so we link all of them.
>
> Since it seems to always be the same few libraries that cause us
> problems, maybe a simpler approach would be to, in the Makefile, use
> filter-out to exclude libraries you *know* aren't needed. Like in the
> Makefile we put:
>
> postgres: $(OBJS)
>         $(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(filter-out -lreadline -ledit, $(LIBS)) -o $@

Agreed.  I have no idea why this has not been done already.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073