Skip to content

Commit

Permalink
Build a linux devkit Tools.gmk patch
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Leonard <[email protected]>
  • Loading branch information
andrew-m-leonard committed Mar 21, 2024
1 parent 5d232b2 commit cc5b065
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion pipelines/build/devkit/Tools.gmk.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/make/devkit/Tools.gmk b/make/devkit/Tools.gmk
index 187320ca2..1c009f945 100644
index 187320ca26e..e9d5c92986e 100644
--- a/make/devkit/Tools.gmk
+++ b/make/devkit/Tools.gmk
@@ -62,6 +62,23 @@ ifeq ($(BASE_OS), OL)
Expand Down Expand Up @@ -93,3 +93,21 @@ index 187320ca2..1c009f945 100644
endef

# Download and unpack all source packages
@@ -323,6 +374,9 @@ $(foreach p,$(RPM_FILE_LIST),$(eval $(call unrpm,$(p))))
# have it anyway, but just to make sure...
# Patch libc.so and libpthread.so to force linking against libraries in sysroot
# and not the ones installed on the build machine.
+# Remove comment sections from static libraries and C runtime objects
+# to prevent leaking RHEL-specific package versions into
+# devkit-produced binaries.
$(libs) : $(rpms)
@echo Patching libc and pthreads
@(for f in `find $(SYSROOT) -name libc.so -o -name libpthread.so`; do \
@@ -332,6 +386,7 @@ $(libs) : $(rpms)
-e 's|/lib/||g' ) > $$f.tmp ; \
mv $$f.tmp $$f ; \
done)
+ @find $(SYSROOT) -name '*.[ao]' -exec objcopy --remove-section .comment '{}' ';'
@mkdir -p $(SYSROOT)/usr/lib
@touch $@

0 comments on commit cc5b065

Please sign in to comment.