qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: peter.maydell@linaro.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	qemu-devel@nongnu.org, "Eduardo Habkost" <ehabkost@redhat.com>
Subject: [PULL 06/11] tests/tcg/i386: force -fno-pie for test-i386
Date: Tue,  6 Apr 2021 16:00:36 +0100	[thread overview]
Message-ID: <20210406150041.28753-7-alex.bennee@linaro.org> (raw)
In-Reply-To: <20210406150041.28753-1-alex.bennee@linaro.org>

The containerised compiler defaults to no-pie anyway but if we are
relying on the users installed cross compiler we need to check it
works for building 16 bit code first.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210401102530.12030-7-alex.bennee@linaro.org>

diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 90fd81f506..fa1a4261a4 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -281,6 +281,12 @@ for target in $target_list; do
                 echo "CROSS_CC_HAS_POWER8_VECTOR=y" >> $config_target_mak
             fi
         ;;
+        i386-linux-user)
+            if do_compiler "$target_compiler" $target_compiler_cflags \
+                -Werror -fno-pie -o $TMPE $TMPC; then
+                echo "CROSS_CC_HAS_I386_NOPIE=y" >> $config_target_mak
+            fi
+        ;;
     esac
 
     enabled_cross_compilers="$enabled_cross_compilers $target_compiler"
diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target
index c4a6f91966..f7efaab918 100644
--- a/tests/tcg/i386/Makefile.target
+++ b/tests/tcg/i386/Makefile.target
@@ -27,13 +27,23 @@ run-plugin-test-i386-bmi2-%: QEMU_OPTS += -cpu max
 hello-i386: CFLAGS+=-ffreestanding
 hello-i386: LDFLAGS+=-nostdlib
 
-#
-# test-386 includes a couple of additional objects that need to be linked together
-#
+# test-386 includes a couple of additional objects that need to be
+# linked together, we also need a no-pie capable compiler due to the
+# non-pic calls into 16-bit mode
+ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_I386_NOPIE),)
+test-i386: CFLAGS += -fno-pie
 
 test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S test-i386.h test-i386-shift.h test-i386-muldiv.h
 	$(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_CFLAGS) -o $@ \
 	   $(<D)/test-i386.c $(<D)/test-i386-code16.S $(<D)/test-i386-vm86.S -lm
+else
+test-i386:
+	$(call skip-test, "BUILD of $@", "missing -no-pie compiler support")
+run-test-i386:
+	$(call skip-test, "RUN of test-i386", "not built")
+run-plugin-test-i386-with-%:
+	$(call skip-test, "RUN of test-i386 ($*)", "not built")
+endif
 
 ifeq ($(SPEED), slow)
 
-- 
2.20.1



  parent reply	other threads:[~2021-04-06 15:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 15:00 [PULL 00/11] rc2 fixes (check-tcg, gitlab, gdbstub) Alex Bennée
2021-04-06 15:00 ` [PULL 01/11] tests/tcg: update the defaults for x86 compilers Alex Bennée
2021-04-06 15:00 ` [PULL 02/11] tests/docker: don't set DOCKER_REGISTRY on non-x86_64 Alex Bennée
2021-04-06 15:00 ` [PULL 03/11] tests/tcg: add concept of container_hosts Alex Bennée
2021-04-06 15:00 ` [PULL 04/11] tests/tcg/configure.sh: make sure we pick up x86_64 cross compilers Alex Bennée
2021-04-06 15:00 ` [PULL 05/11] tests/tcg/i386: expand .data sections for system tests Alex Bennée
2021-04-06 15:00 ` Alex Bennée [this message]
2021-04-06 15:00 ` [PULL 07/11] tests/tcg: relax the next step precision of the gdb sha1 test Alex Bennée
2021-04-06 15:00 ` [PULL 08/11] docs/system/gdb.rst: Add some more heading structure Alex Bennée
2021-04-06 15:00 ` [PULL 09/11] docs/system/gdb.rst: Document how to debug multicore machines Alex Bennée
2021-04-06 15:00 ` [PULL 10/11] gitlab-ci.yml: Fix the filtering for the git submodules Alex Bennée
2021-04-06 15:00 ` [PULL 11/11] gitlab-ci.yml: Test the dtrace backend in one of the jobs Alex Bennée
2021-04-06 17:37 ` [PULL 00/11] rc2 fixes (check-tcg, gitlab, gdbstub) Peter Maydell
2021-04-07 17:25   ` Alex Bennée
2021-04-07 18:27     ` Peter Maydell
2021-04-07 18:41       ` Alex Bennée
2021-04-08 13:00         ` Peter Maydell

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=20210406150041.28753-7-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --subject='Re: [PULL 06/11] tests/tcg/i386: force -fno-pie for test-i386' \
    /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

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).