Summary: | sys-libs/ncurses-5.6-r2: during cross-compile on comp_hash.c: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_nc_to_widechar’ (long story short: ncurses fails to cross-compile with unicode) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jacob Godserv <jacobgodserv> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED NEEDINFO | ||
Severity: | normal | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
configure patch
configure.in patch aclocal.m4 patch |
Description
Jacob Godserv
2010-01-07 05:17:04 UTC
Created attachment 215474 [details, diff]
configure patch
Created attachment 215476 [details, diff]
configure.in patch
If you want to see how it really ought to be done, here is the "proper" patch. This causes eautoreconf to fail, however, due to a custom macro AC_DIVERT_HELP.
Created attachment 215478 [details, diff]
aclocal.m4 patch
In an attempt to fix this and stick to the proper methods, I found this patch from Google to add the custom AC_DIVERT_HELP macro. eautoreconf no longer fails, but later on gcc will complain about a "stray" @VAR@.
Comment on attachment 215474 [details, diff]
configure patch
the current ncurses code is correct wrt BUILD_* initialization. when cross-compiling, you should never default to host values.
the _GNU_SOURCE issue should already be fixed via Bug 214642. if you read the ebuild, you'll see that we append that flag to the BUILD_CPPFLAGS. post the full build log as an attachment. That is actually wrong, as far as I can tell. The cross-compilation ought to be as close as possible to normal compilation. The patch I have provided includes not just the missing GNU_SOURCE flag but all the other missing includes a normal compile would receive. I compared normal vs. cross to even find the solution. (I'll get a build.log as soon as my beagle is finished with its current task.) the toolchain-independent flags that the configure script uses should probably get added to both the host and the build flags, but setting BUILD_* to the host settings when cross-compiling is wrong. end of story. you have no idea what the user has put in there and they could easily be usable only by the host toolchain. the snippet you posted doesnt include -D_GNU_SOURCE when creating make_hash ... Ah, I see... too bad there's no way to differentiate between ncurses and user defaults. Will post a build.log shortly. Unless you're positive there's no (practical) potential for a better fix here, we can close it. upstream is aware of this deficiency, but there's no way currently to cleanly solve this short of running configure twice from upstream's perspective. that's why the ebuild adds -D_GNU_SOURCE to the build flags for people. you shouldnt be seeing a build failure wrt this flag missing. |