public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* [PATCH,cygming,buildsys] Fix remaining parts of PR40125: [2/2] libffi
@ 2010-12-23 21:33 Dave Korn
  2011-01-21  5:05 ` [PING] " Dave Korn
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Korn @ 2010-12-23 21:33 UTC (permalink / raw)
  To: GCC Patches, libffi-discuss, Anthony Green

[-- Attachment #1: Type: text/plain, Size: 1922 bytes --]


    Hi all,

  GCC 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.

  This patch fixes the problem by passing an appropriate -bindir argument in
the cygwin/mingw libtool flags, based on with_cross_host.  It fixes the
problem only for GCC at the moment, as upstream libffi still uses an older
version of libtool from before the -bindir argument was implemented; thus,
this patch will make no difference to libffi at present, which will still have
the old default libtool behaviour of placing DLLs into $(libdir)/../bin.  When
libffi next upgrades its libtool, it should just work.

libffi/ChangeLog:

2010-12-22  Dave Korn  <dave.korn.cygwin@gmail.com>

	PR target/40125
	* configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs.
	* 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, and also by building upstream
libffi (the same patch applies cleanly to both GCC and upstream) and verifying
that nothing changed.  Is this OK?

    cheers,
      DaveK
-- 
(*) - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40125


[-- Attachment #2: pr40125-libffi.diff --]
[-- Type: text/x-c, Size: 1756 bytes --]

Index: libffi/configure
===================================================================
--- libffi/configure	(revision 167484)
+++ libffi/configure	(working copy)
@@ -11359,8 +11359,15 @@ case "$host" in
 	;;
   i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2*)
 	TARGET=X86_WIN32; TARGETDIR=x86
-	# All mingw/cygwin/win32 builds require this for sharedlib
-	AM_LTLDFLAGS="-no-undefined"
+	# All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
+	# We must also check with_cross_host to decide if this is a native
+	# or cross-build and select where to install dlls appropriately.
+	if test -n "$with_cross_host" &&
+	   test x"$with_cross_host" != x"no"; then
+	  AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
+	else
+	  AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
+	fi
 	;;
   i?86-*-darwin*)
 	TARGET=X86_DARWIN; TARGETDIR=x86
Index: libffi/configure.ac
===================================================================
--- libffi/configure.ac	(revision 167484)
+++ libffi/configure.ac	(working copy)
@@ -82,8 +82,15 @@ case "$host" in
 	;;
   i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2*)
 	TARGET=X86_WIN32; TARGETDIR=x86
-	# All mingw/cygwin/win32 builds require this for sharedlib
-	AM_LTLDFLAGS="-no-undefined"
+	# All mingw/cygwin/win32 builds require -no-undefined for sharedlib.
+	# We must also check with_cross_host to decide if this is a native
+	# or cross-build and select where to install dlls appropriately.
+	if test -n "$with_cross_host" &&
+	   test x"$with_cross_host" != x"no"; then
+	  AM_LTLDFLAGS='-no-undefined -bindir "$(toolexeclibdir)"';
+	else
+	  AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"';
+	fi
 	;;
   i?86-*-darwin*)
 	TARGET=X86_DARWIN; TARGETDIR=x86


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PING] Re: [PATCH,cygming,buildsys] Fix remaining parts of PR40125: [2/2] libffi
  2010-12-23 21:33 [PATCH,cygming,buildsys] Fix remaining parts of PR40125: [2/2] libffi Dave Korn
@ 2011-01-21  5:05 ` Dave Korn
  2011-01-21 15:36   ` Anthony Green
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Korn @ 2011-01-21  5:05 UTC (permalink / raw)
  To: GCC Patches, libffi-discuss, Anthony Green

On 23/12/2010 21:57, Dave Korn wrote:

> libffi/ChangeLog:
> 
> 2010-12-22  Dave Korn  <dave.korn.cygwin@gmail.com>
> 
> 	PR target/40125
> 	* configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs.
> 	* configure: Regenerate.

  Ping?

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PING] Re: [PATCH,cygming,buildsys] Fix remaining parts of PR40125: [2/2] libffi
  2011-01-21  5:05 ` [PING] " Dave Korn
@ 2011-01-21 15:36   ` Anthony Green
  2011-01-26  3:33     ` Dave Korn
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Green @ 2011-01-21 15:36 UTC (permalink / raw)
  To: Dave Korn; +Cc: GCC Patches, libffi-discuss

Dave Korn <dave.korn.cygwin@gmail.com> writes:

> On 23/12/2010 21:57, Dave Korn wrote:
>
>> libffi/ChangeLog:
>> 
>> 2010-12-22  Dave Korn  <dave.korn.cygwin@gmail.com>
>> 
>> 	PR target/40125
>> 	* configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs.
>> 	* configure: Regenerate.
>
>   Ping?

Please apply to the GCC tree.

Thanks!

AG


>
>     cheers,
>       DaveK

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PING] Re: [PATCH,cygming,buildsys] Fix remaining parts of PR40125: [2/2] libffi
  2011-01-21 15:36   ` Anthony Green
@ 2011-01-26  3:33     ` Dave Korn
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Korn @ 2011-01-26  3:33 UTC (permalink / raw)
  To: Anthony Green; +Cc: GCC Patches, libffi-discuss

On 21/01/2011 15:36, Anthony Green wrote:
> Dave Korn <dave.korn.cygwin@gmail.com> writes:
> 
>> On 23/12/2010 21:57, Dave Korn wrote:
>>
>>> libffi/ChangeLog:
>>>
>>> 2010-12-22  Dave Korn  <dave.korn.cygwin@gmail.com>
>>>
>>> 	PR target/40125
>>> 	* configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs.
>>> 	* configure: Regenerate.
>>   Ping?
> 
> Please apply to the GCC tree.

  Thank you, committed revision 169272.

    cheers,
      DaveK

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-26  3:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-23 21:33 [PATCH,cygming,buildsys] Fix remaining parts of PR40125: [2/2] libffi Dave Korn
2011-01-21  5:05 ` [PING] " Dave Korn
2011-01-21 15:36   ` Anthony Green
2011-01-26  3:33     ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).