Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 731120 - dev-lang/tcl: TCL_INCLUDE_SPEC='-I/usr/include' breaks cross-compilation of other packages
Summary: dev-lang/tcl: TCL_INCLUDE_SPEC='-I/usr/include' breaks cross-compilation of o...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: TCL/TK Project
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-07-06 19:37 UTC by Allen Webb
Modified: 2021-03-06 16:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (dev-db:sqlite-3.32.3:20200706-142718.log,37.25 KB, text/plain)
2020-07-06 19:38 UTC, Allen Webb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Allen Webb 2020-07-06 19:37:24 UTC
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
Comment 1 Allen Webb 2020-07-06 19:38:31 UTC
Created attachment 648056 [details]
Build log
Comment 2 Allen Webb 2020-07-06 19:39:43 UTC
I am going to try to get steps to reproduce this on vanilla gentoo.
Comment 3 Arfrever Frehtes Taifersar Arahesis 2020-07-06 22:41:23 UTC
-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?
Comment 4 Arfrever Frehtes Taifersar Arahesis 2020-07-06 23:44:43 UTC
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=''
Comment 5 Allen Webb 2020-07-13 15:54:57 UTC
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
Comment 6 Arfrever Frehtes Taifersar Arahesis 2020-07-15 08:07:59 UTC
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?
Comment 7 Allen Webb 2020-07-15 14:00:42 UTC
With both changes yes, cross compilation is working. I have uploaded pull requests with those changes.
Comment 8 Larry the Git Cow gentoo-dev 2020-07-15 18:16:42 UTC
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(-)
Comment 9 Larry the Git Cow gentoo-dev 2020-07-15 19:22:00 UTC
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(+)
Comment 10 Allen Webb 2020-07-15 19:26:12 UTC
Thanks. This is at least fixed for the unstable version of dev-lang/tcl now.
Comment 11 Arfrever Frehtes Taifersar Arahesis 2021-03-06 16:50:41 UTC
*** Bug 773967 has been marked as a duplicate of this bug. ***