libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rewrite try_dlopen (1)


From: Ralf Wildenhues
Subject: Re: rewrite try_dlopen (1)
Date: Mon, 4 Oct 2004 12:19:28 +0200
User-agent: Mutt/1.4.1i

Hi Gary,

* Gary V. Vaughan wrote on Mon, Oct 04, 2004 at 02:05:24AM CEST:
> Ralf Wildenhues wrote:
> >This is the first step at rewriting try_dlopen:
> >It moves the code which parses the .la file out of
> >try_dlopen in to a separate function.
> 
> Great!  This work is *so* overdue it's not funny.  Thanks for
> tackling it :-)

Sure.

> Might I suggest having a struct to hold the parsed la file, both
> to reduce the number of pass-by-reference parameters, and to make
> the function interface stable in the face of a changing .la spec.

Yes.  That was one idea.  It's orthogonal to this patch, though, and
possibly more functions can benefit from that idea.

> >I have deliberately not changed the function code
> >except for necessary pointer changes, so that the
> >change is easier to check.  I find the parsing code
> >ugly, but a rewrite should come later.  Also, I
> >think try_dlopen shall shrink further.
> 
> All good!  If you feel like making notes on a formal specification
> for .la files for a future revision, that would be even cooler ;-)

Yes.  For the semantics, I sense the discussion is not over (ever will
be?).  But for the syntax, I'm thinking along these lines:

- it must be Bourne-shell source-able.
- A line is either
    empty
    a comment (starts with #)
    or a (complete!) variable assignment.
- The right-hand side of a variable assignment should either be
    single-quoted
    or not quoted at all (and consist of one word only).
- The libltdl parsing *must* yield the same value as shell sourcing
  in case that
    no variable expansions are used ($foo)
    no shell wildcards are used (libfoo*)
    no config.status expansions are used (@foo@)
  All these cases I'd like to leave undefined (as a possible way of
  extending the defined syntax later on) for libltdl at least.
- libltdl should not crash even on bogus .la files.  This requirement
  stems from the goal of third-parties eventually being able to write
  such files.  Besides, I have a tendency of thinking of all input files
  as unverified (thus, treat them as potentially malicious).

Any objections against these?  I think they are backwards-compatible in
the sense that newer libltdl should be able to read older .la files this
way.

BTW, the rewrite process has already revealed more than one of crashing
the parsing code...  and I hate things such as sensitivity to trailing
white space (e.g. `installed=yes ').

> >2004-10-03  Ralf Wildenhues <address@hidden>
> >
> >     * libltdl/ltdl.c (try_dlopen): Move .la file parsing
> >     part.. (parse_dotla_file): ..here.  Adjust.
> 
> Now we have branched for 2.0, please commit this on HEAD. :-)

Will do so.

Regards,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]