#37 Backport 82150606fb11d28813ae6 & Use llvm-integration-test-suite for gating
Merged 3 years ago by sergesanspaille. Opened 3 years ago by sergesanspaille.
rpms/ sergesanspaille/compiler-rt rawhide  into  rawhide

@@ -0,0 +1,72 @@ 

+ From c85d1e10cad1fea2c43f9ec5332761d2ca725721 Mon Sep 17 00:00:00 2001

+ From: Vitaly Buka <vitalybuka@google.com>

+ Date: Fri, 16 Apr 2021 09:50:24 -0700

+ Subject: [PATCH 2/2] [PATCH][compiler-rt] Sanitizer built against glibc 2.34

+  doesn't work

+ 

+ As mentioned in https://gcc.gnu.org/PR100114 , glibc starting with the

+ https://sourceware.org/git/?p=glibc.git;a=commit;h=6c57d320484988e87e446e2e60ce42816bf51d53

+ change doesn't define SIGSTKSZ and MINSIGSTKSZ macros to constants, but to sysconf function call.

+ sanitizer_posix_libcdep.cpp has

+ static const uptr kAltStackSize = SIGSTKSZ * 4;  // SIGSTKSZ is not enough.

+ which is generally fine, just means that when SIGSTKSZ is not a compile time constant will be initialized later.

+ The problem is that kAltStackSize is used in SetAlternateSignalStack which is called very early, from .preinit_array

+ initialization, i.e. far before file scope variables are constructed, which means it is not initialized and

+ mmapping 0 will fail:

+ ==145==ERROR: AddressSanitizer failed to allocate 0x0 (0) bytes of SetAlternateSignalStack (error code: 22)

+ 

+ Here is one possible fix, another one could be to make kAltStackSize a preprocessor macro if _SG_SIGSTKSZ is defined

+ (but perhaps with having an automatic const variable initialized to it so that sysconf isn't at least called twice

+ during SetAlternateSignalStack.

+ 

+ Reviewed By: vitalybuka

+ 

+ Differential Revision: https://reviews.llvm.org/D100645

+ 

+ (cherry picked from commit 82150606fb11d28813ae6da1101f5bda638165fe)

+ ---

+  compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp | 12 ++++++++----

+  1 file changed, 8 insertions(+), 4 deletions(-)

+ 

+ diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp

+ index d29438c..2b10bdd 100644

+ --- a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp

+ +++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp

+ @@ -165,7 +165,11 @@ bool SupportsColoredOutput(fd_t fd) {

+  

+  #if !SANITIZER_GO

+  // TODO(glider): different tools may require different altstack size.

+ -static const uptr kAltStackSize = SIGSTKSZ * 4;  // SIGSTKSZ is not enough.

+ +static uptr GetAltStackSize() {

+ +  // SIGSTKSZ is not enough.

+ +  static const uptr kAltStackSize = SIGSTKSZ * 4;

+ +  return kAltStackSize;

+ +}

+  

+  void SetAlternateSignalStack() {

+    stack_t altstack, oldstack;

+ @@ -176,10 +180,10 @@ void SetAlternateSignalStack() {

+    // TODO(glider): the mapped stack should have the MAP_STACK flag in the

+    // future. It is not required by man 2 sigaltstack now (they're using

+    // malloc()).

+ -  void* base = MmapOrDie(kAltStackSize, __func__);

+ +  void *base = MmapOrDie(GetAltStackSize(), __func__);

+    altstack.ss_sp = (char*) base;

+    altstack.ss_flags = 0;

+ -  altstack.ss_size = kAltStackSize;

+ +  altstack.ss_size = GetAltStackSize();

+    CHECK_EQ(0, sigaltstack(&altstack, nullptr));

+  }

+  

+ @@ -187,7 +191,7 @@ void UnsetAlternateSignalStack() {

+    stack_t altstack, oldstack;

+    altstack.ss_sp = nullptr;

+    altstack.ss_flags = SS_DISABLE;

+ -  altstack.ss_size = kAltStackSize;  // Some sane value required on Darwin.

+ +  altstack.ss_size = GetAltStackSize();  // Some sane value required on Darwin.

+    CHECK_EQ(0, sigaltstack(&altstack, &oldstack));

+    UnmapOrDie(oldstack.ss_sp, oldstack.ss_size);

+  }

+ -- 

+ 1.8.3.1

+ 

@@ -0,0 +1,26 @@ 

+ From d95be525ceceb5afeaa87f4de95c30ec664b17d3 Mon Sep 17 00:00:00 2001

+ From: serge-sans-paille <sguelton@redhat.com>

+ Date: Tue, 11 May 2021 14:38:21 +0200

+ Subject: [PATCH][compiler-rt] Do not introduce a dependency on c++ runtime

+ 

+ That's at the expense of a runtime overhead though.

+ ---

+  compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp

+ index 2b10bdd..240e6b3e 100644

+ --- a/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp

+ +++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp

+ @@ -167,7 +167,7 @@ bool SupportsColoredOutput(fd_t fd) {

+  // TODO(glider): different tools may require different altstack size.

+  static uptr GetAltStackSize() {

+    // SIGSTKSZ is not enough.

+ -  static const uptr kAltStackSize = SIGSTKSZ * 4;

+ +  const uptr kAltStackSize = SIGSTKSZ * 4;

+    return kAltStackSize;

+  }

+  

+ -- 

+ 1.8.3.1

+ 

file added
+113
@@ -0,0 +1,113 @@ 

+ Index: compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc

+ ===================================================================

+ --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc

+ +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc

+ @@ -370,6 +370,7 @@

+  

+  #if SANITIZER_GLIBC

+    // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE

+ +#if SANITIZER_LINUX_CYCLADES

+    _(CYGETDEFTHRESH, WRITE, sizeof(int));

+    _(CYGETDEFTIMEOUT, WRITE, sizeof(int));

+    _(CYGETMON, WRITE, struct_cyclades_monitor_sz);

+ @@ -379,6 +380,7 @@

+    _(CYSETDEFTIMEOUT, NONE, 0);

+    _(CYSETTHRESH, NONE, 0);

+    _(CYSETTIMEOUT, NONE, 0);

+ +#endif

+    _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);

+    _(EQL_ENSLAVE, WRITE, struct_ifreq_sz);

+    _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);

+ Index: compiler-rt/lib/sanitizer_common/sanitizer_platform.h

+ ===================================================================

+ --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h

+ +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h

+ @@ -390,4 +390,17 @@

+  #define SANITIZER_SUPPORTS_INIT_FOR_DLOPEN 0

+  #endif

+  

+ +// Kernel has removed this header, as such check for it's existance

+ +// before trying to include defines from it.

+ +// https://lkml.org/lkml/2021/3/2/153

+ +#ifdef __has_include

+ +# if __has_include(<linux/cyclades.h>) && !SANITIZER_ANDROID

+ +#  define SANITIZER_LINUX_CYCLADES 1

+ +# else

+ +#  define SANITIZER_LINUX_CYCLADES 0

+ +# endif

+ +#else

+ +#  define SANITIZER_LINUX_CYCLADES 0

+ +#endif

+ +

+  #endif // SANITIZER_PLATFORM_H

+ Index: compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

+ ===================================================================

+ --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

+ +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

+ @@ -983,7 +983,9 @@

+  

+  #if SANITIZER_LINUX && !SANITIZER_ANDROID

+  extern unsigned struct_ax25_parms_struct_sz;

+ +#if SANITIZER_LINUX_CYCLADES

+  extern unsigned struct_cyclades_monitor_sz;

+ +#endif

+  extern unsigned struct_input_keymap_entry_sz;

+  extern unsigned struct_ipx_config_data_sz;

+  extern unsigned struct_kbdiacrs_sz;

+ @@ -1328,6 +1330,7 @@

+  #endif  // SANITIZER_LINUX

+  

+  #if SANITIZER_LINUX && !SANITIZER_ANDROID

+ +#if SANITIZER_LINUX_CYCLADES

+  extern unsigned IOCTL_CYGETDEFTHRESH;

+  extern unsigned IOCTL_CYGETDEFTIMEOUT;

+  extern unsigned IOCTL_CYGETMON;

+ @@ -1337,6 +1340,7 @@

+  extern unsigned IOCTL_CYSETDEFTIMEOUT;

+  extern unsigned IOCTL_CYSETTHRESH;

+  extern unsigned IOCTL_CYSETTIMEOUT;

+ +#endif

+  extern unsigned IOCTL_EQL_EMANCIPATE;

+  extern unsigned IOCTL_EQL_ENSLAVE;

+  extern unsigned IOCTL_EQL_GETMASTRCFG;

+ Index: compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp

+ ===================================================================

+ --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp

+ +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp

+ @@ -143,7 +143,9 @@

+  # include <sys/procfs.h>

+  #endif

+  #include <sys/user.h>

+ -#include <linux/cyclades.h>

+ +#if SANITIZER_LINUX_CYCLADES

+ +# include <linux/cyclades.h>

+ +#endif

+  #include <linux/if_eql.h>

+  #include <linux/if_plip.h>

+  #include <linux/lp.h>

+ @@ -460,7 +462,9 @@

+  

+  #if SANITIZER_GLIBC

+    unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);

+ +#if SANITIZER_LINUX_CYCLADES

+    unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);

+ +#endif

+  #if EV_VERSION > (0x010000)

+    unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);

+  #else

+ @@ -824,6 +828,7 @@

+  #endif // SANITIZER_LINUX

+  

+  #if SANITIZER_LINUX && !SANITIZER_ANDROID

+ +#if SANITIZER_LINUX_CYCLADES

+    unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;

+    unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;

+    unsigned IOCTL_CYGETMON = CYGETMON;

+ @@ -833,6 +838,7 @@

+    unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;

+    unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;

+    unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;

+ +#endif

+    unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;

+    unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;

+    unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;

file modified
+7 -1
@@ -10,7 +10,7 @@ 

  

  Name:		compiler-rt

  Version:	12.0.0%{?rc_ver:~rc%{rc_ver}}

- Release:	1%{?dist}

+ Release:	2%{?dist}

  Summary:	LLVM "compiler-rt" runtime libraries

  

  License:	NCSA or MIT
@@ -20,6 +20,9 @@ 

  Source2:	tstellar-gpg-key.asc

  

  Patch0:		0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..patch

+ Patch1:		0002-PATCH-compiler-rt-Sanitizer-built-against-glibc-2.34.patch

+ Patch2:		D102059.diff

+ Patch3:		0003-PATCH-compiler-rt-Do-not-introduce-a-dependency-on-c.patch

  

  BuildRequires:	gcc

  BuildRequires:	gcc-c++
@@ -109,6 +112,9 @@ 

  %endif

  

  %changelog

+ * Mon May 10 2021 sguelton@redhat.com - 12.0.0-2

+ - Backport 82150606fb11d28813ae6

+ 

  * Fri Apr 16 2021 Tom Stellard <tstellar@redhat.com> - 12.0.0-1

  - 12.0.0 Release

  

file added
+12
@@ -0,0 +1,12 @@ 

+ --- !Policy

+ product_versions:

+   - fedora-*

+ decision_context: bodhi_update_push_testing

+ rules:

+   - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

+ --- !Policy

+ product_versions:

+   - fedora-*

+ decision_context: bodhi_update_push_stable

+ rules:

+   - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

@@ -0,0 +1,38 @@ 

+ #!/bin/bash

+ 

+ usage() {

+     echo "usage `basename $0` [OPTIONS]"

+     echo "  --threads NUM       The number of threads to use for running tests."

+ }

+ 

+ thread_args=""

+ repo_url=https://github.com/opencollab/llvm-toolchain-integration-test-suite

+ 

+ while [ $# -gt 0 ]; do

+     case $1 in

+         --threads)

+             shift

+             threads="$1"

+             ;;

+         * )

+             echo "unknown option: $1"

+             echo ""

+             usage

+             exit 1

+             ;;

+     esac

+     shift

+ done

+ 

+ if [ -n "$threads" ]; then

+   thread_args="-j$threads"

+ fi

+ 

+ set -xe

+ 

+ cd $(mktemp -d -p /var/tmp)

+ git clone $repo_url

+ cd llvm-toolchain-integration-test-suite

+ mkdir _build && cd _build

+ cmake .. -GNinja

+ ninja $thread_args check

file added
+23
@@ -0,0 +1,23 @@ 

+ - hosts: localhost

+   roles:

+   - role: standard-test-basic

+     tags:

+       - classic

+     required_packages:

+       # the requirements below are for the integration suite

+       - cmake

+       - llvm-devel

+       - clang

+       - clang-analyzer

+       - clang-tools-extra

+       - compiler-rt

+       - ninja-build

+       - libcxx-devel

+       - libomp-devel

+       - python-lit

+       - lld

+       - lldb

+       - git

+       - make

+     tests:

+       - integration-test-suite

no initial comment

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

1 new commit added

  • WIP
3 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

3 new commits added

  • WIP
  • Use llvm-integration-test-suite for gating
  • Backport 82150606fb11d28813ae6
3 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

1 new commit added

  • WIP
3 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

4 new commits added

  • WIP
  • WIP
  • Use llvm-integration-test-suite for gating
  • Backport 82150606fb11d28813ae6
3 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

1 new commit added

  • WIP
3 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

4 new commits added

  • Backport D102059
  • Patch upstream 0002-PATCH-compiler-rt-Sanitizer-built-against-glibc-2.34.patch
  • Use llvm-integration-test-suite for gating
  • Backport 82150606fb11d28813ae6
3 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

4 new commits added

  • Do not introduce a dependency on c++ runtime
  • Backport D102059
  • Use llvm-integration-test-suite for gating
  • Backport 82150606fb11d28813ae6
3 years ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Pull-Request has been merged by sergesanspaille

3 years ago