[PATCH,cygming,buildsys] Fix remaining parts of PR40125: [1/2] libgcc
Dave Korn
dave.korn.cygwin@gmail.com
Fri Dec 24 00:32:00 GMT 2010
Hi all,
PR40125(*) is about Windows DLLs getting installed to the wrong place in
cross-compilers. By convention on windows systems, DLLs live in $prefix/bin
rather than $prefix/lib, since windows doesn't have an equivalent of
LD_LIBRARY_PATH; all shared libs have to be in the regular PATH.
That's fine for a native compiler, but for a cross-compiler, the DLLs built
are target libraries, not host ones. It doesn't make sense to install them in
$prefix/$target/bin, because that contains host binaries. What does make
plenty of sense however is to install them somewhere under
$prefix/$target/lib, since that is chock-full of target binaries already,
libraries in particular, and following some discussion in the PR audit trail
we decided toolexeclibdir was the right place.
The attached patch implements this by defining a new SHLIB_xxx variable to
pass in libgcc.mvars that contains the name of the install directory, either
bindir or toolexeclibdir; this is set by choosing one of two t-makefile frags
in config.gcc. It also adds the standard stanza for computing toolexeclibdir
in libgcc's configure, as the definition wasn't yet available there.
gcc/ChangeLog:
2010-12-22 Dave Korn <dave.korn.cygwin@gmail.com>
PR target/40125
* config.gcc (i[34567]86-*-pe | i[34567]86-*-cygwin*): Select suitable
t-dlldir{,-x} fragment for build and add it to tmake_file.
(i[34567]86-*-mingw* | x86_64-*-mingw*): Likewise.
* Makefile.in (libgcc.mvars): Also export SHLIB_DLLDIR to libgcc.
* config/i386/t-dlldir: New file.
(SHLIB_DLLDIR): Define.
* config/i386/t-dlldir-x: New file.
(SHLIB_DLLDIR): Define.
* config/i386/t-cygming: Error out if SHLIB_DLLDIR is not set.
(SHLIB_INSTALL): Use it.
libgcc/ChangeLog:
2010-12-22 Dave Korn <dave.korn.cygwin@gmail.com>
PR target/40125
* configure.ac: Call ACX_NONCANONICAL_TARGET.
(toolexecdir): Calculate and AC_SUBST.
(toolexeclibdir): Likewise.
* Makefile.in (target_noncanonical): Import.
(toolexecdir): Likewise.
(toolexeclibdir): Likewise.
* configure: Regenerate.
Tested by building and installing (to a DESTDIR) i686-pc-cygwin native, and
i686-pc-cygwin x i686-pc-mingw32 cross-compilers, and verifying that the DLLs
all got installed to the correct locations. OK?
cheers,
DaveK
--
(*) - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40125
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr40125-libgcc.diff
Type: text/x-c
Size: 8947 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101224/a3398b9b/attachment.bin>
More information about the Gcc-patches
mailing list