public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: Don't set HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes
@ 2012-08-25 15:58 H.J. Lu
  2012-08-25 22:27 ` Mike Frysinger
  2012-08-26 13:23 ` Paolo Bonzini
  0 siblings, 2 replies; 6+ messages in thread
From: H.J. Lu @ 2012-08-25 15:58 UTC (permalink / raw)
  To: Binutils, GCC Development, GCC Patches; +Cc: Paolo Bonzini

On Sat, Aug 25, 2012 at 8:31 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> Hi,
>
> Setting HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes causes:
>
> as: error while loading shared libraries:
> /builddir/build/BUILD/binutils/./opcodes/.libs/libopcodes-2.23.51.0.2-0.1.fc17.so:
> file too short
> make[4]: *** [gold-threads.o] Error 2
>
> when compiling gold using binutils linked with the same versions of libbfd
> and libopcodes. As far as I can tell, one can run the newly built binutils
> without setting them since libtool already sets up proper DT_RPATH.
>

The change was introduced by

http://gcc.gnu.org/ml/gcc-cvs/2005-03/msg01452.html

Paolo, do you remember the reason for this?

I tested this patch and works fine with --enable-shared for binutils.
I tested both separate build directory and in-source build.  OK
to install?

Thanks.

-- 
H.J.
----
2012-08-24  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.def (host_modules): Rmove lib_path=.libs from bfd
	and opcodes.
	* Makefile.in: Regenerated.

diff --git a/Makefile.def b/Makefile.def
index 9e41ff5..220c720 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -32,8 +32,8 @@ build_modules= { module= m4; };
 build_modules= { module= texinfo; };
 build_modules= { module= fixincludes; };

-host_modules= { module= bfd; lib_path=.libs; bootstrap=true; };
-host_modules= { module= opcodes; lib_path=.libs; bootstrap=true; };
+host_modules= { module= bfd; bootstrap=true; };
+host_modules= { module= opcodes; bootstrap=true; };
 host_modules= { module= binutils; bootstrap=true; };
 host_modules= { module= bison; no_check_cross= true; };
 host_modules= { module= cgen; };
diff --git a/Makefile.in b/Makefile.in
index 038f801..4fc4d36 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -621,7 +621,7 @@ TARGET_LIB_PATH_libgomp =
$$r/$(TARGET_SUBDIR)/libgomp/.libs:

 # This is the list of directories that may be needed in RPATH_ENVVAR
 # so that programs built for the host machine work.
-HOST_LIB_PATH =
$(HOST_LIB_PATH_bfd)$(HOST_LIB_PATH_opcodes)$(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_ppl)$(HOST_LIB_PATH_cloog)$(HOST_LIB_PATH_libelf)
+HOST_LIB_PATH =
$(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_ppl)$(HOST_LIB_PATH_cloog)$(HOST_LIB_PATH_libelf)

 # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
 @if gcc
@@ -629,16 +629,6 @@ HOST_LIB_PATH_gcc =
$$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)
 @endif gcc


-@if bfd
-HOST_LIB_PATH_bfd = \
-  $$r/$(HOST_SUBDIR)/bfd/.libs:$$r/$(HOST_SUBDIR)/prev-bfd/.libs:
-@endif bfd
-
-@if opcodes
-HOST_LIB_PATH_opcodes = \
-  $$r/$(HOST_SUBDIR)/opcodes/.libs:$$r/$(HOST_SUBDIR)/prev-opcodes/.libs:
-@endif opcodes
-
 @if gmp
 HOST_LIB_PATH_gmp = \
   $$r/$(HOST_SUBDIR)/gmp/.libs:$$r/$(HOST_SUBDIR)/prev-gmp/.libs:

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

* Re: PATCH: Don't set HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes
  2012-08-25 15:58 PATCH: Don't set HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes H.J. Lu
@ 2012-08-25 22:27 ` Mike Frysinger
  2012-08-25 22:31   ` H.J. Lu
  2012-08-26 13:23 ` Paolo Bonzini
  1 sibling, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2012-08-25 22:27 UTC (permalink / raw)
  To: binutils; +Cc: H.J. Lu, GCC Development, GCC Patches, Paolo Bonzini

[-- Attachment #1: Type: Text/Plain, Size: 1038 bytes --]

On Saturday 25 August 2012 11:58:08 H.J. Lu wrote:
> On Sat, Aug 25, 2012 at 8:31 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> > Hi,
> > 
> > Setting HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes causes:
> > 
> > as: error while loading shared libraries:
> > /builddir/build/BUILD/binutils/./opcodes/.libs/libopcodes-2.23.51.0.2-0.1
> > .fc17.so: file too short
> > make[4]: *** [gold-threads.o] Error 2
> > 
> > when compiling gold using binutils linked with the same versions of
> > libbfd and libopcodes. As far as I can tell, one can run the newly built
> > binutils without setting them since libtool already sets up proper
> > DT_RPATH.
> 
> The change was introduced by
> 
> http://gcc.gnu.org/ml/gcc-cvs/2005-03/msg01452.html
> 
> Paolo, do you remember the reason for this?
> 
> I tested this patch and works fine with --enable-shared for binutils.
> I tested both separate build directory and in-source build.  OK
> to install?

does this also fix:
http://sourceware.org/bugzilla/show_bug.cgi?id=4970
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: PATCH: Don't set HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes
  2012-08-25 22:27 ` Mike Frysinger
@ 2012-08-25 22:31   ` H.J. Lu
  2012-08-26  2:05     ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: H.J. Lu @ 2012-08-25 22:31 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils, GCC Development, GCC Patches, Paolo Bonzini

On Sat, Aug 25, 2012 at 3:27 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Saturday 25 August 2012 11:58:08 H.J. Lu wrote:
>> On Sat, Aug 25, 2012 at 8:31 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> > Hi,
>> >
>> > Setting HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes causes:
>> >
>> > as: error while loading shared libraries:
>> > /builddir/build/BUILD/binutils/./opcodes/.libs/libopcodes-2.23.51.0.2-0.1
>> > .fc17.so: file too short
>> > make[4]: *** [gold-threads.o] Error 2
>> >
>> > when compiling gold using binutils linked with the same versions of
>> > libbfd and libopcodes. As far as I can tell, one can run the newly built
>> > binutils without setting them since libtool already sets up proper
>> > DT_RPATH.
>>
>> The change was introduced by
>>
>> http://gcc.gnu.org/ml/gcc-cvs/2005-03/msg01452.html
>>
>> Paolo, do you remember the reason for this?
>>
>> I tested this patch and works fine with --enable-shared for binutils.
>> I tested both separate build directory and in-source build.  OK
>> to install?
>
> does this also fix:
> http://sourceware.org/bugzilla/show_bug.cgi?id=4970
> -mike

Yes, it should.  That is the same bug I ran into.  Please
give my patch a try.

Thanks.

-- 
H.J.

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

* Re: PATCH: Don't set HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes
  2012-08-25 22:31   ` H.J. Lu
@ 2012-08-26  2:05     ` Mike Frysinger
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2012-08-26  2:05 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils, GCC Development, GCC Patches, Paolo Bonzini

[-- Attachment #1: Type: Text/Plain, Size: 1506 bytes --]

On Saturday 25 August 2012 18:31:32 H.J. Lu wrote:
> On Sat, Aug 25, 2012 at 3:27 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> > On Saturday 25 August 2012 11:58:08 H.J. Lu wrote:
> >> On Sat, Aug 25, 2012 at 8:31 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> >> > Hi,
> >> > 
> >> > Setting HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes causes:
> >> > 
> >> > as: error while loading shared libraries:
> >> > /builddir/build/BUILD/binutils/./opcodes/.libs/libopcodes-2.23.51.0.2-
> >> > 0.1 .fc17.so: file too short
> >> > make[4]: *** [gold-threads.o] Error 2
> >> > 
> >> > when compiling gold using binutils linked with the same versions of
> >> > libbfd and libopcodes. As far as I can tell, one can run the newly
> >> > built binutils without setting them since libtool already sets up
> >> > proper DT_RPATH.
> >> 
> >> The change was introduced by
> >> 
> >> http://gcc.gnu.org/ml/gcc-cvs/2005-03/msg01452.html
> >> 
> >> Paolo, do you remember the reason for this?
> >> 
> >> I tested this patch and works fine with --enable-shared for binutils.
> >> I tested both separate build directory and in-source build.  OK
> >> to install?
> > 
> > does this also fix:
> > http://sourceware.org/bugzilla/show_bug.cgi?id=4970
> 
> Yes, it should.  That is the same bug I ran into.  Please
> give my patch a try.

yep, seems to fix the use case i described (cross-compiler with shared libs 
enabled and running the same version of binutils with shared libs on the host)
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: PATCH: Don't set HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes
  2012-08-25 15:58 PATCH: Don't set HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes H.J. Lu
  2012-08-25 22:27 ` Mike Frysinger
@ 2012-08-26 13:23 ` Paolo Bonzini
  2012-08-26 13:52   ` H.J. Lu
  1 sibling, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2012-08-26 13:23 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Binutils, GCC Development, GCC Patches

Il 25/08/2012 17:58, H.J. Lu ha scritto:
> The change was introduced by
> 
> http://gcc.gnu.org/ml/gcc-cvs/2005-03/msg01452.html
> 
> Paolo, do you remember the reason for this?

Actually, this patch came before bfd started using libtool and hence .libs.

The patch is okay if binutils always uses libtool to link programs that
require libbfd and libopcodes.  Can you check?

Paolo

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

* Re: PATCH: Don't set HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes
  2012-08-26 13:23 ` Paolo Bonzini
@ 2012-08-26 13:52   ` H.J. Lu
  0 siblings, 0 replies; 6+ messages in thread
From: H.J. Lu @ 2012-08-26 13:52 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Binutils, GCC Development, GCC Patches

On Sun, Aug 26, 2012 at 6:22 AM, Paolo Bonzini <bonzini@gnu.org> wrote:
> Il 25/08/2012 17:58, H.J. Lu ha scritto:
>> The change was introduced by
>>
>> http://gcc.gnu.org/ml/gcc-cvs/2005-03/msg01452.html
>>
>> Paolo, do you remember the reason for this?
>
> Actually, this patch came before bfd started using libtool and hence .libs.
>
> The patch is okay if binutils always uses libtool to link programs that
> require libbfd and libopcodes.  Can you check?
>

Yes, binutils always uses libtool. GDB doesn't use libtool. But it is linked
against libbfd.a and libopcodes.a when configured with --enable-shared.
I am checking it in.

-- 
H.J.

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

end of thread, other threads:[~2012-08-26 13:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-25 15:58 PATCH: Don't set HOST_LIB_PATH_bfd/HOST_LIB_PATH_opcodes H.J. Lu
2012-08-25 22:27 ` Mike Frysinger
2012-08-25 22:31   ` H.J. Lu
2012-08-26  2:05     ` Mike Frysinger
2012-08-26 13:23 ` Paolo Bonzini
2012-08-26 13:52   ` H.J. Lu

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