From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2431 invoked by alias); 14 Nov 2012 16:14:08 -0000 Received: (qmail 2283 invoked by uid 48); 14 Nov 2012 16:13:49 -0000 From: "glider at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/55289] darwin bootstrap fails due to missing libsanitizer/interception/mach_override directory and files Date: Wed, 14 Nov 2012 16:14:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: glider at google dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg01264.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55289 Alexander Potapenko changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |glider at google dot com --- Comment #28 from Alexander Potapenko 2012-11-14 16:13:47 UTC --- =========================================================== t.o: file format mach-o-x86-64 Disassembly of section .text: 0000000000000000 <_foo>: 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: 90 nop 5: 90 nop 6: 90 nop 7: 90 nop 8: 48 8d 05 11 4f 0b 00 lea 0xb4f11(%rip),%rax # b4f20 <_foo.eh+0xb4ee8> f: 53 push %rbx 10: 48 8d 5f e0 lea -0x20(%rdi),%rbx 14: 48 89 77 90 mov %rsi,-0x70(%rdi) 18: 5d pop %rbp 19: c3 retq =========================================================== mach_override must be choking on the lea instruction. The easiest way to handle it is to add "48 8d 05 00 00 00 00" to the list of instructions and mark it as "lea $imm(%rip),%rax". You can also dive into the opcodes a bit and mask the bits that select the destination register. I'll take a look at mach_override.c code to suggest the actual patch.