[OE-core] [PATCH] openssl: add a vardeps for configure on libdir

Mark Asselstine mark.asselstine at windriver.com
Wed Mar 25 19:28:02 UTC 2015


On March 25, 2015 10:34:00 Christopher Larson wrote:
> On Wed, Mar 25, 2015 at 9:28 AM, Mark Asselstine <
> 
> mark.asselstine at windriver.com> wrote:
> > Configure makes use of 'libdir' to set 'openssldir'. Unfortunately
> > openssl treats this as a hardcoded absolute path. The value passed in
> > as openssl becomes part of header files and baked in to executables.
> > 
> > For target builds libdir is not something that changes and for -native
> > builds unless you move your builds around you will see no issue with
> > the current implementation. If you do update libdir or if you move
> > your build or reuse sstate by copying it to a new build you will start
> > to see errors. These will be seen when you use the 'openssl' tool and
> > look like the following:
> > 
> > WARNING: can't open config file: /home/build/bitbake_build/tmp/
> > 
> >                         sysroots/x86_64-linux/usr/lib/ssl/openssl.cnf
> > 
> > Knowing that openssl treats 'openssldir' as a hard coded absolute path
> > and that we set this in configure we must add a 'vardeps' to ensure
> > that things get re-configured and built whenever 'libdir' is
> > modified. This will fix both target and -native builds per the
> > usecases described above. If 'libdir' is unchanged things continue to
> > function as they did before and a re-configure will not happen.
> > 
> > Signed-off-by: Mark Asselstine <mark.asselstine at windriver.com>
> > ---
> > 
> >  meta/recipes-connectivity/openssl/openssl.inc | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/meta/recipes-connectivity/openssl/openssl.inc
> > b/meta/recipes-connectivity/openssl/openssl.inc
> > index d337017..105b3fa 100644
> > --- a/meta/recipes-connectivity/openssl/openssl.inc
> > +++ b/meta/recipes-connectivity/openssl/openssl.inc
> > @@ -54,6 +54,8 @@ do_configure_prepend_darwin () {
> > 
> >         sed -i -e '/version-script=openssl\.ld/d' Configure
> >  
> >  }
> > 
> > +do_configure[vardeps] += "${libdir}"
> 
> This really doesn't make sense. First of all, vardeps is a list of
> variables, but the expanded libdir is not a variable name. Perhaps you
> meant += "libdir"? 

My first attempt I had tried "libdir" and it doesn't seem to have the needed 
effect. I was hesitant to use other variables (such as those that libdir is 
derived from) as that would fork how -native and target builds would be 
handled. I had found other instances (meta/classes/package.bbclass) that 
seemed to use vardeps on expanded variables. At any rate I will circle back, 
your comment was not entirely unexpected, just the push that is needed for me 
to look more closely. I will follow up in a bit.

> Second, if libdir is used in do_configure, then changing
> it will already cause do_configure to be re-run, as bitbake tracks variable
> references. Only references which can't be tracked by bitbake need to be
> listed explicitly.

The observed behavior definitely supports the view that this is a case where 
it can't be tracked. It is definitely a different usage than you would find 
normally.

do_configure () {
...
    perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix \
       --openssldir=${libdir}/ssl --libdir=`basename ${libdir}` $target
}

Mark


> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics




More information about the Openembedded-core mailing list