mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 22:46:15 +01:00
Merge branch 'wip/3v1n0/sys-64-clang' into 'main'
gatomic: Cast the oldval pointer type to the atomic value type, and add msys2-clang64 scheduled CI job Closes #2798 See merge request GNOME/glib!3031
This commit is contained in:
commit
9931696eca
@ -303,6 +303,7 @@ msys2-mingw32:
|
|||||||
variables:
|
variables:
|
||||||
MSYSTEM: "MINGW32"
|
MSYSTEM: "MINGW32"
|
||||||
CHERE_INVOKING: "yes"
|
CHERE_INVOKING: "yes"
|
||||||
|
CFLAGS: -coverage -ftest-coverage -fprofile-arcs
|
||||||
script:
|
script:
|
||||||
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
|
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
|
||||||
- C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
|
- C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
|
||||||
@ -317,6 +318,28 @@ msys2-mingw32:
|
|||||||
- _build/meson-logs
|
- _build/meson-logs
|
||||||
- _coverage/
|
- _coverage/
|
||||||
|
|
||||||
|
msys2-clang64:
|
||||||
|
extends: .only-schedules
|
||||||
|
stage: build
|
||||||
|
tags:
|
||||||
|
- win32-ps
|
||||||
|
needs: []
|
||||||
|
variables:
|
||||||
|
MSYSTEM: "CLANG64"
|
||||||
|
CHERE_INVOKING: "yes"
|
||||||
|
script:
|
||||||
|
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
|
||||||
|
- C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
|
||||||
|
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
junit: "_build/meson-logs/testlog.junit.xml"
|
||||||
|
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
|
||||||
|
when: always
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- _build/meson-logs
|
||||||
|
|
||||||
vs2017-x64:
|
vs2017-x64:
|
||||||
extends: .only-default
|
extends: .only-default
|
||||||
stage: build
|
stage: build
|
||||||
|
@ -1,29 +1,24 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -ex
|
||||||
|
|
||||||
export PATH="/c/msys64/$MSYSTEM/bin:$PATH"
|
export PATH="/c/msys64/$MSYSTEM/bin:$PATH"
|
||||||
if [[ "$MSYSTEM" == "MINGW32" ]]; then
|
|
||||||
export MSYS2_ARCH="i686"
|
|
||||||
else
|
|
||||||
export MSYS2_ARCH="x86_64"
|
|
||||||
fi
|
|
||||||
|
|
||||||
pacman --noconfirm -Suy
|
pacman --noconfirm -Suy
|
||||||
|
|
||||||
pacman --noconfirm -S --needed \
|
pacman --noconfirm -S --needed \
|
||||||
base-devel \
|
base-devel \
|
||||||
lcov \
|
lcov \
|
||||||
mingw-w64-$MSYS2_ARCH-ccache \
|
"${MINGW_PACKAGE_PREFIX}"-ccache \
|
||||||
mingw-w64-$MSYS2_ARCH-gettext \
|
"${MINGW_PACKAGE_PREFIX}"-gettext \
|
||||||
mingw-w64-$MSYS2_ARCH-libffi \
|
"${MINGW_PACKAGE_PREFIX}"-libffi \
|
||||||
mingw-w64-$MSYS2_ARCH-meson \
|
"${MINGW_PACKAGE_PREFIX}"-meson \
|
||||||
mingw-w64-$MSYS2_ARCH-pcre2 \
|
"${MINGW_PACKAGE_PREFIX}"-pcre2 \
|
||||||
mingw-w64-$MSYS2_ARCH-python3 \
|
"${MINGW_PACKAGE_PREFIX}"-python3 \
|
||||||
mingw-w64-$MSYS2_ARCH-python-pip \
|
"${MINGW_PACKAGE_PREFIX}"-python-pip \
|
||||||
mingw-w64-$MSYS2_ARCH-toolchain \
|
"${MINGW_PACKAGE_PREFIX}"-toolchain \
|
||||||
mingw-w64-$MSYS2_ARCH-zlib \
|
"${MINGW_PACKAGE_PREFIX}"-zlib \
|
||||||
mingw-w64-$MSYS2_ARCH-libelf
|
"${MINGW_PACKAGE_PREFIX}"-libelf
|
||||||
|
|
||||||
mkdir -p _coverage
|
mkdir -p _coverage
|
||||||
mkdir -p _ccache
|
mkdir -p _ccache
|
||||||
@ -34,28 +29,39 @@ export CCACHE_BASEDIR CCACHE_DIR
|
|||||||
pip3 install --upgrade --user meson==0.60.3
|
pip3 install --upgrade --user meson==0.60.3
|
||||||
|
|
||||||
PATH="$(cygpath "$USERPROFILE")/.local/bin:$HOME/.local/bin:$PATH"
|
PATH="$(cygpath "$USERPROFILE")/.local/bin:$HOME/.local/bin:$PATH"
|
||||||
CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
|
|
||||||
DIR="$(pwd)"
|
DIR="$(pwd)"
|
||||||
export PATH CFLAGS
|
export PATH CFLAGS
|
||||||
|
|
||||||
meson --werror --buildtype debug _build
|
if [[ "$MSYSTEM" == "CLANG64" ]]; then
|
||||||
|
# FIXME: fix the clang build warnings
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
meson ${MESON_COMMON_OPTIONS} _build
|
||||||
|
else
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
meson ${MESON_COMMON_OPTIONS} --werror _build
|
||||||
|
fi
|
||||||
|
|
||||||
cd _build
|
cd _build
|
||||||
ninja
|
ninja
|
||||||
|
|
||||||
lcov \
|
if [[ "$CFLAGS" == *"-coverage"* ]]; then
|
||||||
--quiet \
|
lcov \
|
||||||
--config-file "${DIR}"/.lcovrc \
|
--quiet \
|
||||||
--directory "${DIR}/_build" \
|
--config-file "${DIR}"/.lcovrc \
|
||||||
--capture \
|
--directory "${DIR}/_build" \
|
||||||
--initial \
|
--capture \
|
||||||
--output-file "${DIR}/_coverage/${CI_JOB_NAME}-baseline.lcov"
|
--initial \
|
||||||
|
--output-file "${DIR}/_coverage/${CI_JOB_NAME}-baseline.lcov"
|
||||||
|
fi
|
||||||
|
|
||||||
# FIXME: fix the test suite
|
# FIXME: fix the test suite
|
||||||
meson test --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" --no-suite flaky || true
|
meson test --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" --no-suite flaky || true
|
||||||
|
|
||||||
lcov \
|
if [[ "$CFLAGS" == *"-coverage"* ]]; then
|
||||||
--quiet \
|
lcov \
|
||||||
--config-file "${DIR}"/.lcovrc \
|
--quiet \
|
||||||
--directory "${DIR}/_build" \
|
--config-file "${DIR}"/.lcovrc \
|
||||||
--capture \
|
--directory "${DIR}/_build" \
|
||||||
--output-file "${DIR}/_coverage/${CI_JOB_NAME}.lcov"
|
--capture \
|
||||||
|
--output-file "${DIR}/_coverage/${CI_JOB_NAME}.lcov"
|
||||||
|
fi
|
||||||
|
@ -40,7 +40,8 @@ static gpointer
|
|||||||
writer_thread (gpointer user_data)
|
writer_thread (gpointer user_data)
|
||||||
{
|
{
|
||||||
GOutputStream *out;
|
GOutputStream *out;
|
||||||
gssize nwrote, offset;
|
gssize nwrote;
|
||||||
|
size_t offset;
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
HANDLE out_handle;
|
HANDLE out_handle;
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ writer_thread (gpointer user_data)
|
|||||||
g_usleep (10);
|
g_usleep (10);
|
||||||
|
|
||||||
offset = 0;
|
offset = 0;
|
||||||
while (offset < (gssize) sizeof (DATA))
|
while (offset < sizeof (DATA))
|
||||||
{
|
{
|
||||||
nwrote = g_output_stream_write (out, DATA + offset,
|
nwrote = g_output_stream_write (out, DATA + offset,
|
||||||
sizeof (DATA) - offset,
|
sizeof (DATA) - offset,
|
||||||
|
@ -241,7 +241,8 @@ G_END_DECLS
|
|||||||
* https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715#note_1024120. */
|
* https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715#note_1024120. */
|
||||||
#define g_atomic_pointer_compare_and_exchange(atomic, oldval, newval) \
|
#define g_atomic_pointer_compare_and_exchange(atomic, oldval, newval) \
|
||||||
(G_GNUC_EXTENSION ({ \
|
(G_GNUC_EXTENSION ({ \
|
||||||
G_STATIC_ASSERT (sizeof (oldval) == sizeof (gpointer)); \
|
G_STATIC_ASSERT (sizeof (static_cast<glib_typeof (*(atomic))>((oldval))) \
|
||||||
|
== sizeof (gpointer)); \
|
||||||
glib_typeof (*(atomic)) gapcae_oldval = (oldval); \
|
glib_typeof (*(atomic)) gapcae_oldval = (oldval); \
|
||||||
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
|
G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); \
|
||||||
(void) (0 ? (gpointer) *(atomic) : NULL); \
|
(void) (0 ? (gpointer) *(atomic) : NULL); \
|
||||||
|
@ -1143,7 +1143,7 @@ write_to_file (const gchar *contents,
|
|||||||
{
|
{
|
||||||
gssize s;
|
gssize s;
|
||||||
|
|
||||||
s = write (fd, contents, MIN (length, G_MAXSSIZE));
|
s = write (fd, contents, MIN (length, G_MAXSIZE));
|
||||||
|
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,13 @@
|
|||||||
extra_gnulib_args = cc.get_supported_arguments([
|
extra_gnulib_args = cc.get_supported_arguments([
|
||||||
'-Wno-format-nonliteral', '-Wno-duplicated-branches'])
|
'-Wno-format-nonliteral', '-Wno-duplicated-branches'])
|
||||||
|
|
||||||
|
if host_system == 'windows' and cc.get_id() == 'clang'
|
||||||
|
extra_gnulib_args += cc.get_supported_arguments([
|
||||||
|
'-Wno-unused-but-set-variable',
|
||||||
|
'-Wno-implicit-fallthrough',
|
||||||
|
])
|
||||||
|
endif
|
||||||
|
|
||||||
math_h_config = configuration_data ()
|
math_h_config = configuration_data ()
|
||||||
|
|
||||||
unneeded_funcs = [
|
unneeded_funcs = [
|
||||||
|
@ -186,7 +186,11 @@ test_steal_pointer (void)
|
|||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
#else
|
||||||
|
g_test_init (&argc, &argv, static_cast<void *>(NULL));
|
||||||
|
#endif
|
||||||
|
|
||||||
g_test_add_func ("/C++/typeof", test_typeof);
|
g_test_add_func ("/C++/typeof", test_typeof);
|
||||||
g_test_add_func ("/C++/atomic-pointer-compare-and-exchange", test_atomic_pointer_compare_and_exchange);
|
g_test_add_func ("/C++/atomic-pointer-compare-and-exchange", test_atomic_pointer_compare_and_exchange);
|
||||||
|
@ -467,6 +467,7 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
|
|||||||
'-Werror=implicit-function-declaration',
|
'-Werror=implicit-function-declaration',
|
||||||
'-Werror=missing-prototypes',
|
'-Werror=missing-prototypes',
|
||||||
'-Werror=pointer-sign',
|
'-Werror=pointer-sign',
|
||||||
|
'-Wno-string-plus-int',
|
||||||
]
|
]
|
||||||
warning_cxx_args = warning_common_args
|
warning_cxx_args = warning_common_args
|
||||||
warning_objc_args = warning_c_args
|
warning_objc_args = warning_c_args
|
||||||
|
Loading…
Reference in New Issue
Block a user