commit: bdace9d42fa6b66f5524e1684c9a19b8d2117155
Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 11 14:26:12 2020 +0000
Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Wed Mar 11 15:47:18 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdace9d4
prefix/winnt/profile.bashrc: no symlink usr/lib/NAME.dll
While moving usr/lib/NAME.dll into usr/bin/ is necessary, creating the
symlink usr/lib/NAME.dll -> ../bin/NAME.dll is problematic, because the
libtool .exe wrapper may add usr/lib to PATH, causing the native loader
to fail when attempting to load a dll but discovering a cygwin symlink.
Also, need to resolve symlinks while moving from usr/lib into usr/bin.
Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>
profiles/prefix/windows/winnt/profile.bashrc | 30 +++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/profiles/prefix/windows/winnt/profile.bashrc
b/profiles/prefix/windows/winnt/profile.bashrc
index c613a56cd98..215ad93a943 100644
--- a/profiles/prefix/windows/winnt/profile.bashrc
+++ b/profiles/prefix/windows/winnt/profile.bashrc
@@ -175,18 +175,30 @@ winnt_post_src_install() {
eend $?
fi
done
- [[ -d usr/$(get_libdir) ]] &&
- find usr/$(get_libdir) -maxdepth 1 -type f -name '*.dll' |
- while read f
- do
- if [[ ! -f usr/bin/${f##*/} ]]; then
- ebegin "moving ${f} to usr/bin for native loader"
+ if [[ -d usr/$(get_libdir) ]]
+ then
+ # The native loader does not understand symlinks to dlls,
+ # seen to be created by dev-libs/icu eventually. For any
+ # dll we find in usr/lib we need to perform a real copy to
+ # usr/bin, to resolve potential symlinks (seen from icu),
+ # and perform the remove from usr/lib afterwards, to not
+ # break symlinks later on discovered by find.
+ local toremove=()
+ local f
+ while read f
+ do
+ [[ -f usr/bin/${f##*/} ]] && continue
+ ebegin "moving ${f} to usr/bin for the native loader"
dodir usr/bin || die
- mv -f "${f}" usr/bin/ || die
- ln -sf "../bin/${f##*/}" "${f}" || die
+ cp -f "${f}" usr/bin/ || die
eend $?
+ toremove=( "${toremove[@]}" "${f}" )
+ done < <(find usr/$(get_libdir) -maxdepth 1 -name '*.dll')
+ if [[ ${#toremove[@]} -gt 0 ]]
+ then
+ rm -f "${toremove[@]}" || die "removing dlls from
usr/$(get_libdir) failed"
fi
- done
+ fi
}
winnt_setup_dllhelper_cp() {