]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
openssl: add workaround for broken paths in native libcrypto.pc
authorEnrico Jörns <ejo@pengutronix.de>
Thu, 3 Jul 2025 13:21:05 +0000 (15:21 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 10 Jul 2025 09:46:57 +0000 (10:46 +0100)
commit4d4af8d1cb272369eb4ddcc489e90831c9c2c8c7
treecdea3ca70b16fe5240be335f9c283ed0e7bd5b6b
parent5c39fedee1dd0e101e2611b71a895c0251ba968d
openssl: add workaround for broken paths in native libcrypto.pc

Since d1b29222 ("openssl-native(sdk): poision built in paths") the
workaround for host path contamination in native(sdk) openssl is fixed.
But an unfortunate side-effect of forcing the directory variables
(OPENSSLDIR, ENGINESDIR, MODULESDIR) to be invalid is that it renders
the generated native pkg-config file (libcrypto.pc) unusable:

  [..]
  includedir=${prefix}/include
  enginesdir=${libdir}/../../../../../../../../../../../../../../../../not/builtin
  modulesdir=${libdir}/../../../../../../../../../../../../../../../../not/builtin

  Name: OpenSSL-libcrypto
  [..]

This will prevent other native tools (like libp11-native) from
installing their (.so) files into valid OpenSSL directories.

The strange paths are a result of OpenSSL's build system attempting to
resolve the dummy path "/not/builtin" relative to ${libdir} for
libcrypto.pc.in:

| enginesdir=${libdir}/{- $OpenSSL::safe::installdata::ENGINESDIR_REL_LIBDIR[0] -}

There doesn't appear to be a straightforward way to avoid embedding a
built-in host path while still generating a valid libcrypto.pc file.

This workaround now post-fixes the .pc files for openssl-native by using
two sed calls to replace the invalid paths with the valid ones.
(To prevent bitbake from early expanding the libdir variables, use a
group as a simple hack.)

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-connectivity/openssl/openssl_3.5.0.bb