On Fri, 30 Dec 2022, Mark Harmstone wrote:

I've been working on adding support to binutils and gcc for
aarch64-w64-mingw32, and this turned out to be an issue. mm_malloc.h is
a header describing a couple of functions created by Intel, and so won't
be present on non-x86 platforms.

Signed-off-by: Mark Harmstone <[email protected]>
---
mingw-w64-headers/crt/malloc.h | 2 ++
1 file changed, 2 insertions(+)

The change itself seems reasonable - in Clang, all these arch-specific headers are installed along the compiler (as one compiler installation can target a number of architectures), while with GCC, only the headers relevant for the specific architecture that is targeted are installed.

One minor nitpick about the patch itself though:

diff --git a/mingw-w64-headers/crt/malloc.h b/mingw-w64-headers/crt/malloc.h
index c6698f451..7efff9ceb 100644
--- a/mingw-w64-headers/crt/malloc.h
+++ b/mingw-w64-headers/crt/malloc.h
@@ -78,8 +78,10 @@ void __mingw_aligned_free (void *_Memory);
void * __mingw_aligned_offset_realloc (void *_Memory, size_t _Size, size_t 
_Alignment, size_t _Offset);
void * __mingw_aligned_realloc (void *_Memory, size_t _Size, size_t _Offset);

+#if defined(__x86_64__) || defined(_X86_)
/* Get the compiler's definition of _mm_malloc and _mm_free. */
#include <mm_malloc.h>
+#endif

I would prefer to check for __i386__ instead of _X86_, for consistency with the __x86_64__ define. (In general I'd prefer to stick to the set of __i386__, __x86_64__, __arm__ and __aarch64__ for architecture checks within our headers.)

No need to resubmit a patch for that change though - I can push it with that changed, but let me know if you've got a strong differing opinion on the matter.

// Martin



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to