s390x: Fix out-of-tree builds
PATCH 1/1 s390x: Fix out-of-tree builds
The support for "snippets" (nested guest binaries) that has been added recently to the s390x folder broke the out-of-tree compilation. We have to make sure that the snippet folder is created in the build directory, too, and that linker script is taken from the source folder.
While we're at it, switch the gitlab-CI cross compiler job to use out-of-tree builds, too, so that this does not happen so easily again. We're still testing in-tree s390x builds with the native "s390x-kvm" job on the s390x host, so we now test both, in-tree and out-of-tree builds.
--- .gitlab-ci.yml | 4 +++- configure | 4 ++++ s390x/Makefile | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-)
.gitlab-ci.yml +3 -1
@@ -57,7 +57,9 @@ build-ppc64le: build-s390x: script: - dnf install -y qemu-system-s390x gcc-s390x-linux-gnu - - ./configure --arch=s390x --cross-prefix=s390x-linux-gnu- + - mkdir build + - cd build + - ../configure --arch=s390x --cross-prefix=s390x-linux-gnu- - make -j2 - ACCEL=tcg ./run_tests.sh selftest-setup intercept emulator sieve skey diag10 diag308 vector diag288
configure +4 -0
@@ -296,6 +296,10 @@ if test ! -e Makefile; then ln -sf "$srcdir/$testdir/unittests.cfg" $testdir/ ln -sf "$srcdir/run_tests.sh" + if [ -d "$srcdir/$testdir/snippets" ]; then + mkdir -p "$testdir/snippets/c" + fi + echo "linking scripts..." ln -sf "$srcdir/scripts" fi
s390x/Makefile +1 -1
@@ -90,7 +90,7 @@ $(SNIPPET_DIR)/asm/%.gbin: $(SNIPPET_DIR)/asm/%.o $(FLATLIBS) $(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $@ $@ $(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_asmlib) $(FLATLIBS) - $(CC) $(LDFLAGS) -o $@ -T $(SNIPPET_DIR)/c/flat.lds $(patsubst %.gbin,%.o,$@) $(snippet_asmlib) $(FLATLIBS) + $(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/snippets/c/flat.lds $(patsubst %.gbin,%.o,$@) $(snippet_asmlib) $(FLATLIBS) $(OBJCOPY) -O binary $@ $@ $(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $@ $@
Signature · 1 line
2.27.0
Quoted 55 lines · Thomas Huth
The support for "snippets" (nested guest binaries) that has been added recently to the s390x folder broke the out-of-tree compilation. We have to make sure that the snippet folder is created in the build directory, too, and that linker script is taken from the source folder.
While we're at it, switch the gitlab-CI cross compiler job to use out-of-tree builds, too, so that this does not happen so easily again. We're still testing in-tree s390x builds with the native "s390x-kvm" job on the s390x host, so we now test both, in-tree and out-of-tree builds.
Fixes 2f6fdb4ac446 ("s390x: snippets: Add snippet compilation")Signed-off-by Thomas Huth <[email protected]>--- .gitlab-ci.yml | 4 +++- configure | 4 ++++ s390x/Makefile | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-).gitlab-ci.yml +3
-1@@ -57,7 +57,9 @@ build-ppc64le: build-s390x: script: - dnf install -y qemu-system-s390x gcc-s390x-linux-gnu - - ./configure --arch=s390x --cross-prefix=s390x-linux-gnu- + - mkdir build + - cd build + - ../configure --arch=s390x --cross-prefix=s390x-linux-gnu- - make -j2 - ACCEL=tcg ./run_tests.sh selftest-setup intercept emulator sieve skey diag10 diag308 vector diag288configure +4
-0@@ -296,6 +296,10 @@ if test ! -e Makefile; then ln -sf "$srcdir/$testdir/unittests.cfg" $testdir/ ln -sf "$srcdir/run_tests.sh" + if [ -d "$srcdir/$testdir/snippets" ]; then + mkdir -p "$testdir/snippets/c" + fi + echo "linking scripts..." ln -sf "$srcdir/scripts" fis390x/Makefile +0
-0
s390x/Makefile $(SNIPPET_DIR)/asm/%.gbin: $(SNIPPET_DIR)/asm/%.o $(FLATLIBS) · line 96
Quoted 8 lines
s390x/Makefile +1
-1@@ -90,7 +90,7 @@ $(SNIPPET_DIR)/asm/%.gbin: $(SNIPPET_DIR)/asm/%.o $(FLATLIBS) $(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $@ $@ $(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_asmlib) $(FLATLIBS) - $(CC) $(LDFLAGS) -o $@ -T $(SNIPPET_DIR)/c/flat.lds $(patsubst %.gbin,%.o,$@) $(snippet_asmlib) $(FLATLIBS) + $(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/snippets/c/flat.lds $(patsubst %.gbin,%.o,$@) $(snippet_asmlib) $(FLATLIBS) $(OBJCOPY) -O binary $@ $@ $(OBJCOPY) -I binary -O elf64-s390 -B "s390:64-bit" $@ $@
Queued, thanks.
Paolo