what's the difference

Daniel P. Berrange berrange at redhat.com
Fri Nov 28 12:18:47 UTC 2008


On Fri, Nov 28, 2008 at 09:24:32AM +0000, Richard W.M. Jones wrote:
> On Thu, Nov 27, 2008 at 09:45:59PM +0100, Farkas Levente wrote:
> > Richard W.M. Jones wrote:
> > > On Thu, Nov 27, 2008 at 08:37:31PM +0100, Farkas Levente wrote:
> > >> hi,
> > >> what's the difference between file eg
> > >> /usr/i686-pc-mingw32/bin/ar
> > >> /usr/bin/i686-pc-mingw32-ar
> > >> they have different size?
> > >> actually all file in /usr/i686-pc-mingw32/bin/ has a pair in /usr/bin/
> > >> with different size (and not link to each other). is this intentional or
> > >> just some kind of accident?
> > > 
> > > I suspect they start out the same, but prelink stupidity kicks in.
> > > 
> > > $ rpm -qlvp mingw32-binutils-2.18.50_20080109_2-8.fc9.x86_64.rpm | grep ar\$
> > > -rwxr-xr-x    2 root    root                   622560 Sep 24 16:52 /usr/bin/i686-pc-mingw32-ar
> > > -rwxr-xr-x    2 root    root                   622560 Sep 24 16:52 /usr/i686-pc-mingw32/bin/ar
> > > 
> > > Unfortunately although I keep going on about how prelink is the most
> > > completely broken concept ever, it persists in all versions of Fedora.
> > 
> > wouldn't it be better to make one of them to symlink to the other?
> > actually all files in /usr/bin can be a symlink to
> > /usr/i686-pc-mingw32/bin/.
> > just to make things cleaner (should i send a patch)?
> 
> Perhaps a hard link, but if it's not causing any actual bug, I'd
> rather leave it how it is.

It is definitely prelink that changes them. On a fresh install

 # md5sum  /usr/bin/i686-pc-mingw32-ar
 867a776ce5e7e2f8ce42b956225a30dc  /usr/bin/i686-pc-mingw32-ar
 # md5sum  /usr/i686-pc-mingw32/bin/ar
 867a776ce5e7e2f8ce42b956225a30dc  /usr/i686-pc-mingw32/bin/ar

Run prelink manually and then

 # md5sum /usr/bin/i686-pc-mingw32-ar
 9219ea79ba017946f3de4165a3ba0c1d  /usr/bin/i686-pc-mingw32-ar

And undo the prelink
 
 # prelink -u /usr/bin/i686-pc-mingw32-ar
 # md5sum /usr/bin/i686-pc-mingw32-ar
 867a776ce5e7e2f8ce42b956225a30dc  /usr/bin/i686-pc-mingw32-ar


I expect the reason for the 2nd copy of everything in /usr/i686-pc-mingw32/bin
is to allow people to just set $PATH to their cross-toolchain for apps
with broken build systems hardcoding tool names without the prefix.

Hard linking won't help, because when the binary is prelinked, the hardlink
will be broken.

Really we should be adding a file mingw.conf in /etc/prelink.conf.d
containing

   -l /usr/i686-pc-mingw32/bin

So that our custom /bin directory with native binaries is processed.


NB, we do *not* need to add /usr/i686-pc-mingw32/sysroot/mingw/bin since
that does not have native binaries.

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|



More information about the mingw mailing list