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

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 08:18:36 PST 2019


aykevl added a comment.

Another test. I compiled the following code: https://godbolt.org/z/hVCAUB

  #include <stdint.h>
  
  struct Bits {
      unsigned A : 1;
      uint8_t x;
  };
  
  int foo = sizeof(struct Bits);

As you can see in the Compiler Explorer, normal Linux/x86_64 outputs value 4 for `foo`:

  foo:
          .long   4                       # 0x4

However, for the compiler I'm dealing with I'm getting the following output:

  size.o:     file format pe-x86-64
  
  
  Disassembly of section .data:
  
  0000000000000000 <foo>:
     0:	08 00                	or     %al,(%rax)
  	...

So apparently this particular build of GCC 8 uses 8 bytes for the struct with bitfields.


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