Skip to contentSkip to conversation

s390x: Improve out-of-source builds

PATCH In review Marc Hartmayer 2 participants 8 messages Jan 28, 2025 – Jan 31, 2025

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

cover s390x: Improve out-of-source builds

Marc Hartmayer (2):
s390x/Makefile: Make sure the linker script is generated in the build
directory
s390x/Makefile: Add auxinfo.o to cflatobjs

 s390x/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

base-commit: 0ed2cdf3c80ee803b9150898e687e77e4d6f5db2

Signature · 1 line
2.48.1
#1 lore raw

PATCH 1/2 s390x/Makefile: Make sure the linker script is generated in the build directory

This change makes sure that the 'flat.lds' linker script is actually generated in the build directory and not source directory - this makes a difference in case of an out-of-source build.

---
 s390x/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
s390x/Makefile +2 -2
index 23342bd64f44..71bfa787fe59 100644
@@ -182,8 +182,8 @@ lds-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -MT $@
 	$(CC) $(CFLAGS) -c -o $@ $< -DPROGNAME=\"$(@:.aux.o=.elf)\"
 
 .SECONDEXPANSION:
-%.elf: $(FLATLIBS) $(asmlib) $(SRCDIR)/s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
-	@$(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds \
+%.elf: $(FLATLIBS) $(asmlib) s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
+	@$(CC) $(LDFLAGS) -o $@ -T s390x/flat.lds \
 		$(filter %.o, $^) $(FLATLIBS) $(snippets-obj) $(snippet-hdr-obj) || \
 		{ echo "Failure probably caused by missing definition of gen-se-header executable"; exit 1; }
 	@chmod a-x $@
Signature · 1 line
2.48.1
#2 lore raw

Re: [kvm-unit-tests PATCH v1 1/2] s390x/Makefile: Make sure the linker script is generated in the build directory

Quoted 14 lines · Marc Hartmayer

This change makes sure that the 'flat.lds' linker script is actually generated in the build directory and not source directory - this makes a difference in case of an out-of-source build.

---
 s390x/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
s390x/Makefile +0 -0
index 23342bd64f44..71bfa787fe59 100644

s390x/Makefile lds-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -MT $@ · line 187

Quoted 8 lines
s390x/Makefile +2 -2
@@ -182,8 +182,8 @@ lds-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -MT $@
 	$(CC) $(CFLAGS) -c -o $@ $< -DPROGNAME=\"$(@:.aux.o=.elf)\"
 
 .SECONDEXPANSION:
-%.elf: $(FLATLIBS) $(asmlib) $(SRCDIR)/s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
-	@$(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds \
 
+%.elf: $(FLATLIBS) $(asmlib) s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
+	@$(CC) $(LDFLAGS) -o $@ -T s390x/flat.lds \

s390x/flat.lds should be replaced by $(TESTDIR)/flat.lds

Quoted 7 lines
s390x/Makefile +0 -0
 		$(filter %.o, $^) $(FLATLIBS) $(snippets-obj) $(snippet-hdr-obj) || \
 		{ echo "Failure probably caused by missing definition of gen-se-header executable"; exit 1; }

@chmod a-x $@

Signature · 1 line
2.48.1
Signature · 8 lines
Kind regards / Beste Grüße
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
#3 lore raw

Re: [kvm-unit-tests PATCH v1 1/2] s390x/Makefile: Make sure the linker script is generated in the build directory

Quoted 17 lines · Marc Hartmayer
Quoted 16 lines · Marc Hartmayer

This change makes sure that the 'flat.lds' linker script is actually generated in the build directory and not source directory - this makes a difference in case of an out-of-source build.

---
 s390x/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
s390x/Makefile +0 -0
index 23342bd64f44..71bfa787fe59 100644
@@ -182,8 +182,8 @@ lds-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -MT $@
 	$(CC) $(CFLAGS) -c -o $@ $< -DPROGNAME=\"$(@:.aux.o=.elf)\"
 
Quoted 8 lines

s390x/Makefile lds-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -MT $@ · line 186

Quoted 6 lines
s390x/Makefile +2 -2
 .SECONDEXPANSION:
-%.elf: $(FLATLIBS) $(asmlib) $(SRCDIR)/s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
-	@$(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds \
 
+%.elf: $(FLATLIBS) $(asmlib) s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
+	@$(CC) $(LDFLAGS) -o $@ -T s390x/flat.lds \

s390x/flat.lds should be replaced by $(TESTDIR)/flat.lds

fwiw, s/TESTDIR/TEST_DIR/

Otherwise, yes, will fix it up when picking. Thanks!

#4 lore raw

Re: [kvm-unit-tests PATCH v1 1/2] s390x/Makefile: Make sure the linker script is generated in the build directory

Quoted 22 lines · Nico Boehr
Quoted 21 lines · Marc Hartmayer
Quoted 19 lines · Marc Hartmayer

This change makes sure that the 'flat.lds' linker script is actually generated in the build directory and not source directory - this makes a difference in case of an out-of-source build.

---
 s390x/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
s390x/Makefile +0 -2
index 23342bd64f44..71bfa787fe59 100644
@@ -182,8 +182,8 @@ lds-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -MT $@
 	$(CC) $(CFLAGS) -c -o $@ $< -DPROGNAME=\"$(@:.aux.o=.elf)\"
 
 .SECONDEXPANSION:
-%.elf: $(FLATLIBS) $(asmlib) $(SRCDIR)/s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
-	@$(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds \
Quoted 8 lines
Quoted 4 lines

s390x/Makefile lds-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -MT $@ · line 186

Quoted 2 lines
s390x/Makefile +2 -0
+%.elf: $(FLATLIBS) $(asmlib) s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
+	@$(CC) $(LDFLAGS) -o $@ -T s390x/flat.lds \

s390x/flat.lds should be replaced by $(TESTDIR)/flat.lds

fwiw, s/TESTDIR/TEST_DIR/

Otherwise, yes, will fix it up when picking. Thanks!

Thanks.

Signature · 8 lines
Kind regards / Beste Grüße
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
Reviewed-by on v1 1/2
#5 lore raw

Re: [kvm-unit-tests PATCH v1 1/2] s390x/Makefile: Make sure the linker script is generated in the build directory

In reply to Marc Hartmayer
Quoted 5 lines · Marc Hartmayer

This change makes sure that the 'flat.lds' linker script is actually generated in the build directory and not source directory - this makes a difference in case of an out-of-source build.

#6 lore raw

PATCH 2/2 s390x/Makefile: Add auxinfo.o to cflatobjs

In reply to Marc Hartmayer

This makes sure that the file is removed in case of make clean as the top Makefile cleans all objects defined in 'cflagsobjs'.

--
Note: AFAICT, the computed sh256sum values of the generated .elf and .bin files
did not change.

---
 s390x/Makefile | 1 +
 1 file changed, 1 insertion(+)
s390x/Makefile +1 -0
index 71bfa787fe59..1b0e9d63de13 100644
@@ -90,6 +90,7 @@ LDFLAGS += -Wl,--build-id=none
 asm-offsets = lib/$(ARCH)/asm-offsets.h
 include $(SRCDIR)/scripts/asm-offsets.mak
 
+cflatobjs += lib/auxinfo.o
 cflatobjs += lib/util.o
 cflatobjs += lib/alloc.o
 cflatobjs += lib/alloc_phys.o
Signature · 1 line
2.48.1