From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100093 invoked by alias); 15 Mar 2015 22:10:24 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 100046 invoked by uid 89); 15 Mar 2015 22:10:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,LIBERO,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 X-HELO: smtp-33.italiaonline.it Received: from smtp-33-i2.italiaonline.it (HELO smtp-33.italiaonline.it) (212.48.25.204) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 15 Mar 2015 22:10:21 +0000 Received: from [192.168.1.154] ([151.55.6.72]) by smtp-33.iol.local with bizsmtp id 3yAH1q00b1ZEHVz0ZyAHkx; Sun, 15 Mar 2015 23:10:18 +0100 x-libjamoibt: 1601 X-CNFS-Analysis: v=2.1 cv=D6fJK5hj c=1 sm=1 tr=0 a=8jOY8sor40DQAOhorq++FQ==:117 a=8jOY8sor40DQAOhorq++FQ==:17 a=C3lObqKiMAUA:10 a=VneZzDLcnOsA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=9iDbn-4jx3cA:10 a=cKsnjEOsciEA:10 a=gZbpxnkM3yUA:10 a=vdYjoKjgjptZQ0YNJScA:9 a=QEXdDO2ut3YA:10 a=FOQA3vaHBpdxwYmHKH8A:9 Message-ID: <5506034E.9070501@libero.it> Date: Sun, 15 Mar 2015 22:10:00 -0000 From: Riccardo Mottola User-Agent: Mozilla/5.0 (X11; Linux i686; rv:35.0) Gecko/20100101 Firefox/35.0 SeaMonkey/2.32.1 MIME-Version: 1.0 To: libffi-discuss@sourceware.org Subject: bug in unwind check for 64bit Content-Type: multipart/mixed; boundary="------------070705010107010105010301" X-SW-Source: 2015/txt/msg00045.txt.bz2 This is a multi-part message in MIME format. --------------070705010107010105010301 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1514 Hi, the configure check for unwind if test x$TARGET = xX86_64; then AC_CACHE_CHECK([toolchain supports unwind section type], libffi_cv_as_x86_64_unwind_section_type, [ cat > conftest1.s << EOF .text .globl foo foo: jmp bar .section .eh_frame,"a",@unwind bar: EOF cat > conftest2.c << EOF extern void foo(); int main(){foo();} EOF libffi_cv_as_x86_64_unwind_section_type=no # we ensure that we can compile _and_ link an assembly file containing an @unwind section # since the compiler can support it and not the linker (ie old binutils) if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \ $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then libffi_cv_as_x86_64_unwind_section_type=yes fi ]) if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1, [Define if your assembler supports unwind section type.]) fi fi is broken, it returns negative even if the option is supported. This makes 64bit build on x86 fail (e.g. on solaris 10 in 64 bit). The problem is that in the linking stage the CFLAGS are not passed, thus the first CC line generates a 64 bit object, but then linking is attempted in 32bit, which fails. $CFLAGS are needed there too. The small attached patch fixed this problem, it comes from opencsw, and I am giving it back to upstream. Thank you, Riccardo --------------070705010107010105010301 Content-Type: text/x-patch; name="configure.ac.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="configure.ac.patch" Content-length: 547 --- configure.ac.orig Sun Mar 15 21:45:29 2015 +++ configure.ac Sun Mar 15 21:59:45 2015 @@ -490,7 +490,7 @@ # we ensure that we can compile _and_ link an assembly file containing an @unwind section # since the compiler can support it and not the linker (ie old binutils) if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \ - $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then + $CC $CFLAGS conftest2.c conftest1.o > /dev/null 2>&1 ; then libffi_cv_as_x86_64_unwind_section_type=yes fi ]) --------------070705010107010105010301--