Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 782771EE3E83 for ; Mon, 12 Dec 2011 20:43:22 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RaGSl-0005l0-Jn for pgsql-bugs@postgresql.org; Tue, 13 Dec 2011 00:43:21 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id pBD0h6EN015203; Mon, 12 Dec 2011 19:43:06 -0500 (EST) To: Craig Ringer cc: vbberdin@yahoo.com, pgsql-bugs@postgresql.org Subject: Re: BUG #6331: Cross compile error/aborts. Works if '--disable-spinlock' is used In-reply-to: <4EE69BA0.2020703@ringerc.id.au> References: <4EE69BA0.2020703@ringerc.id.au> Comments: In-reply-to Craig Ringer message dated "Tue, 13 Dec 2011 08:26:08 +0800" Date: Mon, 12 Dec 2011 19:43:06 -0500 Message-ID: <15202.1323736986@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201112/86 X-Sequence-Number: 31897 Craig Ringer writes: > On 12/12/2011 5:09 PM, vbberdin@yahoo.com wrote: >> arm-linux-gnueabi-gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith >> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv >> -I../../../../src/include -D_GNU_SOURCE -c -o xlog.o xlog.c >> /tmp/cclQLJ69.s: Assembler messages: >> /tmp/cclQLJ69.s:645: Error: selected processor does not support Thumb mode >> `swpb r3,r3,[r0]' >> /tmp/cclQLJ69.s:6821: Error: selected processor does not support Thumb mode >> `swpb r2,r2,[r0]' > Are you sure you're using the correct assembler? > Try tweaking your PATH so that symlinked names for the ARM toolchain are > all on your PATH before your host toolchain. > If that's not the issue then its presumably an issue with Pg's configure > script/Makefiles invoking the wrong tool in a cross-compile situation, > because AFAIK there's no ARM asm code or ARM gcc intrinsics hidden away > in Pg, and that'd be the only other way to get those kinds of errors. No, you're mistaken about that: we do have inline assembly code in s_lock.h, and this message does look to be complaining about that code, because "swpb %0, %0, [%2]" is exactly what the TAS() macro generates for ARM. However, unless the OP is prepared to offer some other inline TAS implementation that is portable to more flavors of ARM than this one is, we're unlikely to change it. --disable-spinlocks is exactly what you're supposed to do if you don't have a supported processor, and his machine evidently isn't, even if it calls itself an ARM. It's also possible that his target processor actually can do swpb, but he needs to use some other gcc flags to persuade gcc of that. regards, tom lane