Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 214642 - sys-libs/ncurses-5.6-r2 doesn't cross compile with USE="unicode"
Summary: sys-libs/ncurses-5.6-r2 doesn't cross compile with USE="unicode"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 234681 252530 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-25 06:56 UTC by Ryan Tandy
Modified: 2009-06-20 13:22 UTC (History)
8 users (show)

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


Attachments
patch to fix cross compilation of widec ncurses (ncurses-5.6-cross-compile.patch,1.00 KB, patch)
2008-03-25 06:57 UTC, Ryan Tandy
Details | Diff
build log (build.log,31.05 KB, text/plain)
2009-02-07 10:26 UTC, john
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Tandy 2008-03-25 06:56:23 UTC
In the widec phase of the ncurses build, the local (CBUILD) compiler is called to compile the make_hash helper program.  Since the local compiler uses a different set of CPPFLAGS than the target compiler, the cc call is missing -D_GNU_SOURCE, resulting in errors because of cchar_t not being defined.  This patch fixes that by adding the target CPPFLAGS to those used by the local compiler.
Comment 1 Ryan Tandy 2008-03-25 06:57:09 UTC
Created attachment 147222 [details, diff]
patch to fix cross compilation of widec ncurses
Comment 2 SpanKY gentoo-dev 2008-03-25 17:12:36 UTC
Comment on attachment 147222 [details, diff]
patch to fix cross compilation of widec ncurses

let's not go this route ... please locate the place where -D_GNU_SOURCE gets added to CPPFLAGS and simply update it to also add it to BUILD_CPPFLAGS
Comment 3 Ryan Tandy 2008-03-25 19:20:28 UTC
The reason I didn't do that is that -D_GNU_SOURCE is added by the CF_XOPEN_SOURCE macro (aclocal.m4:4898), which (rightly afaict) doesn't care whether or not the BUILD_CPPFLAGS variable even exists, which it wouldn't in packages that don't use CF_BUILD_CC to configure a build compiler.
Comment 4 SpanKY gentoo-dev 2008-03-26 04:14:58 UTC
hrm ... just adding CPPFLAGS to BUILD_CPPFLAGS really only works when the $build is relatively close to $host ...

maybe just ask upstream about the issue and see what they want to do about it ...
Comment 5 SpanKY gentoo-dev 2008-03-29 16:32:03 UTC
Thomas: any thoughts on how you'd like to address this ?
Comment 6 Thomas Dickey 2008-07-02 22:39:31 UTC
I hadn't considered this (since my testing with djgpp won't build wide).
Just adding CPPFLAGS does have drawbacks - will investigate.
Comment 7 Panagiotis Christopoulos (RETIRED) gentoo-dev 2008-08-14 06:56:42 UTC
*** Bug 234681 has been marked as a duplicate of this bug. ***
Comment 8 Petr Polezhaev 2008-08-19 20:10:37 UTC
There is a non-upstream patch: http://svn.exactcode.de/t2/trunk/package/base/ncurses/cross-build.patch

It may help someone sticking with this bug.
Comment 9 Maksim 'max_posedon' Melnikau 2009-02-04 18:51:16 UTC
*** Bug 252530 has been marked as a duplicate of this bug. ***
Comment 10 Maksim 'max_posedon' Melnikau 2009-02-04 18:58:34 UTC
Can this patch be pooled to portage upstream? 
It is really important for cross compiling with USE="nls unicode"

--- a/sys-libs/ncurses/ncurses-5.7.ebuild
+++ b/sys-libs/ncurses/ncurses-5.7.ebuild
@@ -26,10 +26,12 @@ src_unpack() {
        cd "${S}"
        [[ -n ${PV_SNAP} ]] && epatch "${WORKDIR}"/${MY_P}-${PV_SNAP}-patch.sh
        epatch "${FILESDIR}"/${PN}-5.6-gfbsd.patch
+       epatch "${FILESDIR}"/cross-build.patch
 }

src_compile() {
Comment 11 john 2009-02-07 10:20:38 UTC
i can confirm this bug as well, i am cross-compiling for armv4tl-softfloat-linux-gnueabi
Comment 12 john 2009-02-07 10:26:53 UTC
Created attachment 181230 [details]
build log

In reply to comments #8 and #10, build fails with this error. Compiling for armv4tl-softfloat-linux-gnueabi using crossdev-wrappers.
Comment 13 Thomas Dickey 2009-02-07 18:06:28 UTC
The place to change is not in the ncurses source, but in the ebuild script.

I'd add this to the configure flags

 --with-build-cppflags=-D_GNU_SOURCE
Comment 14 john 2009-02-08 10:42:26 UTC
I'd be happy to test, but i can't figure out where to add that, could you please enlighten me?

(In reply to comment #13)
> The place to change is not in the ncurses source, but in the ebuild script.
> 
> I'd add this to the configure flags
> 
>  --with-build-cppflags=-D_GNU_SOURCE
> 

Comment 15 john 2009-02-08 11:21:38 UTC
okay, works, here is what i did:
sys-libs/ncurses/ncurses-5.6-r2.ebuild:
 instead of local myconf="" i did
 local myconf="--with-build-cppflags=-D_GNU_SOURCE"
and emerged it, it woked nicely, the same thing doesn't work for ncurses-5.7 though.

(In reply to comment #14)
> I'd be happy to test, but i can't figure out where to add that, could you
> please enlighten me?
> 
> (In reply to comment #13)
> > The place to change is not in the ncurses source, but in the ebuild script.
> > 
> > I'd add this to the configure flags
> > 
> >  --with-build-cppflags=-D_GNU_SOURCE
> > 
> 

Comment 16 Maksim 'max_posedon' Melnikau 2009-02-08 17:31:17 UTC
your /usr/arm/glibc or cross/glibc compiled without nls support.

I don't known exactly but I think you should recompile your /usr/arm/glibc with USE="nls" flag. May be you have "gettext" dependency problem - don't afraid use built_in gettext in glibc (--nodeps).
Comment 17 Maksim 'max_posedon' Melnikau 2009-02-08 17:32:10 UTC
(In reply to comment #14)

Previous message is replying to comment #14.
Comment 18 Ryan Tandy 2009-02-08 22:42:15 UTC
(In reply to comment #13)

Thanks for the suggestion.  People wanting to test -- this change is only needed when cross-compiling, so what you want to add is something like this:

# add flags for native build, bug 214642
tc-is-cross-compiler && myconf="${myconf} --with-build-cppflags=-D_GNU_SOURCE"

somewhere between the declaration of myconf and where the compiling begins.  The ebuild already inherits toolchain-funcs so no additional inherit is needed.

(In reply to comment #15)
> it woked nicely, the same thing doesn't work for ncurses-5.7 though.

In what way did it not work?
Comment 19 thomasg 2009-06-12 18:54:14 UTC
This bug is now 4 months old and there seems to be a solution - why doesn't this go upstream?
Is it because someone reported a (most likely non-existent) bug which he didn't comment at all?
Comment 20 Maksim 'max_posedon' Melnikau 2009-06-12 18:57:31 UTC
(In reply to comment #18)
> In what way did it not work?

ncurses-5.7:
I don't know why, but it doesn't work.
Patch in comment #10 (little bit reworked - works)

What should be done, to get it upstream?
Comment 21 thomasg 2009-06-12 19:01:48 UTC
Sorry, forgot to mention, I built ncurses-5.7 with the fix on armv4t (crosscompiler on amd64) and it worked just fine.
Comment 22 Ryan Tandy 2009-06-12 19:05:21 UTC
the fix in comment #18 (the fix recommended by ncurses upstream in comment #13) is the one that should be applied, not any patch to ncurses source.  it has not been applied in portage because no one has tested it and reported back here.
Comment 23 thomasg 2009-06-12 20:59:25 UTC
In reply to #22:
To clarify: The ebuild-fix (#18) was the one I applied, WORKSFORME.
If it doesn't fail for anyone please take it upstream.
Comment 24 Ryan Tandy 2009-06-12 21:04:34 UTC
(In reply to comment #23)
> The ebuild-fix (#18) was the one I applied, WORKSFORME.

thank you.  base-system, anything else stopping this from going in-tree?
Comment 25 SpanKY gentoo-dev 2009-06-20 13:22:09 UTC
should be fixed with ncurses-5.7-r1