Re: Hard links created when installing gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2024-07-16 at 14:35 -0500, Segher Boessenkool wrote:
> > Or maybe there's a good reason for the hard link! Please let me know if
> > this is the case.
> 
> Like I said, it is faster, and more efficient.  Also, symbolic links do
> not exist on all systems, did not exist on many systems GCC was used on
> long ago, so historical something?

Besides these reasons, symlinks and hard links have different behaviors.
If x is a symlink to y, replacing y (i.e. delete y and recreate it) will
cause both x and y refer to the replaced y.  But if x and y are hard
links of each other, replacing y will leave x as the old copy of y.

Generally there are more differences, like the resolve of $ORIGIN in
rpath, the target of /proc/self/exec, etc.  But AFAIK they are unlikely
to affect GCC.

Both behaviors have advantages and disadvantages, and it seems the
advantages on neither sides are decisive enough to change the upstream
GCC code (changing the upstream code essentially means "hey the
advantage of symlink is so decisive and almost everyone should use
symlink" but that's simply not true).  You can create symlinks instead
if you want, but don't be surprised if you are then hit by some
(sometimes subtle) behavior changes.

-- 
Xi Ruoyao <xry111@xxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux