rpms/kernel/devel linux-2.6-makefile-after_link.patch, NONE, 1.1 kernel.spec, 1.1022, 1.1023

Roland McGrath roland at fedoraproject.org
Tue Oct 7 21:58:50 UTC 2008


Author: roland

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13421

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-makefile-after_link.patch 
Log Message:
Fix build ID fiddling magic. (#465873)

linux-2.6-makefile-after_link.patch:

--- NEW FILE linux-2.6-makefile-after_link.patch ---
>From f072f7db2194c8255c003d985b61ad2f97ebbee0 Mon Sep 17 00:00:00 2001
From: Roland McGrath <roland at redhat.com>
Date: Mon, 6 Oct 2008 23:03:03 -0700
Subject: [PATCH] kbuild: AFTER_LINK

If the make variable AFTER_LINK is set, it is a command line to run
after each final link.  This includes vmlinux itself and vDSO images.

Signed-off-by: Roland McGrath <roland at redhat.com>
---
 Makefile                            |    4 ++++
 arch/powerpc/kernel/vdso32/Makefile |    3 ++-
 arch/powerpc/kernel/vdso64/Makefile |    3 ++-
 arch/x86/vdso/Makefile              |    3 ++-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index ce9eceb..b27b1b7 100644
--- a/Makefile
+++ b/Makefile
@@ -679,6 +679,10 @@ quiet_cmd_vmlinux__ ?= LD      $@
       --start-group $(vmlinux-main) --end-group                  \
       $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o FORCE ,$^)
 
+ifdef AFTER_LINK
+cmd_vmlinux__ += ; $(AFTER_LINK)
+endif
+
 # Generate new vmlinux version
 quiet_cmd_vmlinux_version = GEN     .version
       cmd_vmlinux_version = set -e;                     \
diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile
index c3d57bd..c9519c5 100644
--- a/arch/powerpc/kernel/vdso32/Makefile
+++ b/arch/powerpc/kernel/vdso32/Makefile
@@ -40,7 +40,8 @@ $(obj-vdso32): %.o: %.S
 
 # actual build commands
 quiet_cmd_vdso32ld = VDSO32L $@
-      cmd_vdso32ld = $(CROSS32CC) $(c_flags) -Wl,-T $^ -o $@
+      cmd_vdso32ld = $(CROSS32CC) $(c_flags) -Wl,-T $^ -o $@ \
+		     $(if $(AFTER_LINK),; $(AFTER_LINK))
 quiet_cmd_vdso32as = VDSO32A $@
       cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
 
diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile
index fa7f1b8..712fe1d 100644
--- a/arch/powerpc/kernel/vdso64/Makefile
+++ b/arch/powerpc/kernel/vdso64/Makefile
@@ -34,7 +34,8 @@ $(obj-vdso64): %.o: %.S
 
 # actual build commands
 quiet_cmd_vdso64ld = VDSO64L $@
-      cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@
+      cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@ \
+		     $(if $(AFTER_LINK),; $(AFTER_LINK))
 quiet_cmd_vdso64as = VDSO64A $@
       cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
 
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 4d6ef0a..5203ae9 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -120,7 +120,8 @@ $(obj)/vdso32-syms.lds: $(vdso32.so-y:%=$(obj)/vdso32-%-syms.lds) FORCE
 quiet_cmd_vdso = VDSO    $@
       cmd_vdso = $(CC) -nostdlib -o $@ \
 		       $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
-		       -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^)
+		       -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) \
+		 $(if $(AFTER_LINK),; $(AFTER_LINK))
 
 VDSO_LDFLAGS = -fPIC -shared $(call ld-option, -Wl$(comma)--hash-style=sysv)
 
-- 
1.5.5.1



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1022
retrieving revision 1.1023
diff -u -r1.1022 -r1.1023
--- kernel.spec	7 Oct 2008 02:01:38 -0000	1.1022
+++ kernel.spec	7 Oct 2008 21:58:20 -0000	1.1023
@@ -567,6 +567,9 @@
 # we also need compile fixes for -vanilla
 Patch04: linux-2.6-compile-fixes.patch
 
+# build tweak for build ID magic, even for -vanilla
+Patch05: linux-2.6-makefile-after_link.patch
+
 %if !%{nopatches}
 
 # Git trees.
@@ -1011,6 +1014,8 @@
 # builds (as used in the buildsystem).
 ApplyPatch linux-2.6-build-nonintconfig.patch
 
+ApplyPatch linux-2.6-makefile-after_link.patch
+
 #
 # misc small stuff to make things compile
 #
@@ -1271,9 +1276,8 @@
 # in the stripped object, but repeating debugedit is a no-op.  We do it
 # beforehand to get the proper final build ID bits into the embedded image.
 # This affects the vDSO images in vmlinux, and the vmlinux image in bzImage.
-idhack='cmd_objcopy=$(if $(filter -S,$(OBJCOPYFLAGS)),'\
-'sh -xc "/usr/lib/rpm/debugedit -b $$RPM_BUILD_DIR -d /usr/src/debug -i $<";)'\
-'$(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@'
+export AFTER_LINK=\
+'sh -xc "/usr/lib/rpm/debugedit -b $$RPM_BUILD_DIR -d /usr/src/debug -i $@"'
 %endif
 
 cp_vmlinux()
@@ -1321,8 +1325,7 @@
     echo USING ARCH=$Arch
 
     make -s ARCH=$Arch %{oldconfig_target} > /dev/null
-    make -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags} \
-    	 ${idhack+"$idhack"}
+    make -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags}
     make -s ARCH=$Arch V=1 %{?_smp_mflags} modules %{?sparse_mflags} || exit 1
 
     # Start installing the results
@@ -1789,6 +1792,9 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Tue Oct  7 2008 Roland McGrath <roland at redhat.com>
+- Fix build ID fiddling magic. (#465873)
+
 * Mon Oct 06 2008 Eric Sandeen <sandeen at redhat.com>
 - Turn stack overflow debugging back on for x86
 




More information about the scm-commits mailing list