On 16 March 2017 at 22:11, Kevin Kofler <kevin.kof...@chello.at> wrote:
[..]

> FYI, this is what Mandriva (back then), now Mageia and OpenMandriva, have
> been doing for years (and still do).
>
> https://wiki.mageia.org/en/Overlinking_issues_in_packaging
>
> > As long as I've done many times full recompilation on the scale of whole
> > distribution in the past I know that sometimes is necessary to add small
> > linker fix when library X is linked with other libraries A and B and only
> > A is used and linked executable is using libX and libB ABI but has no -lB
> > in linker options, but majority of those changes have been already merged
> > to most of the packages source trees.
>
> Indeed, the folks involved in the Mandriva --as-needed migration reported
> that the effort required was similar to the one for the "no more transitive
> linking" change
> https://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking
> in Fedora (since Fedora 13) that you are alluding to.
>

I've started in PLD those changes when Fedora was in version 5 or 6 :o)
So by this Fedora had less to fix. I remember that on scale those ~6k
source packages it was necessary to fix about 200 (maybe 300).
After PLD IIRC it was introduced in Gentoo then OpenMandriva and OpenSuse
(or something like that).
I'm not sure how it is now with Debian/Ubuntu but I would not surprised if
they started plowing with --as-needed in meantime as well.

Nevertheless after so many whole distro scale iteration now introduction of
--as-needed probably will be very easy but still some number of packages
may carry incorrect executables linker -l<foo> lists.

I'm thinking only now about yet another kind of pre step before patching ld
to make --as-needed default and -fno-as-needed optional.
I think that it would be good to add to koji proper observation deck of
those changes.

Simple IMO koji should start collecting informations about at least each
package REQUIRES and PROVIDES to track changes as regression tests between
each package new releases/revisions.
*Tracking those changes would IMO incredibly useful on keeping whole
distribution internal entropy under proper control.*
Extended version collected data to perform kodi SONAME regression test:
 not packages dependencies but generate each ELF package binary SONAME list.
In future probably it could be extended to track perl, python and other
dependencies not on package layer but with tracking per each .pl/.pm/.py
files.
Tracking over koji binary packages REQUIRES may allow track all manually
added Requires list changes.
Massive rebuilds logs may be useful to produce whole distro changes
statistics.
Probably few next sub ideas could be easy to add as well :)

So this email is kind of call for help to kojii developers :)

I'm not sure how it would with the be best method storing such data on some
koji backend services side.
Probably at least additional text file (on top of current three) in current
list of files preserved by koji per build request should enough.
Probably SQL backend could be overkill but from my perspective it is
implementation detail.


BTW OpenSuSE now uses very dirty patch to reverse ld --as-needed behavior:

$ cat binutils-build-as-needed.diff
Index: ld/ldmain.c
===================================================================
--- ld/ldmain.c.orig    2016-01-27 13:44:14.092983985 +0100
+++ ld/ldmain.c 2016-01-27 13:44:37.389254054 +0100
@@ -286,6 +286,8 @@ main (int argc, char **argv)
 #ifdef DEFAULT_FLAG_COMPRESS_DEBUG
   link_info.compress_debug = COMPRESS_DEBUG_GABI_ZLIB;
 #endif
+  if (getenv ("SUSE_ASNEEDED") && atoi(getenv ("SUSE_ASNEEDED")) > 0)
+    input_flags.add_DT_NEEDED_for_regular = TRUE;

   ldfile_add_arch ("");
   emulation = get_emulation (argc, argv);


So default --as-need is switched on over SUSE_ASNEEDED env variable.
IMO something like this could be acceptable only as JFDI/JFDIN solution.
Definitely modifications of rpm %configure and cmake related macros will
not cover everything and ld patch is only IMO logical/proper solution.
Such proper solution should simple change declared
input_flags.add_DT_NEEDED_for_regular to TRUE and add printing on stdout
linker warning about not use exact SONAME or as alternative that some exact
-l<foo> was not used/ignored because now using --as-needed does not shows
what exactly is dropped.
IMO patch like above may have high chance to be accepted by binutils source
tree maintainers and should be pushed ASAP to binutils source tree.

When koji and ld patch will be integrated in binutils as bcond disabled by
default such bcond on time +0T could be removed and yet another massive
rebuild pushed to build systems with binutils first in the queue.
Keeping such patch before final push will allow more developers test new ld
behavior by something like "rpmbuild --rebuild --with rev-as-needed
binutils*src.rpm" and force reinstall binutils package on own system.

So this email as well is kind of call to have green light from core Fedora
developers/maintainers committee that as it is described here it looks
acceptable to start working on details.
(Simple I don't want to waste other people and my time if such proposal
will be refused .. but IMO it is really worth because it is kind of game
changer).

I'm not sure am I introducing such proposal correctly.
If not please let me know (priv) what is TheRightWay(tm).

Comments?

kloczek
-- 
Tomasz Kłoczko | LinkedIn: *http://lnkd.in/FXPWxH <http://lnkd.in/FXPWxH>*
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org

Reply via email to