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?
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.
Rich.
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)?
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.
Rich.
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.
from a symlink it's clear to everyone that they are the same file. is there any reason why you prefer hardlink? anyway in the devel branch we can fix it (and the package also would be smaller).
ps. probably the prelink only goes through /usr/bin/ but not /usr/i686-pc-mingw32/bin/ that's why the size differ.
On Fri, Nov 28, 2008 at 11:44:11AM +0100, Farkas Levente wrote:
from a symlink it's clear to everyone that they are the same file. is there any reason why you prefer hardlink? anyway in the devel branch we can fix it (and the package also would be smaller).
Hard links might be a bit more robust, but really is this causing a bug? I'm very wary of changing these details of what gcc is doing. I don't understand why gcc needs to keep two copies of the binaries, and I don't understand why it puts a copy in /usr/i686-pc-mingw32/bin/ (a non-standard location), but my lack of understanding means I don't want to mess with this.
Rich.
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
Daniel P. Berrange wrote:
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.
but why not just create symlinks? is there anything what we can loose? in the %install section for all files in /usr/i686-pc-mingw32/bin can be a symlink. actually it's not cause a bug, but after hardlink it's getting confusing (i just discover this as i set the new macros and find two different bins).
from the binutils buildlog it's clear they also create link (although hard links), but then rpm forget about it:-(
here is one such part of the build log (i check all file in /usr/i686-pc-mingw32/bin are a hard link during the build process): ------------------------------------------------- mkdir -p -- /home/lfarkas/rpm/BUILDROOT/mingw32-binutils-2.18.50_20080109_2-8.fc11.i386/usr/i686-pc-mingw32/bin for i in nm-new strip-new ar ranlib dlltool objdump objcopy; do \ if [ -f $i ]; then \ j=`echo $i | sed -e 's/-new//'`; \ k=`echo $j | sed 's,^,i686-pc-mingw32-,'`; \ if [ "/usr/bin/$k" != "/usr/i686-pc-mingw32/bin/$j" ]; then \ rm -f /home/lfarkas/rpm/BUILDROOT/mingw32-binutils-2.18.50_20080109_2-8.fc11.i386/usr/i686-pc-mingw32/bin/$j; \ ln /home/lfarkas/rpm/BUILDROOT/mingw32-binutils-2.18.50_20080109_2-8.fc11.i386/usr/bin/$k /home/lfarkas/rpm/BUILDROOT/mingw32-binutils-2.18.50_20080109_2-8.fc11.i386/usr/i686-pc-mingw32/bin/$j
/dev/null 2>/dev/null \
|| /bin/sh ./libtool --mode=install /usr/bin/install -c $i /home/lfarkas/rpm/BUILDROOT/mingw32-binutils-2.18.50_20080109_2-8.fc11.i386/usr/i686-pc-mingw32/bin/$j; \ fi; \ else true; \ fi; \ done -------------------------------------------------
On Fri, Nov 28, 2008 at 03:07:15PM +0100, Farkas Levente wrote:
but why not just create symlinks? is there anything what we can loose?
We're spending a lot of time on this, but I don't understand what the bug is we're trying to fix. Sure, they don't get prelinked, but does that matter... I think changing what binutils/gcc are doing without understanding it is risky, and since there's no bug that is being fixed, what's the point?
Another thing I will add is that gcc internally calls out to /usr/i686-pc-mingw32/bin/as instead of /usr/bin/i686-pc-mingw32-as. Why does it do this? I have no idea ... But this clearly isn't a simple PATH thing.
Rich.