I tried building sqlite-3.32.3 and it works for a local build but when cross compiling I get the following error: sqlite-3.32.3: error: include location '/usr/include' is unsafe for cross-compilation [-Werror,-Wpoison-system-directories] sqlite-3.32.3: In file included from sqlite3.c:26208: sqlite-3.32.3: /usr/include/pthread.h:744:12: warning: declaration of built-in function '__sigsetjmp' requires the declaration of the 'jmp_buf' type, commonly provided in the header <setjmp.h>. [-Wincomplete-setjmp-declaration] sqlite-3.32.3: extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; sqlite-3.32.3: ^ sqlite-3.32.3: 1 warning and 1 error generated. sqlite-3.32.3: make: *** [Makefile:787: sqlite3.lo] Error 1 Reproducible: Always
Created attachment 648056 [details] Build log
I am going to try to get steps to reproduce this on vanilla gentoo.
-I/usr/include is used equally used in this version and older versions of dev-db/sqlite. Building with normal GCC or normal Clang works for me. I have no cross-compilers here. Maybe error is only printed by cross Clang. Does cross GCC print error?
Source of -I/usr/include is TCL_INCLUDE_SPEC from dev-lang/tcl: /usr/lib32/tclConfig.sh:TCL_INCLUDE_SPEC='-I/usr/include' /usr/lib64/tclConfig.sh:TCL_INCLUDE_SPEC='-I/usr/include' (dev-db/sqlite and possibly other packages use TCL_INCLUDE_SPEC.) Since explicit -I/usr/include or -I${EPREFIX}/usr/include is not needed and harmful, dev-lang/tcl needs to be fixed to have: TCL_INCLUDE_SPEC=''
I tried to locally patch tcl and it isn't enough to replace TCL_INCLUDE_SPEC because doing so results in the error: error: include location '/usr/include/readline' is unsafe for cross-compilation
In sqlite-3.32.3.ebuild, after changing: - options+=(--with-readline-inc="-I${EPREFIX}/usr/include/readline") + options+=(--with-readline-inc="-I${ESYSROOT}/usr/include/readline") Is cross-compilation working?
With both changes yes, cross compilation is working. I have uploaded pull requests with those changes.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01a1579065af8a6e95e437077a5d734dd21c83dd commit 01a1579065af8a6e95e437077a5d734dd21c83dd Author: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> AuthorDate: 2020-07-15 16:31:29 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2020-07-15 18:16:21 +0000 dev-db/sqlite: Use ${ESYSROOT} for Readline headers directory. Bug: https://bugs.gentoo.org/731120 Closes: https://github.com/gentoo/gentoo/pull/16707 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Mike Gilbert <floppym@gentoo.org> dev-db/sqlite/sqlite-3.31.1.ebuild | 2 +- dev-db/sqlite/sqlite-3.32.3.ebuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38b2d044a1eac3ddb57cb250264f5e9dfa50ba96 commit 38b2d044a1eac3ddb57cb250264f5e9dfa50ba96 Author: Allen Webb <allenwebb@google.com> AuthorDate: 2020-07-15 13:44:19 +0000 Commit: Alfredo Tupone <tupone@gentoo.org> CommitDate: 2020-07-15 19:21:39 +0000 dev-lang/tcl: Fix cross compilation by not setting include directory. Bug: https://bugs.gentoo.org/731120 Signed-off-by: Allen Webb <allenwebb@google.com> Signed-off-by: Alfredo Tupone <tupone@gentoo.org> dev-lang/tcl/files/tcl-8.6.9-include-spec.patch | 12 ++++++++++++ dev-lang/tcl/{tcl-8.6.9.ebuild => tcl-8.6.9-r1.ebuild} | 1 + 2 files changed, 13 insertions(+)
Thanks. This is at least fixed for the unstable version of dev-lang/tcl now.
*** Bug 773967 has been marked as a duplicate of this bug. ***