[llvm-branch-commits] [compiler-rt] release/19.x: [compiler-rt] Fix format string warnings in FreeBSD DumpAllRegisters (#101072) (PR #101077)

2024-07-29 Thread David CARLIER via llvm-branch-commits

https://github.com/devnexen approved this pull request.


https://github.com/llvm/llvm-project/pull/101077
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] [openmp] __kmp_x86_cpuid fix for i386/PIC builds. (#84626) (PR #85053)

2024-03-13 Thread David CARLIER via llvm-branch-commits

https://github.com/devnexen created 
https://github.com/llvm/llvm-project/pull/85053

None

>From 783bda15597707c0a4022024aa8661e0cae176ad Mon Sep 17 00:00:00 2001
From: David CARLIER 
Date: Mon, 11 Mar 2024 13:15:43 +
Subject: [PATCH] [openmp] __kmp_x86_cpuid fix for i386/PIC builds. (#84626)

---
 openmp/runtime/src/kmp.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index e3a1e20731bbe0..d51ec886cfe556 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -1403,9 +1403,19 @@ extern void __kmp_query_cpuid(kmp_cpuinfo_t *p);
 // subleaf is only needed for cache and topology discovery and can be set to
 // zero in most cases
 static inline void __kmp_x86_cpuid(int leaf, int subleaf, struct kmp_cpuid *p) 
{
+#if KMP_ARCH_X86 && (defined(__pic__) || defined(__PIC__))
+  // on i386 arch, the ebx reg. is used by pic, thus we need to preserve from
+  // being trashed beforehand
+  __asm__ __volatile__("mov %%ebx, %%edi\n"
+   "cpuid\n"
+   "xchg %%edi, %%ebx\n"
+   : "=a"(p->eax), "=b"(p->ebx), "=c"(p->ecx), "=d"(p->edx)
+   : "a"(leaf), "c"(subleaf));
+#else
   __asm__ __volatile__("cpuid"
: "=a"(p->eax), "=b"(p->ebx), "=c"(p->ecx), "=d"(p->edx)
: "a"(leaf), "c"(subleaf));
+#endif
 }
 // Load p into FPU control word
 static inline void __kmp_load_x87_fpu_control_word(const kmp_int16 *p) {

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] [openmp] __kmp_x86_cpuid fix for i386/PIC builds. (#84626) (PR #85053)

2024-03-13 Thread David CARLIER via llvm-branch-commits

devnexen wrote:

to backport from [#85051](https://github.com/llvm/llvm-project/issues/85051)

https://github.com/llvm/llvm-project/pull/85053
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] Revert "release/18.x: [openmp] __kmp_x86_cpuid fix for i386/PIC builds. (#84626)" (PR #85527)

2024-03-16 Thread David CARLIER via llvm-branch-commits

https://github.com/devnexen created 
https://github.com/llvm/llvm-project/pull/85527

Reverts llvm/llvm-project#85053

>From fc108ac9e491ff488297b78a05629239ee997f40 Mon Sep 17 00:00:00 2001
From: David CARLIER 
Date: Sat, 16 Mar 2024 13:41:33 +
Subject: [PATCH] =?UTF-8?q?Revert=20"release/18.x:=20[openmp]=20=5F=5Fkmp?=
 =?UTF-8?q?=5Fx86=5Fcpuid=20fix=20for=20i386/PIC=20builds.=20(#846?=
 =?UTF-8?q?=E2=80=A6"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit 9b3edb592debc00a5c3fbf7a71f63e07d6af44be.
---
 openmp/runtime/src/kmp.h | 10 --
 1 file changed, 10 deletions(-)

diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index d51ec886cfe556..e3a1e20731bbe0 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -1403,19 +1403,9 @@ extern void __kmp_query_cpuid(kmp_cpuinfo_t *p);
 // subleaf is only needed for cache and topology discovery and can be set to
 // zero in most cases
 static inline void __kmp_x86_cpuid(int leaf, int subleaf, struct kmp_cpuid *p) 
{
-#if KMP_ARCH_X86 && (defined(__pic__) || defined(__PIC__))
-  // on i386 arch, the ebx reg. is used by pic, thus we need to preserve from
-  // being trashed beforehand
-  __asm__ __volatile__("mov %%ebx, %%edi\n"
-   "cpuid\n"
-   "xchg %%edi, %%ebx\n"
-   : "=a"(p->eax), "=b"(p->ebx), "=c"(p->ecx), "=d"(p->edx)
-   : "a"(leaf), "c"(subleaf));
-#else
   __asm__ __volatile__("cpuid"
: "=a"(p->eax), "=b"(p->ebx), "=c"(p->ecx), "=d"(p->edx)
: "a"(leaf), "c"(subleaf));
-#endif
 }
 // Load p into FPU control word
 static inline void __kmp_load_x87_fpu_control_word(const kmp_int16 *p) {

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] Revert "release/18.x: [openmp] __kmp_x86_cpuid fix for i386/PIC builds. (#84626)" (PR #85527)

2024-03-16 Thread David CARLIER via llvm-branch-commits

devnexen wrote:

@tstellar see [this for 
context](https://github.com/llvm/llvm-project/pull/84626#issuecomment-2001983167)

https://github.com/llvm/llvm-project/pull/85527
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] release/19.x: [compiler-rt][fuzzer] SetThreadName build fix for Mingw… (PR #106908)

2024-09-01 Thread David CARLIER via llvm-branch-commits

https://github.com/devnexen created 
https://github.com/llvm/llvm-project/pull/106908

…in attempt (#106902)

>From 37732be4723835e6afa063b16094fef448fa61bf Mon Sep 17 00:00:00 2001
From: David CARLIER 
Date: Sun, 1 Sep 2024 13:35:10 +0100
Subject: [PATCH] release/19.x: [compiler-rt][fuzzer] SetThreadName build fix
 for Mingwin attempt (#106902)

---
 compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp | 4 
 1 file changed, 4 insertions(+)

diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp 
b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
index db80eb383885e6..b262755fa436b2 100644
--- a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
@@ -239,6 +239,7 @@ size_t PageSize() {
 }
 
 void SetThreadName(std::thread &thread, const std::string &name) {
+#if !defined(__MINGW32__)
   typedef HRESULT(WINAPI * proc)(HANDLE, PCWSTR);
   HMODULE kbase = GetModuleHandleA("KernelBase.dll");
   proc ThreadNameProc =
@@ -253,6 +254,9 @@ void SetThreadName(std::thread &thread, const std::string 
&name) {
   }
 }
   }
+#else
+  (void)pthread_setname_np(thread.native_handle(), name.c_str());
+#endif
 }
 
 } // namespace fuzzer

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] release/19.x: [compiler-rt][fuzzer] SetThreadName build fix for Mingw… (PR #106908)

2024-09-02 Thread David CARLIER via llvm-branch-commits

https://github.com/devnexen closed 
https://github.com/llvm/llvm-project/pull/106908
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [cfe-branch] r338993 - Release notes for write exec detection features

2018-08-07 Thread David Carlier via llvm-branch-commits
Author: devnexen
Date: Mon Aug  6 01:05:11 2018
New Revision: 338993

URL: http://llvm.org/viewvc/llvm-project?rev=338993&view=rev
Log:
Release notes for write exec detection features

Modified:
cfe/branches/release_70/docs/AddressSanitizer.rst
cfe/branches/release_70/docs/MemorySanitizer.rst
cfe/branches/release_70/docs/ReleaseNotes.rst

Modified: cfe/branches/release_70/docs/AddressSanitizer.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/branches/release_70/docs/AddressSanitizer.rst?rev=338993&r1=338992&r2=338993&view=diff
==
--- cfe/branches/release_70/docs/AddressSanitizer.rst (original)
+++ cfe/branches/release_70/docs/AddressSanitizer.rst Mon Aug  6 01:05:11 2018
@@ -144,6 +144,12 @@ For more information on leak detector in
 and can be enabled using ``ASAN_OPTIONS=detect_leaks=1`` on OS X;
 however, it is not yet supported on other platforms.
 
+Writable/Executable paging detection
+
+
+The W^X detection is disabled by default and can be enabled using
+``ASAN_OPTIONS=detect_write_exec=1``.
+
 Issue Suppression
 =
 

Modified: cfe/branches/release_70/docs/MemorySanitizer.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/branches/release_70/docs/MemorySanitizer.rst?rev=338993&r1=338992&r2=338993&view=diff
==
--- cfe/branches/release_70/docs/MemorySanitizer.rst (original)
+++ cfe/branches/release_70/docs/MemorySanitizer.rst Mon Aug  6 01:05:11 2018
@@ -165,6 +165,13 @@ to:
 #. Set environment variable `MSAN_OPTIONS=poison_in_dtor=1` before running
the program.
 
+Writable/Executable paging detection
+
+
+You can eable writable-executable page detection in MemorySanitizer by
+setting the environment variable `MSAN_OPTIONS=detect_write_exec=1` before
+running the program.
+
 Handling external code
 ==
 

Modified: cfe/branches/release_70/docs/ReleaseNotes.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/branches/release_70/docs/ReleaseNotes.rst?rev=338993&r1=338992&r2=338993&view=diff
==
--- cfe/branches/release_70/docs/ReleaseNotes.rst (original)
+++ cfe/branches/release_70/docs/ReleaseNotes.rst Mon Aug  6 01:05:11 2018
@@ -284,7 +284,8 @@ libclang
 Static Analyzer
 ---
 
-- ...
+- The new `MmapWriteExec` checker had been introduced to detect attempts to 
map pages
+both writable and executable.
 
 ...
 


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] release/19.x: [compiler-rt] Remove SHA2 interceptions for NetBSD/Free… (PR #111725)

2024-10-09 Thread David CARLIER via llvm-branch-commits

https://github.com/devnexen created 
https://github.com/llvm/llvm-project/pull/111725

…BSD. (#110246)

For backport #111724

To Fix #110215

Interceptors introduced with 18a7ebda99044473fdbce6376993714ff54e6690

>From cb632327b87e78506d6d91d1d7244e5a5f5c87e6 Mon Sep 17 00:00:00 2001
From: David CARLIER 
Date: Wed, 9 Oct 2024 05:47:00 +0100
Subject: [PATCH] release/19.x: [compiler-rt] Remove SHA2 interceptions for
 NetBSD/FreeBSD. (#110246)

To Fix #110215

Interceptors introduced with 18a7ebda99044473fdbce6376993714ff54e6690
---
 .../sanitizer_common_interceptors.inc | 180 ---
 .../sanitizer_platform_interceptors.h |   2 -
 .../TestCases/FreeBSD/md5.cpp | 119 --
 .../TestCases/FreeBSD/sha2.cpp| 214 --
 .../sanitizer_common/TestCases/NetBSD/md5.cpp | 114 --
 .../TestCases/NetBSD/sha2.cpp | 206 -
 6 files changed, 835 deletions(-)
 delete mode 100644 compiler-rt/test/sanitizer_common/TestCases/FreeBSD/md5.cpp
 delete mode 100644 compiler-rt/test/sanitizer_common/TestCases/FreeBSD/sha2.cpp
 delete mode 100644 compiler-rt/test/sanitizer_common/TestCases/NetBSD/md5.cpp
 delete mode 100644 compiler-rt/test/sanitizer_common/TestCases/NetBSD/sha2.cpp

diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc 
b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index 49c9dcbef358ff..7a7af7936af315 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -8823,83 +8823,6 @@ INTERCEPTOR(char *, RMD160Data, u8 *data, SIZE_T len, 
char *buf) {
 #define INIT_RMD160
 #endif
 
-#if SANITIZER_INTERCEPT_MD5
-INTERCEPTOR(void, MD5Init, void *context) {
-  void *ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, MD5Init, context);
-  REAL(MD5Init)(context);
-  if (context)
-COMMON_INTERCEPTOR_WRITE_RANGE(ctx, context, MD5_CTX_sz);
-}
-
-INTERCEPTOR(void, MD5Update, void *context, const unsigned char *data,
-unsigned int len) {
-  void *ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, MD5Update, context, data, len);
-  if (data && len > 0)
-COMMON_INTERCEPTOR_READ_RANGE(ctx, data, len);
-  if (context)
-COMMON_INTERCEPTOR_READ_RANGE(ctx, context, MD5_CTX_sz);
-  REAL(MD5Update)(context, data, len);
-  if (context)
-COMMON_INTERCEPTOR_WRITE_RANGE(ctx, context, MD5_CTX_sz);
-}
-
-INTERCEPTOR(void, MD5Final, unsigned char digest[16], void *context) {
-  void *ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, MD5Final, digest, context);
-  if (context)
-COMMON_INTERCEPTOR_READ_RANGE(ctx, context, MD5_CTX_sz);
-  REAL(MD5Final)(digest, context);
-  if (digest)
-COMMON_INTERCEPTOR_WRITE_RANGE(ctx, digest, sizeof(unsigned char) * 16);
-}
-
-INTERCEPTOR(char *, MD5End, void *context, char *buf) {
-  void *ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, MD5End, context, buf);
-  if (context)
-COMMON_INTERCEPTOR_READ_RANGE(ctx, context, MD5_CTX_sz);
-  char *ret = REAL(MD5End)(context, buf);
-  if (ret)
-COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ret, MD5_return_length);
-  return ret;
-}
-
-INTERCEPTOR(char *, MD5File, const char *filename, char *buf) {
-  void *ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, MD5File, filename, buf);
-  if (filename)
-COMMON_INTERCEPTOR_READ_RANGE(ctx, filename, internal_strlen(filename) + 
1);
-  char *ret = REAL(MD5File)(filename, buf);
-  if (ret)
-COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ret, MD5_return_length);
-  return ret;
-}
-
-INTERCEPTOR(char *, MD5Data, const unsigned char *data, unsigned int len,
-char *buf) {
-  void *ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, MD5Data, data, len, buf);
-  if (data && len > 0)
-COMMON_INTERCEPTOR_READ_RANGE(ctx, data, len);
-  char *ret = REAL(MD5Data)(data, len, buf);
-  if (ret)
-COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ret, MD5_return_length);
-  return ret;
-}
-
-#define INIT_MD5   
\
-  COMMON_INTERCEPT_FUNCTION(MD5Init);  
\
-  COMMON_INTERCEPT_FUNCTION(MD5Update);
\
-  COMMON_INTERCEPT_FUNCTION(MD5Final); 
\
-  COMMON_INTERCEPT_FUNCTION(MD5End);   
\
-  COMMON_INTERCEPT_FUNCTION(MD5File);  
\
-  COMMON_INTERCEPT_FUNCTION(MD5Data)
-#else
-#define INIT_MD5
-#endif
-
 #if SANITIZER_INTERCEPT_FSEEK
 INTERCEPTOR(int, fseek, __sanitizer_FILE *stream, long int offset, int whence) 
{
   void *ctx;
@@ -9030,107 +8953,6 @@ INTERCEPTOR(char *, MD2Data, const unsigned char *data, 
unsigned int len,
 #define INIT_MD2
 #endif
 
-#if SANITIZER_INTERCEPT_SHA2
-#define SHA2_INTERCEPTORS(LEN, SHA2_STATE_T) \
-  INTERCEPTOR(void, SHA##LEN##_Init, void *context) { \
-void *ctx; \
-COMMON_INTERCEPTOR_ENTER(ctx, SHA##LEN##_Init, context); \
-REAL(SHA#

[llvm-branch-commits] [compiler-rt] release/19.x: [compiler-rt] [fuzzer] Skip trying to set the thread name on MinGW (#115167) (PR #115287)

2024-11-07 Thread David CARLIER via llvm-branch-commits

https://github.com/devnexen approved this pull request.


https://github.com/llvm/llvm-project/pull/115287
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/20.x: [OpenMP][libomp] Add OpenBSD, NetBSD and DragonFly stdarg handling (#126182) (PR #127548)

2025-02-17 Thread David CARLIER via llvm-branch-commits

https://github.com/devnexen approved this pull request.


https://github.com/llvm/llvm-project/pull/127548
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits