kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: kvm@vger.kernel.org, Janosch Frank <frankja@linux.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Steffen Eiden <seiden@linux.ibm.com>
Subject: [kvm-unit-tests PATCH] s390x: Fix out-of-tree builds
Date: Fri, 16 Jul 2021 12:52:19 +0200	[thread overview]
Message-ID: <20210716105219.1201997-1-thuth@redhat.com> (raw)

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 <thuth@redhat.com>
---
 .gitlab-ci.yml | 4 +++-
 configure      | 4 ++++
 s390x/Makefile | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4aebb97..943b20f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -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
diff --git a/configure b/configure
index 1d4871e..1d4d855 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/s390x/Makefile b/s390x/Makefile
index 07af26d..6565561 100644
--- a/s390x/Makefile
+++ b/s390x/Makefile
@@ -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" $@ $@
 
-- 
2.27.0


             reply	other threads:[~2021-07-16 10:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 10:52 Thomas Huth [this message]
2021-07-16 11:56 ` [kvm-unit-tests PATCH] s390x: Fix out-of-tree builds Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210716105219.1201997-1-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seiden@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).