From 71ae2e0221a99958ed82175781d92a73ea05597c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 6 Aug 2021 21:06:08 +0200 Subject: [PATCH] [libomptarget][amdgpu] don't declare Elf_Note on FreeBSD On FreeBSD, the system `` already declares `struct Elf_Note` indirectly (via ``). This results in compile errors when building the libomptarget amdgpu plugin. Avoid redeclaring `struct Elf_Note` on FreeBSD to fix the errors. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D107661 --- openmp/libomptarget/plugins/amdgpu/impl/system.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openmp/libomptarget/plugins/amdgpu/impl/system.cpp b/openmp/libomptarget/plugins/amdgpu/impl/system.cpp index 7fd8d57..d9cbf46 100644 --- a/openmp/libomptarget/plugins/amdgpu/impl/system.cpp +++ b/openmp/libomptarget/plugins/amdgpu/impl/system.cpp @@ -35,6 +35,8 @@ typedef unsigned char *address; /* * Note descriptors. */ +// FreeBSD already declares Elf_Note (indirectly via ) +#if !defined(__FreeBSD__) typedef struct { uint32_t n_namesz; /* Length of note's name. */ uint32_t n_descsz; /* Length of note's value. */ @@ -43,6 +45,7 @@ typedef struct { // then padding, optional // then desc, at 4 byte alignment (not 8, despite being elf64) } Elf_Note; +#endif // The following include file and following structs/enums // have been replicated on a per-use basis below. For example, -- 2.7.4