From patchwork Wed Apr 24 02:07:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1089854 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-499579-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=gdcproject.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="nqzb6grS"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44pkH36pHhz9s3q for ; Wed, 24 Apr 2019 12:07:41 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=DJUChW4Xd0BY3PusOuicVp0NHDzdQQ997Of5gkdvsRiX9D LHHFcckhAtrX1PtdAQoTi6gu+h9a7OLm7Yecb+NzdJUrIVEPypzI3woPQUNcoA5W OBTWvqlxw8psAccRLfQgHRtNeRGS/nqTQV9C28ZgLvwD7WeYNdIRIjUDewYgc= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=JDfhZErufzPiMfUyEB1/CrzCZA0=; b=nqzb6grSstd0xJajLtnK di3AGhRbrcDnagUOPWSGN/KilFnDOIM2aUSEjUGChb3tX7r/qYPQqTDcnllMUvd2 7k4uTCp9DrKq85sMpRlGPP+XKw1XUTVYOlM3rCYlqAHMXvBfpggF0QTXZE5gOUiw MibUN0Lm8AHpnje8uPK5Bjg= Received: (qmail 19332 invoked by alias); 24 Apr 2019 02:07:34 -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 19322 invoked by uid 89); 24 Apr 2019 02:07:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=rm, RM X-HELO: mail-qk1-f182.google.com Received: from mail-qk1-f182.google.com (HELO mail-qk1-f182.google.com) (209.85.222.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 Apr 2019 02:07:32 +0000 Received: by mail-qk1-f182.google.com with SMTP id n68so9936613qka.1 for ; Tue, 23 Apr 2019 19:07:32 -0700 (PDT) MIME-Version: 1.0 From: Iain Buclaw Date: Wed, 24 Apr 2019 04:07:20 +0200 Message-ID: Subject: [PATCH, PR d/88431] Fix link build errors when compiling with unsupported options To: gcc-patches X-IsSubscribed: yes Hi, It was found that the first compilation test to get baseline warnings was getting more messages due to a missing object.d file, compared to later configure tests where libphobos is in the include paths. Because there must always be an object module during compilation, let the tests themselves be an empty object module instead. This patch fixes build failure in PR88431, bootstrapped and regression tested on x86_64-linux-gnu. Committed to trunk as r270531. diff --git a/libphobos/configure b/libphobos/configure index 8079a73527d..7c019899c5c 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -11981,10 +11981,16 @@ objext=o objext_D=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="module mod; extern(C) int main() { return 0; }" +lt_simple_compile_test_code="\ + module object; + shared int some_variable = 0; +" # Code to be used in simple link tests -lt_simple_link_test_code='module mod; extern(C) int main() { return 0; }' +lt_simple_link_test_code="\ + module object; + extern(C) int main() { return 0; } +" # ltmain only uses $CC for tagged configurations so make sure $CC is set. @@ -12020,12 +12026,9 @@ $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS -lt_save_DFLAGS=$GDCFLAGS lt_save_GCC=$GCC GCC=yes CC=${GDC-"gdc"} -# Need to specify location for object.d -GDCFLAGS="-nophoboslib $GDCFLAGS" CFLAGS=$GDCFLAGS compiler=$CC compiler_D=$CC @@ -13867,7 +13870,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS -GDCFLAGS=$lt_save_DFLAGS GDCFLAGS=$gdc_save_DFLAGS diff --git a/libphobos/m4/libtool.m4 b/libphobos/m4/libtool.m4 index 44ca572025b..0263a530cf0 100644 --- a/libphobos/m4/libtool.m4 +++ b/libphobos/m4/libtool.m4 @@ -20,10 +20,16 @@ objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="module mod; extern(C) int main() { return 0; }" +lt_simple_compile_test_code="\ + module object; + shared int some_variable = 0; +" # Code to be used in simple link tests -lt_simple_link_test_code='module mod; extern(C) int main() { return 0; }' +lt_simple_link_test_code="\ + module object; + extern(C) int main() { return 0; } +" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER @@ -35,12 +41,9 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS -lt_save_DFLAGS=$GDCFLAGS lt_save_GCC=$GCC GCC=yes CC=${GDC-"gdc"} -# Need to specify location for object.d -GDCFLAGS="-nophoboslib $GDCFLAGS" CFLAGS=$GDCFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC @@ -74,5 +77,4 @@ AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS -GDCFLAGS=$lt_save_DFLAGS ])# _LT_LANG_D_CONFIG