Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 631468 - sys-libs/ncurses: mingw-w64 library bugs
Summary: sys-libs/ncurses: mingw-w64 library bugs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-20 06:32 UTC by hanetzer
Modified: 2023-01-02 00:31 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hanetzer 2017-09-20 06:32:26 UTC
When building sys-libs/ncurses-6.0-r1 using a crossdev created toolchain and portage tree there are a number of issues relating to the resultant libraries.

1. if the static-libs use flag is not set, all files matching '*.a' are deleted,
which is problematic on mingw-w64 as for every lib*.dll file there is a matching lib*.dll.a file which is used for linking; with these deleted you cannot link to the dlls.

2. the ebuild unconditionally makes a symlink from
$EPREFIX/usr/lib/libncurses.dll to $EPREFIX/usr/lib/libcurses.dll, which both actually live in
$EPREFIX/usr/bin/libncurses6.dll and $EPREFIX/usr/bin/libcurses6.dll respectively.
Comment 1 hanetzer 2017-09-20 06:52:33 UTC
In fact, after a little investigation it seems that the ncurses curses link is only a linktime convenience. Linking a test linux ncurses application with
-lcurses and running ldd against it shows it to depend on libncurses.so.6, which
would be libncurses6.dll on mingw-w64; so, that symlink should be as follows:
$EPREFIX/usr/lib/libcurses.dll.a -> $EPREFIX/usr/lib/libncurses.dll.a
Comment 2 hanetzer 2017-09-20 07:06:41 UTC
changing:
find "${ED}"/usr/ -name '*.a' -delete
to:
find "${ED}"/usr/ -name '*.a' ! -name '*.dll.a' -delete
will fix the static-libs issue, would that be an acceptable change?
Comment 3 Arfrever Frehtes Taifersar Arahesis 2017-09-20 13:26:50 UTC
There might be many packages which delete *.a files.
Please discuss generic solution on gentoo-dev mailing list.
Comment 4 hanetzer 2017-09-20 19:24:37 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #3)
> There might be many packages which delete *.a files.
> Please discuss generic solution on gentoo-dev mailing list.

Yes, I've thought of that and I've been git grepping the portage tree to see what I can find regarding this. so far, I've only seen a few that may fall into this category. Mostly its packages which have no sane sort of --enable-static or the like setup to prevent them from being created/installed in the first place.
Comment 5 hanetzer 2017-09-28 03:24:53 UTC
See also the following sys-libs/zlib bug, its effectively the same issue:
https://bugs.gentoo.org/419645
Comment 6 Larry the Git Cow gentoo-dev 2018-03-28 07:47:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc3a9c5ebff98664ab50c9a8ff4e136bea9bd0db

commit fc3a9c5ebff98664ab50c9a8ff4e136bea9bd0db
Author:     Marty E. Plummer <hanetzer@protonmail.com>
AuthorDate: 2017-09-20 09:09:33 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2018-03-28 07:46:50 +0000

    sys-libs/ncurses: fix mingw-w64 build and runtime
    
    *.dll.a files are required for linking on mingw-w64 targets, only delete
    normal static libraries.
    
    --enable-term-driver is required on mingw-w64, otherwise you get a host
    of undefined reference to `_nc_*' errors, and possibly other windows
    platforms/runtimes/toolchains.
    
    Bug: https://bugs.gentoo.org/631468
    Bug: https://bugs.gentoo.org/639670
    Package-Manager: Portage-2.3.10, Repoman-2.3.3
    Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/5734

 sys-libs/ncurses/ncurses-6.0-r2.ebuild | 8 +++++++-
 sys-libs/ncurses/ncurses-6.1-r2.ebuild | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)}
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-10-14 05:34:02 UTC Comment hidden (obsolete)