Bug 465782

Summary: s390x: Valgrind doesn't compile with Clang on s390x
Product: [Developer tools] valgrind Reporter: Andreas Arnez <arnez>
Component: generalAssignee: Andreas Arnez <arnez>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Enable compiling Valgrind with clang

Description Andreas Arnez 2023-02-15 17:25:56 UTC
When trying to compile Valgrind with Clang on s390x, there are multiple errors:

(1) "scalar-to-vector conversion failed, possible invalid constraint for vector type" -- in various inline-assemblies where an unsigned long is passed to an "f" constraint.
(2) "register expected" -- in an inline assembly where the notation "r11" for a general register is used.
(3) "invalid operand in inline asm: 'svc ${1:b}" -- in an inline assembly where a "b" modifier is used for a constant.
(4) "__builtin_setjmp is not supported for the current target" -- when expanding the VG_MINIMAL_SETJMP/LONGJMP macros.
Comment 1 Andreas Arnez 2023-04-04 14:13:10 UTC
Created attachment 157848 [details]
Enable compiling Valgrind with clang

This enables compiling Valgrind with Clang, excluding the s390-specific test cases. I'm working on another patch for the test cases, but that will be more extensive.
Comment 2 Andreas Arnez 2023-05-11 10:57:20 UTC
(In reply to Andreas Arnez from comment #1)
> Created attachment 157848 [details]
> Enable compiling Valgrind with clang
I pushed the above. Now clang should compile Valgrind for s390x successfully, except for the test cases.
Comment 3 Andreas Arnez 2023-10-19 11:58:05 UTC
I also pushed various patches for the test cases. While I've still seen Clang-specific issues with test case results, at least Valgrind can now be fully built with Clang for s390x. In my view, further test case fixes are out of the scope of this Bug. So I consider this fixed.