Skip to content

Instantly share code, notes, and snippets.

@elieux
Last active December 19, 2019 21:02
Show Gist options
  • Save elieux/d6a2836e0ba8b378d8a70b6a18e31d88 to your computer and use it in GitHub Desktop.
Save elieux/d6a2836e0ba8b378d8a70b6a18e31d88 to your computer and use it in GitHub Desktop.
mingw-w64 GCC from MSYS2 fails spectacularly
int main ()
{
return 0;
}
# 1 "conftest.c"
# 1 "W:\\temp\\openconnect\\_//"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "conftest.c"
int main ()
{
return 0;
}
.file "conftest.c"
.text
.Ltext0:
.cfi_sections .debug_frame
.def __main; .scl 2; .type 32; .endef
.section .text.startup,"x"
.p2align 4
.globl main
.def main; .scl 2; .type 32; .endef
.seh_proc main
main:
.LFB0:
.file 1 "conftest.c"
.loc 1 2 1 view -0
.cfi_startproc
subq $40, %rsp
.seh_stackalloc 40
.cfi_def_cfa_offset 48
.seh_endprologue
.loc 1 2 1 is_stmt 0 view .LVU1
call __main
.LVL0:
.loc 1 3 3 is_stmt 1 view .LVU2
.loc 1 4 1 is_stmt 0 view .LVU3
xorl %eax, %eax
addq $40, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE0:
.seh_endproc
.text
.Letext0:
.section .debug_info,"dr"
.Ldebug_info0:
.long 0x93
.word 0x4
.secrel32 .Ldebug_abbrev0
.byte 0x8
.uleb128 0x1
.ascii "GNU C17 9.2.0 -mtune=generic -march=x86-64 -g -O2\0"
.byte 0xc
.ascii "conftest.c\0"
.ascii "W:\\temp\\openconnect\\_\0"
.secrel32 .Ldebug_ranges0+0
.quad 0
.secrel32 .Ldebug_line0
.uleb128 0x2
.ascii "main\0"
.byte 0x1
.byte 0x1
.byte 0x5
.long 0x8f
.quad .LFB0
.quad .LFE0-.LFB0
.uleb128 0x1
.byte 0x9c
.uleb128 0x3
.byte 0x4
.byte 0x5
.ascii "int\0"
.byte 0
.section .debug_abbrev,"dr"
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0x8
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.uleb128 0x1b
.uleb128 0x8
.uleb128 0x55
.uleb128 0x17
.uleb128 0x11
.uleb128 0x1
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x2e
.byte 0
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x39
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x7
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2116
.uleb128 0x19
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"dr"
.long 0x2c
.word 0x2
.secrel32 .Ldebug_info0
.byte 0x8
.byte 0
.word 0
.word 0
.quad .LFB0
.quad .LFE0-.LFB0
.quad 0
.quad 0
.section .debug_ranges,"dr"
.Ldebug_ranges0:
.quad .LFB0
.quad .LFE0
.quad 0
.quad 0
.section .debug_line,"dr"
.Ldebug_line0:
.section .debug_str,"dr"
.ident "GCC: (Rev2, Built by MSYS2 project) 9.2.0"
W:\temp\openconnect\_>gcc -c -g -O2 conftest.c
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s: Assembler messages:
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:14: Error: unknown .loc sub-directive `view'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:14: Error: junk at end of line, first unrecognized character is `-'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:20: Error: unknown .loc sub-directive `view'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:20: Error: unknown pseudo-op: `.lvu1'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:23: Error: unknown .loc sub-directive `view'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:23: Error: unknown pseudo-op: `.lvu2'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:24: Error: unknown .loc sub-directive `view'
C:\Users\ether\AppData\Local\Temp\ccfPtxnZ.s:24: Error: unknown pseudo-op: `.lvu3'
W:\temp\openconnect\_>gcc -c -O2 conftest.c
W:\temp\openconnect\_>gcc -c -g conftest.c
@elieux
Copy link
Author

elieux commented Dec 19, 2019

So it seems like my binutils came from mingw-w64-x86_64-binutils-git (which was at 2.25.r81716.c8daf7d-1), while I'm supposed to have mingw-w64-x86_64-binutils (currently at 2.33.1-1) and this was causing the errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment