public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* enable-auto-image-base with libtool not working?
@ 2005-07-16  0:42 Gerrit P. Haase
  2005-07-16  1:06 ` Gerrit P. Haase
  0 siblings, 1 reply; 5+ messages in thread
From: Gerrit P. Haase @ 2005-07-16  0:42 UTC (permalink / raw)
  To: cygwin

Hi all,

I try to integrate --enable-auto-image-base with the Gnome packages.
However I have some problems with the auto-image-base flag.

E.g. the libtool generated link command for the shared atk library:

ccache gcc -shared  .libs/atkaction.o .libs/atkcomponent.o \
.libs/atkdocument.o .libs/atkeditabletext.o \
.libs/atkgobjectaccessible.o .libs/atkhyperlink.o \
.libs/atkhypertext.o .libs/atkimage.o .libs/atknoopobject.o \
.libs/atknoopobjectfactory.o .libs/atkobject.o \
.libs/atkobjectfactory.o .libs/atkregistry.o .libs/atkrelation.o  \
.libs/atkrelationset.o .libs/atkselection.o .libs/atkstate.o \
.libs/atkstateset.o .libs/atkstreamablecontent.o .libs/atktable.o \
.libs/atktext.o .libs/atkutil.o .libs/atkvalue.o \
.libs/atk-enum-types.o  /usr/lib/libgobject-2.0.dll.a -L/usr/lib \
/usr/lib/libgmodule-2.0.dll.a /usr/lib/libglib-2.0.dll.a \
/usr/lib/libintl.dll.a /usr/lib/libiconv.dll.a  -Wl,-s \
-Wl,--enable-auto-image-base -o .libs/cygatk-1.0-0.dll \
-Wl,--image-base=0x10000000 \
-Wl,--out-implib,.libs/libatk-1.0.dll.a

I defined -W-,--enable-auto-image-base during configure.  The
flag is passed through to the linker, but libtool defines its
own image-base command.

I want that libtool doesn't override my defines, so in case
the user specifies an image-base command libtool sshouldn't
override it.

Since ld --help says:

   --enable-auto-image-base           Automatically choose image
                                      base for DLLs unless user
                                      specifies one

for this DLL is no auto-image-base calculated but the libtool
specified base is used.

$ objdump -p atk-1.9.1/.build/atk/.libs/cygatk-1.0-0.dll | fgrep ImageBase
ImageBase               10000000


What can I do to convince libtool not to override my definition?

$ ./atk-1.9.1/.build/libtool --version
ltmain.sh (GNU libtool) 1.5.18 (1.1220.2.246 2005/05/16 10:00:18)

$ ld --version
GNU ld version 2.16.91 20050610
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.


I modified libtool.m4 to issue auto-image base instead of a predefined
base address (the default 10000000).

*Now*, after applying the attached patch I got the desired link command:
ccache gcc -shared  .libs/testrelation.o  \
../atk/.libs/libatk-1.0.dll.a -L/usr/lib \
/usr/lib/libgobject-2.0.dll.a /usr/lib/libgmodule-2.0.dll.a \
/usr/lib/libglib-2.0.dll.a /usr/lib/libintl.dll.a \
/usr/lib/libiconv.dll.a  -Wl,-s -o .libs/cygtestrelation.dll \
-Wl,--enable-auto-image-base \
-Wl,--out-implib,.libs/libtestrelation.dll.a

*but* it doesn't work:
$ for in in `find atk-1.9.1/ -name "*.dll"` ; do objdump -p $i | fgrep
ImageBase ; done
ImageBase               10000000
ImageBase               10000000
ImageBase               10000000

*or* am I doing s.th. wrong with testing for the real imagebase?

I also did:

$ ccache -c
Cleaned cache

$ ccache -C
Cleared cache

and repeated the build after making clean.

The result is the same:
$ for in in `find atk-1.9.1/ -name "*.dll"` ; do objdump -p $i | fgrep 
ImageBase ; done
ImageBase               10000000
ImageBase               10000000
ImageBase               10000000


Though, building perl with the auto-image-base works ok:
$ objdump -p /usr/bin/cygperl5_8.dll | fgrep ImageBase
ImageBase               6d540000


PIBKAC?


Clueless,
Gerrit


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: enable-auto-image-base with libtool not working?
  2005-07-16  0:42 enable-auto-image-base with libtool not working? Gerrit P. Haase
@ 2005-07-16  1:06 ` Gerrit P. Haase
  2005-07-16  1:44   ` Charles Wilson
  0 siblings, 1 reply; 5+ messages in thread
From: Gerrit P. Haase @ 2005-07-16  1:06 UTC (permalink / raw)
  To: cygwin

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

Gerrit P. Haase wrote:

> Hi all,
> 
> I try to integrate --enable-auto-image-base with the Gnome packages.
> However I have some problems with the auto-image-base flag.

[...]

> The result is the same:
> $ for in in `find atk-1.9.1/ -name "*.dll"` ; do objdump -p $i | fgrep 
         ^^^^^

> ImageBase ; done
> ImageBase               10000000
> ImageBase               10000000
> ImageBase               10000000
[...]
> PIBKAC?

Oh yes, it was a typo:

$ for i in `find atk-1.9.1/ -name "*.dll"` ; do objdump -p $i | fgrep 
ImageBase  ; done
ImageBase               651c0000
ImageBase               66580000
ImageBase               61c80000

The promised patch is attached.


Gerrit
-- 
=^..^=

[-- Attachment #2: libtool.m4.auto-image-base.patch --]
[-- Type: text/plain, Size: 2850 bytes --]

--- libtool.m4~	2005-07-15 21:03:24.260676800 +0200
+++ libtool.m4	2005-07-15 21:02:44.483480000 +0200
@@ -2932,7 +2932,7 @@
     _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
     if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib'
       # If the export-symbols file already is a .def file (1st line
       # is EXPORTS), use it as is; otherwise, prepend...
       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -2941,7 +2941,7 @@
 	echo EXPORTS > $output_objdir/$soname.def;
 	cat $export_symbols >> $output_objdir/$soname.def;
       fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib'
     else
       _LT_AC_TAGVAR(ld_shlibs, $1)=no
     fi
@@ -5324,7 +5324,7 @@
       _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
 
       if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base ${wl}--out-implib,$lib'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
 	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
@@ -5333,7 +5333,7 @@
 	  echo EXPORTS > $output_objdir/$soname.def;
 	  cat $export_symbols >> $output_objdir/$soname.def;
 	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base  ${wl}--out-implib,$lib'
       else
 	_LT_AC_TAGVAR(ld_shlibs, $1)=no
       fi


[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: enable-auto-image-base with libtool not working?
  2005-07-16  1:06 ` Gerrit P. Haase
@ 2005-07-16  1:44   ` Charles Wilson
  2005-07-16 11:35     ` Gerrit P. Haase
  0 siblings, 1 reply; 5+ messages in thread
From: Charles Wilson @ 2005-07-16  1:44 UTC (permalink / raw)
  To: cygwin

Gerrit P. Haase wrote:
> Gerrit P. Haase wrote:
> 
>> Hi all,
>>
>> I try to integrate --enable-auto-image-base with the Gnome packages.
>> However I have some problems with the auto-image-base flag.

Yes, it appears that I was wrong here:
http://cygwin.com/ml/cygwin-apps/2005-07/msg00134.html

I really don't know when --image-base=0x1000000 crept back in.  Or maybe 
the patch that removed it got dropped and I never noticed 'cause things 
were working.  Sorry for the confusion.

> The promised patch is attached.
> 

ACK.

However, I'm waiting for a real resolution on the underlying question of 
what to do about DLL image bases.  It seems that auto-image-base, even 
with the recent binutils fix, is only a stop gap measure.

cgf(?) has repeatedly stated that we'l run out of address space 
eventually, whether we have some bureaucratic nightmare of a registry 
for "approved" DLL base addresses, or toss everything in to the 
auto-image-base hopper.

I still haven't seen a true "fix" for the issue proposed.  Is moving 
forward with --enable-auto-image-base as a "policy" the best we can do?

If so, I'll happily patch libtool to conform, but I think it might be 
premature to do so now.

--
Chuck

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: enable-auto-image-base with libtool not working?
  2005-07-16  1:44   ` Charles Wilson
@ 2005-07-16 11:35     ` Gerrit P. Haase
  2005-07-18 11:43       ` Jason Tishler
  0 siblings, 1 reply; 5+ messages in thread
From: Gerrit P. Haase @ 2005-07-16 11:35 UTC (permalink / raw)
  To: cygwin

Charles Wilson wrote:

> cgf(?) has repeatedly stated that we'l run out of address space 
> eventually, whether we have some bureaucratic nightmare of a registry 
> for "approved" DLL base addresses, or toss everything in to the 
> auto-image-base hopper.

I think it was Jason.  Even if there are two or three DLLs using the
same base address, it should be better than all DLLs using the same
base.


> I still haven't seen a true "fix" for the issue proposed.  Is moving 
> forward with --enable-auto-image-base as a "policy" the best we can do?

I think so.

> If so, I'll happily patch libtool to conform, but I think it might be 
> premature to do so now.

What is the default base address used by ld if no base flag is used?
I.e. isn't specifying --image-base=0x1000000 redundant because it is
the dafault base address?


Gerrit
-- 
=^..^=

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: enable-auto-image-base with libtool not working?
  2005-07-16 11:35     ` Gerrit P. Haase
@ 2005-07-18 11:43       ` Jason Tishler
  0 siblings, 0 replies; 5+ messages in thread
From: Jason Tishler @ 2005-07-18 11:43 UTC (permalink / raw)
  To: cygwin

On Sat, Jul 16, 2005 at 01:34:58PM +0200, Gerrit P. Haase wrote:
> Charles Wilson wrote:
> >cgf(?) has repeatedly stated that we'l run out of address space
> >eventually, whether we have some bureaucratic nightmare of a registry
> >for "approved" DLL base addresses, or toss everything in to the
> >auto-image-base hopper.
> 
> I think it was Jason.

Yes, it was me.

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

end of thread, other threads:[~2005-07-18 11:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-16  0:42 enable-auto-image-base with libtool not working? Gerrit P. Haase
2005-07-16  1:06 ` Gerrit P. Haase
2005-07-16  1:44   ` Charles Wilson
2005-07-16 11:35     ` Gerrit P. Haase
2005-07-18 11:43       ` Jason Tishler

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