More small fixes for rc3

- tweak docker FEATURE flags for document building
   - include sphinx configure check in config.log
   - disable PIE for Windows builds
   - fix /proc/self/stat handling
   - a number of gdbstub fixups following GByteArray conversion
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAl6W5EAACgkQ+9DbCVqe
 KkRFhgf/VI6kzqMqIZiijTvVP/g5UsoyWYQIUNA7jnqgkUXtuhfa8mGS/B0KaWuS
 2xrg7iQ7BeH/Now9xZmErh4SzVOagbZGAz2fL9BqQ9ODnYKZYeVjMWEvAt8TQmwa
 8lcfRmSjy7E3x3QqjoBihmbs5SWiRihuTT+hdQovtt1vVB9TdvJFJnRqGEQfOkcC
 E1dXJU5GVdUlIgB9FgJVhPxLD943upBp324ekgn0oTkb0eDjs/pnr5d6uNlVRRd2
 v5tMkhfk9XSublPw2AQQiXpIklM4sfhm3THeJGbzkcH9N7eRJ6mVOIrKl+bb1Yan
 c3h3s+QTTgtU25iLkN2Dh7e/LVuqkA==
 =Kx1J
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stsquad/tags/pull-more-fixes-150420-1' into staging

More small fixes for rc3

  - tweak docker FEATURE flags for document building
  - include sphinx configure check in config.log
  - disable PIE for Windows builds
  - fix /proc/self/stat handling
  - a number of gdbstub fixups following GByteArray conversion

# gpg: Signature made Wed 15 Apr 2020 11:38:56 BST
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-more-fixes-150420-1:
  gdbstub: Introduce gdb_get_float32() to get 32-bit float registers
  gdbstub: Do not use memset() on GByteArray
  gdbstub: i386: Fix gdb_get_reg16() parameter to unbreak gdb
  target/m68k/helper: Fix m68k_fpu_gdb_get_reg() use of GByteArray
  linux-user: fix /proc/self/stat handling
  configure: disable PIE for Windows builds
  configure: redirect sphinx-build check to config.log
  tests/docker: add docs FEATURE flag and use for test-misc

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2020-04-15 12:02:59 +01:00
commit 73995d1555
15 changed files with 57 additions and 44 deletions

5
configure vendored
View File

@ -807,6 +807,7 @@ MINGW32*)
audio_drv_list="" audio_drv_list=""
fi fi
supported_os="yes" supported_os="yes"
pie="no"
;; ;;
GNU/kFreeBSD) GNU/kFreeBSD)
bsd="yes" bsd="yes"
@ -4942,7 +4943,9 @@ has_sphinx_build() {
# sphinx-build doesn't exist at all or if it is too old. # sphinx-build doesn't exist at all or if it is too old.
mkdir -p "$TMPDIR1/sphinx" mkdir -p "$TMPDIR1/sphinx"
touch "$TMPDIR1/sphinx/index.rst" touch "$TMPDIR1/sphinx/index.rst"
"$sphinx_build" $sphinx_werror -c "$source_path/docs" -b html "$TMPDIR1/sphinx" "$TMPDIR1/sphinx/out" >/dev/null 2>&1 "$sphinx_build" $sphinx_werror -c "$source_path/docs" \
-b html "$TMPDIR1/sphinx" \
"$TMPDIR1/sphinx/out" >> config.log 2>&1
} }
# Check if tools are available to build documentation. # Check if tools are available to build documentation.

View File

@ -125,6 +125,24 @@ static inline int gdb_get_reg128(GByteArray *buf, uint64_t val_hi,
return 16; return 16;
} }
static inline int gdb_get_float32(GByteArray *array, float32 val)
{
uint8_t buf[sizeof(CPU_FloatU)];
stfl_p(buf, val);
g_byte_array_append(array, buf, sizeof(buf));
return sizeof(buf);
}
static inline int gdb_get_zeroes(GByteArray *array, size_t len)
{
guint oldlen = array->len;
g_byte_array_set_size(array, oldlen + len);
memset(array->data + oldlen, 0, len);
return len;
}
/** /**
* gdb_get_reg_ptr: get pointer to start of last element * gdb_get_reg_ptr: get pointer to start of last element
* @len: length of element * @len: length of element

View File

@ -7295,34 +7295,29 @@ static int open_self_stat(void *cpu_env, int fd)
{ {
CPUState *cpu = env_cpu((CPUArchState *)cpu_env); CPUState *cpu = env_cpu((CPUArchState *)cpu_env);
TaskState *ts = cpu->opaque; TaskState *ts = cpu->opaque;
abi_ulong start_stack = ts->info->start_stack; g_autoptr(GString) buf = g_string_new(NULL);
int i; int i;
for (i = 0; i < 44; i++) { for (i = 0; i < 44; i++) {
char buf[128]; if (i == 0) {
int len; /* pid */
uint64_t val = 0; g_string_printf(buf, FMT_pid " ", getpid());
} else if (i == 1) {
/* app name */
gchar *bin = g_strrstr(ts->bprm->argv[0], "/");
bin = bin ? bin + 1 : ts->bprm->argv[0];
g_string_printf(buf, "(%.15s) ", bin);
} else if (i == 27) {
/* stack bottom */
g_string_printf(buf, TARGET_ABI_FMT_ld " ", ts->info->start_stack);
} else {
/* for the rest, there is MasterCard */
g_string_printf(buf, "0%c", i == 43 ? '\n' : ' ');
}
if (i == 0) { if (write(fd, buf->str, buf->len) != buf->len) {
/* pid */ return -1;
val = getpid(); }
snprintf(buf, sizeof(buf), "%"PRId64 " ", val);
} else if (i == 1) {
/* app name */
snprintf(buf, sizeof(buf), "(%s) ", ts->bprm->argv[0]);
} else if (i == 27) {
/* stack bottom */
val = start_stack;
snprintf(buf, sizeof(buf), "%"PRId64 " ", val);
} else {
/* for the rest, there is MasterCard */
snprintf(buf, sizeof(buf), "0%c", i == 43 ? '\n' : ' ');
}
len = strlen(buf);
if (write(fd, buf, len) != len) {
return -1;
}
} }
return 0; return 0;

View File

@ -47,8 +47,7 @@ int arm_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
if (gdb_has_xml) { if (gdb_has_xml) {
return 0; return 0;
} }
memset(mem_buf, 0, 12); return gdb_get_zeroes(mem_buf, 12);
return 12;
} }
switch (n) { switch (n) {
case 24: case 24:

View File

@ -106,7 +106,7 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
} else if (n >= IDX_FP_REGS && n < IDX_FP_REGS + 8) { } else if (n >= IDX_FP_REGS && n < IDX_FP_REGS + 8) {
floatx80 *fp = (floatx80 *) &env->fpregs[n - IDX_FP_REGS]; floatx80 *fp = (floatx80 *) &env->fpregs[n - IDX_FP_REGS];
int len = gdb_get_reg64(mem_buf, cpu_to_le64(fp->low)); int len = gdb_get_reg64(mem_buf, cpu_to_le64(fp->low));
len += gdb_get_reg16(mem_buf + len, cpu_to_le16(fp->high)); len += gdb_get_reg16(mem_buf, cpu_to_le16(fp->high));
return len; return len;
} else if (n >= IDX_XMM_REGS && n < IDX_XMM_REGS + CPU_NB_REGS) { } else if (n >= IDX_XMM_REGS && n < IDX_XMM_REGS + CPU_NB_REGS) {
n -= IDX_XMM_REGS; n -= IDX_XMM_REGS;

View File

@ -109,8 +109,8 @@ static int m68k_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, int n)
{ {
if (n < 8) { if (n < 8) {
int len = gdb_get_reg16(mem_buf, env->fregs[n].l.upper); int len = gdb_get_reg16(mem_buf, env->fregs[n].l.upper);
len += gdb_get_reg16(mem_buf + len, 0); len += gdb_get_reg16(mem_buf, 0);
len += gdb_get_reg64(mem_buf + len, env->fregs[n].l.lower); len += gdb_get_reg64(mem_buf, env->fregs[n].l.lower);
return len; return len;
} }
switch (n) { switch (n) {

View File

@ -58,11 +58,9 @@ int superh_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
return gdb_get_regl(mem_buf, env->fpscr); return gdb_get_regl(mem_buf, env->fpscr);
case 25 ... 40: case 25 ... 40:
if (env->fpscr & FPSCR_FR) { if (env->fpscr & FPSCR_FR) {
stfl_p(mem_buf, env->fregs[n - 9]); return gdb_get_float32(mem_buf, env->fregs[n - 9]);
} else {
stfl_p(mem_buf, env->fregs[n - 25]);
} }
return 4; return gdb_get_float32(mem_buf, env->fregs[n - 25]);
case 41: case 41:
return gdb_get_regl(mem_buf, env->ssr); return gdb_get_regl(mem_buf, env->ssr);
case 42: case 42:

View File

@ -105,8 +105,7 @@ int xtensa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
default: default:
qemu_log_mask(LOG_UNIMP, "%s from reg %d of unsupported size %d\n", qemu_log_mask(LOG_UNIMP, "%s from reg %d of unsupported size %d\n",
__func__, n, reg->size); __func__, n, reg->size);
memset(mem_buf, 0, reg->size); return gdb_get_zeroes(mem_buf, reg->size);
return reg->size;
} }
case xtRegisterTypeWindow: /*a*/ case xtRegisterTypeWindow: /*a*/
@ -115,8 +114,7 @@ int xtensa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
default: default:
qemu_log_mask(LOG_UNIMP, "%s from reg %d of unsupported type %d\n", qemu_log_mask(LOG_UNIMP, "%s from reg %d of unsupported type %d\n",
__func__, n, reg->type); __func__, n, reg->type);
memset(mem_buf, 0, reg->size); return gdb_get_zeroes(mem_buf, reg->size);
return reg->size;
} }
} }

View File

@ -34,3 +34,5 @@ RUN apt update && \
python3-sphinx \ python3-sphinx \
texinfo \ texinfo \
$(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d\ -f2) $(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d\ -f2)
ENV FEATURES docs

View File

@ -30,6 +30,4 @@ RUN apt update && \
pkg-config \ pkg-config \
psmisc \ psmisc \
python3 \ python3 \
python3-sphinx \
texinfo \
$(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d\ -f2) $(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d\ -f2)

View File

@ -103,4 +103,4 @@ ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3
RUN dnf install -y $PACKAGES RUN dnf install -y $PACKAGES
RUN rpm -q $PACKAGES | sort > /packages.txt RUN rpm -q $PACKAGES | sort > /packages.txt
ENV PATH $PATH:/usr/libexec/python3-sphinx/ ENV PATH $PATH:/usr/libexec/python3-sphinx/
ENV FEATURES mingw clang pyyaml asan ENV FEATURES mingw clang pyyaml asan docs

View File

@ -13,5 +13,5 @@ RUN apt-get -y install device-tree-compiler python3 python3-yaml dh-autoreconf g
# Travis tools require PhantomJS / Neo4j / Maven accessible # Travis tools require PhantomJS / Neo4j / Maven accessible
# in their PATH (QEMU build won't access them). # in their PATH (QEMU build won't access them).
ENV PATH /usr/local/phantomjs/bin:/usr/local/phantomjs:/usr/local/neo4j-3.2.7/bin:/usr/local/maven-3.5.2/bin:/usr/local/cmake-3.9.2/bin:/usr/local/clang-5.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin ENV PATH /usr/local/phantomjs/bin:/usr/local/phantomjs:/usr/local/neo4j-3.2.7/bin:/usr/local/maven-3.5.2/bin:/usr/local/cmake-3.9.2/bin:/usr/local/clang-5.0.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV FEATURES clang pyyaml ENV FEATURES clang pyyaml docs
USER travis USER travis

View File

@ -68,4 +68,4 @@ ENV PACKAGES flex bison \
RUN apt-get update && \ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES
RUN dpkg -l $PACKAGES | sort > /packages.txt RUN dpkg -l $PACKAGES | sort > /packages.txt
ENV FEATURES clang pyyaml sdl2 ENV FEATURES clang pyyaml sdl2 docs

View File

@ -54,7 +54,7 @@ ENV PACKAGES flex bison \
RUN apt-get update && \ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES
RUN dpkg -l $PACKAGES | sort > /packages.txt RUN dpkg -l $PACKAGES | sort > /packages.txt
ENV FEATURES clang pyyaml sdl2 ENV FEATURES clang pyyaml sdl2 docs
# https://bugs.launchpad.net/qemu/+bug/1838763 # https://bugs.launchpad.net/qemu/+bug/1838763
ENV QEMU_CONFIGURE_OPTS --disable-libssh ENV QEMU_CONFIGURE_OPTS --disable-libssh

View File

@ -14,6 +14,8 @@
. common.rc . common.rc
requires docs
cd "$BUILD_DIR" cd "$BUILD_DIR"
# build everything else but QEMU # build everything else but QEMU