Summary: | net-dns/bind uses wrong openssl/opensslconf.h when cross compiling | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Janpieter Sollie <janpieter.sollie> |
Component: | Current packages | Assignee: | Mikle Kolyada (RETIRED) <zlogene> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | base-system, chutzpah, cross, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | ARM64 | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=417131 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build log of aarch64 bind compile
build log of aarch64 bind compile build.log of aarch64 openssl compile cross-emerge --target aarch4-unknown-linux-gnueabi --info net-dns/bind-9.16.21: Use ESYSROOT. Specify dlz-bdb path. (revised) net-dns/bind-9.16.21: Use ESYSROOT. Specify dlz-bdb path. |
Description
Janpieter Sollie
2021-10-26 04:23:17 UTC
COuld you please share the log of e.g. bind failing to build, and ideally the build log from openssl too? (ebuild ... clean install will help you do this). (In reply to Sam James from comment #1) > COuld you please share the log of e.g. bind failing to build, and ideally > the build log from openssl too? (ebuild ... clean install will help you do > this). do you want the openssl native build or cross compile build log? anyway, I found a workaround for this issue: 1. add the following code to /usr/include/openssl/opensslconf.h: > #elif defined(__aarch64__) > # include <aarch64-unknown-linux-gnueabi/openssl/opensslconf.h> > 2. create a symbolic link to aarch64 includes: > ln -s /usr/aarch64-unknown-linux-gnueabi/include /usr/include/aarch64-unknown-linux-gnueabi but bind still doesn't compile correctly, dlz loading causes issues, but that's probably bind/dlz and not gentoo related I'll post the bind emerge logs (In reply to Janpieter Sollie from comment #2) > (In reply to Sam James from comment #1) > > COuld you please share the log of e.g. bind failing to build, and ideally > > the build log from openssl too? (ebuild ... clean install will help you do > > this). > > do you want the openssl native build or cross compile build log? cross please if you can? > > anyway, I found a workaround for this issue: > 1. add the following code to /usr/include/openssl/opensslconf.h: > > #elif defined(__aarch64__) > > # include <aarch64-unknown-linux-gnueabi/openssl/opensslconf.h> > > 2. create a symbolic link to aarch64 includes: > > ln -s /usr/aarch64-unknown-linux-gnueabi/include /usr/include/aarch64-unknown-linux-gnueabi > but bind still doesn't compile correctly, dlz loading causes issues, but > that's probably bind/dlz and not gentoo related > I'll post the bind emerge logs Thanks for the help so far. Created attachment 746730 [details]
build log of aarch64 bind compile
Created attachment 746733 [details]
build log of aarch64 bind compile
Seems like multilib is somehow enabled, which should not be by default for crossdev. The output of the command aarch64-unknown-linux-gnueabi-emerge --info might help us also. Created attachment 746736 [details]
build.log of aarch64 openssl compile
build.log of aarch64 openssl
Created attachment 746739 [details]
cross-emerge --target aarch4-unknown-linux-gnueabi --info
(In reply to Tee KOBAYASHI from comment #6) > Seems like multilib is somehow enabled, which should not be by default for > crossdev. Could it be related to using "embedded" profile instead of default/arm64 in portage? Ah, I was wrong. The multilib in crossdev is not enabled in the first place. Never mind. The problem seems to be that when cross-emerging net-dns/bind etc. /usr/include/openssl/opensslconf.h is read where /usr/aarch64-unknown-linux-gnueabi/usr/include/openssl/opensslconf.h should be. Looks similar to what media-gfx/povray suffers from for dependency on dev-libs/boost: https://bugs.gentoo.org/810227 seems like for DLZ with berkdb, the same issue occurs in /usr/include/db.h (with the same workaround described above), but not sure whether that's another bug or the same root cause Correct, Bind's contrib/dlz/config.dlz.in is hardcoded to look in /usr/include, among other places, which is very bad. It should use pkg-config instead, or at least try that first. I don't maintain or even use Bind though, so I'll leave this to someone else. As for net-dns/bind[berkdb], we could use the configure argument --with-dlz-bdb=PATH. For prefix systems --with-dlz-bdb="${EPREFIX}"/usr would be sufficient. The problem is that this does not work correctly for crossdev environments, because "${EPREFIX}" is expanded to an empty string. Instead we need to pass as PATH something like "${EPREFIX}"/usr/${CTARGET}/usr (e.g. /usr/aarch64-unknown-linux-gnueabi/usr). (In reply to Tee KOBAYASHI from comment #14) > As for net-dns/bind[berkdb], we could use the configure argument > --with-dlz-bdb=PATH. For prefix systems --with-dlz-bdb="${EPREFIX}"/usr > would be sufficient. > > The problem is that this does not work correctly for crossdev environments, > because "${EPREFIX}" is expanded to an empty string. Instead we need to pass > as PATH something like "${EPREFIX}"/usr/${CTARGET}/usr (e.g. > /usr/aarch64-unknown-linux-gnueabi/usr). You probably want ESYSROOT for cross. Created attachment 746796 [details, diff]
net-dns/bind-9.16.21: Use ESYSROOT. Specify dlz-bdb path.
So this patch for ebuild of net-dns/bind might work.
Don't change the --prefix path, that's used for installation. Created attachment 746799 [details, diff]
(revised) net-dns/bind-9.16.21: Use ESYSROOT. Specify dlz-bdb path.
Is this OK?
Yep. I'm not sure about the effect on --with-openssl, but it's probably correct. I'd like the reporter to test this before we merge it. FWIW, the following packages (found by grepping with 'ssl.*EPREFIX') may suffer from the same issue: app-admin/apache-tools app-benchmarks/siege app-crypt/heimdal dev-db/freetds dev-java/tomcat-native dev-lang/erlang dev-lang/php dev-perl/DBD-mysql dev-tcltk/tls mail-client/alpine net-dns/bind-tools net-dns/bind net-dns/unbound net-ftp/lftp net-im/pidgin net-irc/unrealircd net-libs/ldns net-libs/neon net-mail/fetchmail net-misc/curl net-misc/stunnel www-client/elinks www-client/lynx www-client/w3mmee (In reply to Tee KOBAYASHI from comment #20) We will probably need separate bugs for any affected packages. Or at least 1 bug per maintainer. Alternatively, if someone could put a pull request together to fix the issue in all affected packages, we could probably get maintainers to sign off on them via Github. Yeah. And we will need a clever way to do that. Simply substituting ${ESYSROOT} for ${EPREFIX} does not work, as shown above. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=209d2266879aa701b67812f45aa35ed067e0ff21 commit 209d2266879aa701b67812f45aa35ed067e0ff21 Author: Sam James <sam@gentoo.org> AuthorDate: 2021-11-10 05:37:18 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-11-10 05:37:18 +0000 net-dns/bind: fix cross-compilation for openssl and berkdb Closes: https://bugs.gentoo.org/820284 Thanks-to: Tee KOBAYASHI <xtkoba@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> net-dns/bind/bind-9.16.22.ebuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d8bb09a33ef4eb06eaa82d73db423fd76654c83 commit 4d8bb09a33ef4eb06eaa82d73db423fd76654c83 Author: Sam James <sam@gentoo.org> AuthorDate: 2021-11-10 05:39:34 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-11-10 05:40:06 +0000 net-dns/bind-tools: fix cross compilation for libidn Bug: https://bugs.gentoo.org/820284 Closes: https://bugs.gentoo.org/417131 Thanks-to: Bertrand Jacquin <bertrand@jacquin.bzh> Signed-off-by: Sam James <sam@gentoo.org> net-dns/bind-tools/bind-tools-9.16.22.ebuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) |