From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <azanella@sourceware.org>
Received: by sourceware.org (Postfix, from userid 1791)
	id E982A3858407; Mon, 29 Jan 2024 18:04:04 +0000 (GMT)
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E982A3858407
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org;
	s=default; t=1706551444;
	bh=xL6Kq/tG8GZn1gCX9VLTVnX373h/fID5sUEEptejxTE=;
	h=From:To:Subject:Date:From;
	b=kACZk3JrDZbM5D6y4QZweHpPIGc0Seb85sZmh6OylWnJ5G+qaVVYBbeNvTL3TX3h6
	 3JzvWln1xTNWnx8EraY9VjSYKNUIRaYnoMqHthDASLYCeQ6oWSHcwxJ6NvWwyWHlke
	 ggz+/KHd75lCwz3MyUiUAo2ekKEOEoir+QP0P/to=
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/azanella/clang] i386: Disable some tests on clang
X-Act-Checkin: glibc
X-Git-Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
X-Git-Refname: refs/heads/azanella/clang
X-Git-Oldrev: 93f896f657530df360d3b943f1bdfde7cd6fe3a3
X-Git-Newrev: 2919b8e2f476855f4fe6a23f0339f130a6001f88
Message-Id: <20240129180404.E982A3858407@sourceware.org>
Date: Mon, 29 Jan 2024 18:04:04 +0000 (GMT)
List-Id: <glibc-cvs.sourceware.org>

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2919b8e2f476855f4fe6a23f0339f130a6001f88

commit 2919b8e2f476855f4fe6a23f0339f130a6001f88
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Jul 28 09:34:03 2023 -0300

    i386: Disable some tests on clang
    
    clang generated R_I386_PC32 instead of R_386_PLT32 for static
    ifoo calls, which triggers an ld issues where it can not link
    non-PIC and PIC objects.  This seems to be a clang bug.

Diff:
---
 elf/ifuncmain9.c              | 5 +++++
 sysdeps/x86/tst-ifunc-isa-1.c | 5 +++++
 sysdeps/x86/tst-ifunc-isa-2.c | 4 ++++
 3 files changed, 14 insertions(+)

diff --git a/elf/ifuncmain9.c b/elf/ifuncmain9.c
index a13020dc6d..ed9c5a5d86 100644
--- a/elf/ifuncmain9.c
+++ b/elf/ifuncmain9.c
@@ -23,6 +23,7 @@
 # include <stdbool.h>
 # include <stdio.h>
 # include <libc-diag.h>
+# include <support/test-driver.h>
 
 /* Do not use the test framework, so that the process setup is not
    disturbed.  */
@@ -57,6 +58,9 @@ DIAG_POP_NEEDS_COMMENT_CLANG;
 int
 main (void)
 {
+#if defined __clang__ && defined __i386__
+  return EXIT_UNSUPPORTED;
+#else
   bool errors = false;
 
   if (implementation_called != 0)
@@ -93,4 +97,5 @@ main (void)
     }
 
   return errors;
+#endif
 }
diff --git a/sysdeps/x86/tst-ifunc-isa-1.c b/sysdeps/x86/tst-ifunc-isa-1.c
index 44726576f1..276efc0572 100644
--- a/sysdeps/x86/tst-ifunc-isa-1.c
+++ b/sysdeps/x86/tst-ifunc-isa-1.c
@@ -17,14 +17,19 @@
    <https://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
+#include <support/test-driver.h>
 #include "tst-ifunc-isa.h"
 
 static int
 do_test (void)
 {
+#if defined __clang__ && defined __i386__
+  return EXIT_UNSUPPORTED;
+#else
   enum isa value = foo ();
   enum isa expected = get_isa ();
   return value == expected ? EXIT_SUCCESS : EXIT_FAILURE;
+#endif
 }
 
 #include <support/test-driver.c>
diff --git a/sysdeps/x86/tst-ifunc-isa-2.c b/sysdeps/x86/tst-ifunc-isa-2.c
index 156c649807..130169b614 100644
--- a/sysdeps/x86/tst-ifunc-isa-2.c
+++ b/sysdeps/x86/tst-ifunc-isa-2.c
@@ -23,12 +23,16 @@
 static int
 do_test (void)
 {
+#if defined __clang__ && defined __i386__
+  return EXIT_UNSUPPORTED;
+#else
   /* CPU must support SSE2.  */
   if (!__builtin_cpu_supports ("sse2"))
     return EXIT_UNSUPPORTED;
   enum isa value = foo ();
   /* All ISAs, but SSE2, are disabled by tunables.  */
   return value == sse2 ? EXIT_SUCCESS : EXIT_FAILURE;
+#endif
 }
 
 #include <support/test-driver.c>