From patchwork Sat Dec 31 05:01:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Klose X-Patchwork-Id: 89415 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp6716669qgi; Fri, 30 Dec 2016 21:01:49 -0800 (PST) X-Received: by 10.84.168.129 with SMTP id f1mr106125448plb.42.1483160509745; Fri, 30 Dec 2016 21:01:49 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 61si59048450pla.14.2016.12.30.21.01.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Dec 2016 21:01:49 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-445142-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-445142-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-445142-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=dyNF6JRwb5gG4JOtijBr5CwN/RJTRHTMBqaQkFNOi7drutE/Kr Y3NF4/lEm48hs0iqdbzZZGDhtVBKMtMIDXjdNIyrpvzb+hgHwnXVf/QF9ndsICSz QsKBN2iRePrhXcs4Wi/DqLNxC3Vs2cZijQke8Jjr+qNwPwmWbUuNKlev0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=GNb2t0dWahQ9EkFipEJKdOP37hI=; b=i39znPKVWRmGKwfhrNk0 cl021V2+xscs4TUJjsrmvSh09VbtMnccmNDJ6hcJ3xJson8coLmf//DIT1z2jatT pCkjDrZs2DpGudMv48iwdRCLyidxjxcod9HNA+xc5kz1nIqXZTcmtXj9HTgc1Hqv H/Z0jOSFU21c3RTZDPoUcz4= Received: (qmail 83393 invoked by alias); 31 Dec 2016 05:01:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 83379 invoked by uid 89); 31 Dec 2016 05:01:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=libtool, lgc, 2016-12-31, 2016-12-24 X-HELO: einhorn.in-berlin.de Received: from einhorn.in-berlin.de (HELO einhorn.in-berlin.de) (192.109.42.8) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 31 Dec 2016 05:01:25 +0000 X-Envelope-From: doko@ubuntu.com Received: from [192.168.1.235] ([49.228.228.119]) (authenticated bits=0) by einhorn.in-berlin.de (8.14.4/8.14.4/Debian-8+deb8u1) with ESMTP id uBV51IMr004858 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 31 Dec 2016 06:01:21 +0100 To: GCC Patches , Rainer Orth , Andrew Pinski From: Matthias Klose Subject: [patch] [libobjc] fix build with --disable-shared and .la files Message-ID: <00959276-77a7-79c6-bbd9-b57037c31940@ubuntu.com> Date: Sat, 31 Dec 2016 06:01:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 This addresses PR libobjc/78698, fixing the build with --disable-shared and .la files available. As mentioned in the bug report I'm not aware of a configure check to write a check using LIBTOOL_LINK and LIBTOOL_COMPILE, because these commands (using libtool) are only created by running the configure file, therefore checking for the presence of a .la file. Tested with a libgc installation in /opt/gcc/include, /opt/gcc/lib32, /opt/gcc/lib64 and configured with --prefix=/opt/gcc7 --enable-languages=c,c++,objc --disable-shared --enable-objc-gc=yes --with-multilib-list=m32,m64 --enable-checking=release --disable-bootstrap --with-target-bdw-gc-include=/opt/gcc/include --with-target-bdw-gc-lib=/opt/gcc/lib64,32=/opt/gcc/lib32 Ok for the trunk? Matthias libobjc/ 2016-12-24 Matthias Klose PR libobjc/78698 * configure.ac: Use the libgc.la file when available. * configure: Regenerate. gcc/ 2016-12-31 Matthias Klose * doc/install.texi: Allow default for --with-target-bdw-gc-include. libobjc/ 2016-12-24 Matthias Klose PR libobjc/78698 * configure.ac: Use the libgc.la file when available. * configure: Regenerate. gcc/ 2016-12-31 Matthias Klose * doc/install.texi: Allow default for --with-target-bdw-gc-include. Index: gcc/doc/install.texi =================================================================== --- gcc/doc/install.texi (revision 243987) +++ gcc/doc/install.texi (working copy) @@ -2203,8 +2203,12 @@ The options @option{--with-target-bdw-gc-include} and @option{--with-target-bdw-gc-lib} must always be specified together for each multilib variant and they take precedence over -@option{--with-target-bdw-gc}. If none of these options are -specified, the library is assumed in default locations. +@option{--with-target-bdw-gc}. If @option{--with-target-bdw-gc-include} +is missing values for a multilib, then the value for the default +multilib is used. (e.g. @samp{--with-target-bdw-gc-include=/opt/bdw-gc/include} +@samp{--with-target-bdw-gc-lib=/opt/bdw-gc/lib64,32=/opt-bdw-gc/lib32}). +If none of these options are specified, the library is assumed in +default locations. @end table @html Index: libobjc/configure.ac =================================================================== --- libobjc/configure.ac (revision 243987) +++ libobjc/configure.ac (working copy) @@ -290,45 +293,55 @@ AC_MSG_ERROR([no multilib path ($mldir) found in --with-target-bdw-gc-lib]) fi BDW_GC_CFLAGS="-I$bdw_inc_dir" - BDW_GC_LIBS="-L$bdw_lib_dir -lgc" + if test -f $bdw_lib_dir/libgc.la; then + BDW_GC_LIBS="$bdw_lib_dir/libgc.la" + else + BDW_GC_LIBS="-L$bdw_lib_dir -lgc" + fi AC_MSG_RESULT([found]) fi - AC_MSG_CHECKING([for system boehm-gc]) - save_CFLAGS=$CFLAGS - save_LIBS=$LIBS - CFLAGS="$CFLAGS $BDW_GC_CFLAGS" - LIBS="$LIBS $BDW_GC_LIBS" - dnl the link test is not good enough for ARM32 multilib detection, - dnl first check to link, then to run - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include ],[GC_init()])], - [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - int main() { - GC_init(); - return 0; - } - ]])], - [system_bdw_gc_found=yes], - [system_bdw_gc_found=no], - dnl assume no system boehm-gc for cross builds ... - [system_bdw_gc_found=no] - ) - ], - [system_bdw_gc_found=no]) - CFLAGS=$save_CFLAGS - LIBS=$save_LIBS - if test x$enable_objc_gc = xauto && test x$system_bdw_gc_found = xno; then - AC_MSG_WARN([system bdw-gc not found, not building libobjc_gc]) - use_bdw_gc=no - elif test x$enable_objc_gc = xyes && test x$system_bdw_gc_found = xno; then - AC_MSG_ERROR([system bdw-gc required but not found]) - else + case "$BDW_GC_LIBS" in + *libgc.la) use_bdw_gc=yes - AC_MSG_RESULT([found]) - fi + ;; + *) + AC_MSG_CHECKING([for system boehm-gc]) + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + CFLAGS="$CFLAGS $BDW_GC_CFLAGS" + LIBS="$LIBS $BDW_GC_LIBS" + dnl the link test is not good enough for ARM32 multilib detection, + dnl first check to link, then to run + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include ],[GC_init()])], + [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + int main() { + GC_init(); + return 0; + } + ]])], + [system_bdw_gc_found=yes], + [system_bdw_gc_found=no], + dnl assume no system boehm-gc for cross builds ... + [system_bdw_gc_found=no] + ) + ], + [system_bdw_gc_found=no]) + CFLAGS=$save_CFLAGS + LIBS=$save_LIBS + if test x$enable_objc_gc = xauto && test x$system_bdw_gc_found = xno; then + AC_MSG_WARN([system bdw-gc not found, not building libobjc_gc]) + use_bdw_gc=no + elif test x$enable_objc_gc = xyes && test x$system_bdw_gc_found = xno; then + AC_MSG_ERROR([system bdw-gc required but not found]) + else + use_bdw_gc=yes + AC_MSG_RESULT([found]) + fi + esac esac if test "$use_bdw_gc" = no; then