[PATCH] D70266: [ELF] Fix lld build on Windows/MinGW

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 09:29:52 PST 2019


aykevl added a comment.

I ran the same code as above on MinGW 7.3.0, and with that version the struct size is 4 bytes. So it looks like GCC/MinGW changed how they lay out a struct in memory (breaking ABI compatibility?).

  size.o:     file format pe-x86-64
  
  
  Disassembly of section .data:
  
  0000000000000000 <foo>:
     0:	04 00                	add    $0x0,%al
  	...



  gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 7.3.0
  Copyright (C) 2017 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Therefore, this might actually be a bug in GCC rather than Clang. This patch would still be helpful to get LLVM to compile with MinGW 8.

---

I also ran `ninja check-lld` with this patch applied, which completed successfully on a linux/x86_64 system. It would be nice if someone could review this patch to get it included in a future LLVM release.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70266/new/

https://reviews.llvm.org/D70266





More information about the llvm-commits mailing list