diff mbox

sysd-rules: Cut down the number of rtld-% pattern rules

Message ID 20160914152151.17744439929AA@oldenburg.str.redhat.com
State New
Headers show

Commit Message

Florian Weimer Sept. 14, 2016, 3:21 p.m. UTC
rtld only needs shared objects, so the other patterns are pointless and
significantly increase the work make has to perform while identifying
which pattern rule to apply.

2016-09-14  Florian Weimer  <fweimer@redhat.com>

	* scripts/sysd-rules.awk (BEGIN): Only generate rtld patterns for
	.os objects.

Comments

Carlos O'Donell Sept. 14, 2016, 5:09 p.m. UTC | #1
On 09/14/2016 11:21 AM, Florian Weimer wrote:
> rtld only needs shared objects, so the other patterns are pointless and
> significantly increase the work make has to perform while identifying
> which pattern rule to apply.

Wow, that's 520 rules we could remove? If it works, it would be a great
reduction in the total rule count (~30% of the ~1500 rules).

> 2016-09-14  Florian Weimer  <fweimer@redhat.com>
> 
> 	* scripts/sysd-rules.awk (BEGIN): Only generate rtld patterns for
> 	.os objects.
> 
> diff --git a/scripts/sysd-rules.awk b/scripts/sysd-rules.awk
> index 69af400..c82e8fd 100644
> --- a/scripts/sysd-rules.awk
> +++ b/scripts/sysd-rules.awk
> @@ -50,6 +50,10 @@ BEGIN {
>          split(pattern, td, ":");
>          target_pattern = td[1];
>          dep_pattern = td[2];
> +        # rtld objects are always PIC.
> +        if (target_pattern ~ /^rtld/ && o != ".os") {
> +            continue;
> +        }
>          if (target_pattern == "%") {
>            command_suffix = "";
>          } else {
> 

This looks good to me, all the *.os objects going into rtld-libc.a
are shared PIC objects involved in the final link of ld.so.

Everything that needs to be non-PIC is compiled as s*.o and placed
directly into libc.a.

Therefore if you test the above on i686 and x86_64 and it shows no
ABI/API differences then I'd say just commit it.

This would be a really great improvement in compilation times. The
sysd-rules are really one of the limiting factor in
Florian Weimer Sept. 20, 2016, 8:42 a.m. UTC | #2
On 09/14/2016 07:09 PM, Carlos O'Donell wrote:

> Therefore if you test the above on i686 and x86_64 and it shows no
> ABI/API differences then I'd say just commit it.

i686 and x86_64 are identical (except for nscd and .a files, which embed 
timestamps).  Committed.

Thanks,
Florian
diff mbox

Patch

diff --git a/scripts/sysd-rules.awk b/scripts/sysd-rules.awk
index 69af400..c82e8fd 100644
--- a/scripts/sysd-rules.awk
+++ b/scripts/sysd-rules.awk
@@ -50,6 +50,10 @@  BEGIN {
         split(pattern, td, ":");
         target_pattern = td[1];
         dep_pattern = td[2];
+        # rtld objects are always PIC.
+        if (target_pattern ~ /^rtld/ && o != ".os") {
+            continue;
+        }
         if (target_pattern == "%") {
           command_suffix = "";
         } else {