Skip to contentSkip to conversation

lib/build_OID_registry: do not embed full $0

PATCH In review Giuliano Procida 2 participants 3 messages Aug 5, 2024 – Aug 6, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/build_OID_registry: do not embed full $0

Using $0 makes the output of this file sensitive to the Linux build directory path. This is problematic for reproducible builds as it can affect vmlinux's .debug_lines' section and vmlinux's build ID.

---
 lib/build_OID_registry | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/build_OID_registry +1 -1
index d7fc32ea8ac2..06f242202036 100755
@@ -35,7 +35,7 @@ close IN_FILE || die;
 #
 open C_FILE, ">$ARGV[1]" or die;
 print C_FILE "/*\n";
-print C_FILE " * Automatically generated by ", $0, ".  Do not edit\n";
+print C_FILE " * Automatically generated by build_OID_registry.  Do not edit\n";
 print C_FILE " */\n";
 
 #
Signature · 1 line
2.45.2.741.gdbec12cfda-goog
#1 lore raw

Please ignore this. I see other people have already posted different fixes achieving much the same goal.

Though my change was much simpler!

Quoted 26 lines · Giuliano Procida

Using $0 makes the output of this file sensitive to the Linux build directory path. This is problematic for reproducible builds as it can affect vmlinux's .debug_lines' section and vmlinux's build ID.

---
 lib/build_OID_registry | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/build_OID_registry +1 -2
index d7fc32ea8ac2..06f242202036 100755
@@ -35,7 +35,7 @@ close IN_FILE || die;
 #
 open C_FILE, ">$ARGV[1]" or die;
 print C_FILE "/*\n";
-print C_FILE " * Automatically generated by ", $0, ".  Do not edit\n";
+print C_FILE " * Automatically generated by build_OID_registry.  Do not edit\n";
 print C_FILE " */\n";
 
 #
--

2.45.2.741.gdbec12cfda-goog

#2 lore raw
Quoted 5 lines · Giuliano Procida

Please ignore this. I see other people have already posted different fixes achieving much the same goal.

Though my change was much simpler!

True.

There were suggestions to replace this with a fixed string:

https://lore.kernel.org/linux-kbuild/CAK7LNASa-KedA_CTww6unckAGkJCQTctdbk0d-MUsN7wQpM=kQ@mail.gmail.com/
https://lore.kernel.org/linux-kbuild/[email protected]/

A needlessly complex patch was applied, unfortunately.

Quoted 12 lines · Giuliano Procida
Quoted 10 lines

Using $0 makes the output of this file sensitive to the Linux build directory path. This is problematic for reproducible builds as it can affect vmlinux's .debug_lines' section and vmlinux's build ID.

---
 lib/build_OID_registry | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

lib/build_OID_registry close IN_FILE || die; · line 40

Quoted 12 lines
lib/build_OID_registry +1 -1
index d7fc32ea8ac2..06f242202036 100755
@@ -35,7 +35,7 @@ close IN_FILE || die;
 #
 open C_FILE, ">$ARGV[1]" or die;
 print C_FILE "/*\n";
-print C_FILE " * Automatically generated by ", $0, ".  Do not edit\n";
+print C_FILE " * Automatically generated by build_OID_registry.  Do not edit\n";
 print C_FILE " */\n";
 

--
Best Regards
Masahiro Yamada