On 24.10.2025 02:16, Saman Dehghan wrote:
> This change enables compatibility for measuring code coverage
> with Clang versions 14 through 20 by supporting their
> respective raw profile formats.

Isn't the 14 here stale now?

> 1- Added support for LLVM raw profile versions 5, 6, 7, 8, 9, and 10.
> 2- Initialized llvm_profile_header for all versions based on llvm source code 
> in
>    compiler-rt/include/profile/InstrProfData.inc for each version.
> 3- We tested this patch for all Clang versions from 11 through 20 on x86 
> platform.
> 4- Fixed linking warnings related to coverage code in x86.
> 
> Signed-off-by: Saman Dehghan <[email protected]>
> ---
>  xen/arch/x86/xen.lds.S     |  6 ++++
>  xen/common/coverage/llvm.c | 73 ++++++++++++++++++++++++++++++++++----
>  xen/include/xen/xen.lds.h  | 18 ++++++++++
>  3 files changed, 91 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
> index 966e514f20..5d02f83a40 100644
> --- a/xen/arch/x86/xen.lds.S
> +++ b/xen/arch/x86/xen.lds.S
> @@ -186,6 +186,8 @@ SECTIONS
>    } PHDR(note) PHDR(text)
>  #endif
>  
> +  LLVM_COV_RO_DATA
> +
>    _erodata = .;
>  
>    . = ALIGN(SECTION_ALIGN);
> @@ -323,6 +325,8 @@ SECTIONS
>         *(.data .data.*)
>    } PHDR(text)
>  
> +  LLVM_COV_RW_DATA
> +
>    DECL_SECTION(.bss) {
>         __bss_start = .;
>         *(.bss.page_aligned*)
> @@ -357,6 +361,8 @@ SECTIONS
>  
>    DWARF2_DEBUG_SECTIONS
>  
> +  LLVM_COV_DEBUG
> +
>  #ifdef CONFIG_HYPERV_GUEST
>    hv_hcall_page = ABSOLUTE(HV_HCALL_PAGE - XEN_VIRT_START + 
> __XEN_VIRT_START);
>  #endif

Since only x86 is documented to support building with Clang, adding just to
x86's linker script is likely fine.

Oleksii, what's your thought towards still taking this for 4.21?

In any event, a ChangeLog entry should likely be added.

Jan

Reply via email to