Skip to content

Add S390X architecture as a Travis job. #5382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ jobs:
arch: amd64
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1
arch: arm64
- env: ENABLE_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 S390X=1
arch: s390x

before_script:
- ccache --version
Expand Down
43 changes: 34 additions & 9 deletions ext/exif/exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ static signed short php_ifd_get16s(void *value, int motorola_intel)
}
/* }}} */

/* {{{ php_ifd_get32s
/* {{{ php_ifd_get32u
* Convert a 32 bit unsigned value from file's native byte order */
static unsigned php_ifd_get32u(void *void_value, int motorola_intel)
{
Expand All @@ -1469,6 +1469,33 @@ static unsigned php_ifd_get32u(void *void_value, int motorola_intel)
}
/* }}} */

/* {{{ php_ifd_get64u
* Convert a 64 bit unsigned value from file's native byte order */
static uint64_t php_ifd_get64u(void *void_value, int motorola_intel)
{
uchar *value = (uchar *) void_value;
if (motorola_intel) {
return ((uint64_t)value[0] << 56)
| ((uint64_t)value[1] << 48)
| ((uint64_t)value[2] << 40)
| ((uint64_t)value[3] << 32)
| ((uint64_t)value[4] << 24)
| ((uint64_t)value[5] << 16)
| ((uint64_t)value[6] << 8 )
| ((uint64_t)value[7] );
} else {
return ((uint64_t)value[7] << 56)
| ((uint64_t)value[6] << 48)
| ((uint64_t)value[5] << 40)
| ((uint64_t)value[4] << 32)
| ((uint64_t)value[3] << 24)
| ((uint64_t)value[2] << 16)
| ((uint64_t)value[1] << 8 )
| ((uint64_t)value[0] );
}
}
/* }}} */

/* {{{ php_ifd_get32u
* Convert a 32 bit signed value from file's native byte order */
static unsigned php_ifd_get32s(void *value, int motorola_intel)
Expand Down Expand Up @@ -1510,17 +1537,15 @@ static void php_ifd_set32u(char *data, size_t value, int motorola_intel)
/* }}} */

static float php_ifd_get_float(char *data) {
/* Copy to avoid alignment issues */
float f;
memcpy(&f, data, sizeof(float));
return f;
union { uint32_t i; float f; } u;
u.i = php_ifd_get32u(data, 0);
return u.f;
}

static double php_ifd_get_double(char *data) {
/* Copy to avoid alignment issues */
double f;
memcpy(&f, data, sizeof(double));
return f;
union { uint64_t i; double f; } u;
u.i = php_ifd_get64u(data, 0);
return u.f;
}

#ifdef EXIF_DEBUG
Expand Down
6 changes: 6 additions & 0 deletions travis/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ if [[ "$ENABLE_DEBUG" == 1 ]]; then
else
DEBUG="";
fi
if [[ "$S390X" == 1 ]]; then
S390X_CONFIG="--without-pcre-jit";
else
S390X_CONFIG="";
fi

if [[ -z "$CONFIG_LOG_FILE" ]]; then
CONFIG_QUIET="--quiet"
Expand All @@ -32,6 +37,7 @@ MAKE_JOBS=${MAKE_JOBS:-$(nproc)}
$CONFIG_QUIET \
$DEBUG \
$TS \
$S390X_CONFIG \
--enable-phpdbg \
--enable-fpm \
--with-pdo-mysql=mysqlnd \
Expand Down
2 changes: 1 addition & 1 deletion travis/setup-pgsql.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
echo '
<?php $conn_str .= " user=postgres"; ?>' >> "./ext/pgsql/tests/config.inc"
if [ -z "$ARM64" ]; then
if [ -z "$ARM64" -o -z "$S390X"]; then
psql -c 'create database test;' -U postgres
fi