From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id A28FF38A8158 for ; Mon, 5 Dec 2022 14:01:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A28FF38A8158 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 7A84021EA4; Mon, 5 Dec 2022 14:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1670248874; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A+1IOpeH5Sm5sXsV0EBDyckT8Ez21wMi6tascXNGuWQ=; b=l8hsah7AMpnIJgFNC4yoNz+5UnH2alawDRJHcTVOu10w8g5wo8qcov9Ci0FiSR1rvxKNkJ NFLlPej46mTPTVsxj7KIk6q3Q3bWz2SbwXxSlPGm+z4E5TqJdthDQYGvSiSyAhaV0JVdFk ewuFH5FArMJLaEgsHs2lMrIVXAwgMqw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1670248874; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A+1IOpeH5Sm5sXsV0EBDyckT8Ez21wMi6tascXNGuWQ=; b=gOovc1De25QZ2C1VE/fBNJPKa7H4QnsuisHuQfn3fDd//+DQb5nlRlz5gV5K9K1IbUR0mC wuH9MCGsFTpPU2Ag== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 756812C142; Mon, 5 Dec 2022 14:01:14 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 10510) id 54A9E6608; Mon, 5 Dec 2022 14:01:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by wotan.suse.de (Postfix) with ESMTP id 538E36606; Mon, 5 Dec 2022 14:01:14 +0000 (UTC) Date: Mon, 5 Dec 2022 14:01:14 +0000 (UTC) From: Michael Matz To: "James K. Lowden" cc: gcc@gcc.gnu.org Subject: Re: access to include path in front end In-Reply-To: <20221202132756.49d8dff47218676c0f43eff5@schemamania.org> Message-ID: References: <20221129100804.c5b3e5bc669ff92f2100c3a3@schemamania.org> <20221201111126.3c0789057cdd420d930836a0@schemamania.org> <20221202132756.49d8dff47218676c0f43eff5@schemamania.org> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hey, On Fri, 2 Dec 2022, James K. Lowden wrote: > > > 3. Correct the entries in the default_compilers array. Currently I > > > have in cobol/lang-specs.h: > > > > > > {".cob", "@cobol", 0, 0, 0}, > > > {".COB", "@cobol", 0, 0, 0}, > > > {".cbl", "@cobol", 0, 0, 0}, > > > {".CBL", "@cobol", 0, 0, 0}, > > > {"@cobol", > > > "cobol1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}", > > > 0, 0, 0}, > > > > It misses %(cpp_unique_options) which was the reason why your -I > > arguments weren't passed to cobol1. > > If I understood you correctly, I don't need to modify gcc.cc. I only > need to modify cobol/lang-specs.h, which I've done. But that's > evidently not all I need to do, because it doesn't seem to work. > > The last element in the fragment in cobol/lang-specs.h is now: > > {"@cobol", > "cobol1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)} " > "%(cpp_unique_options) ", %(invoke_as) needs to be last. What it does is effectively add this to the command line (under certain conditions): "-somemoreoptions | as". Note the pipe symbol. Like in normal shell commands also the gcc driver interprets this as "and now start the following command as well connection stdout of the first to stdin of the second". So all in all the generated cmdline will be somewhat like: cobol1 input.cbl -stuff-from-cc1-options | as - -stuff-from-cpp-options Your cpp_unique_options addition will effectively be options to that 'as' command, but you wanted it to be options for cobol1. So, just switch order of elements. > I see the -B and -I options, and others, with their arguments, contained > in COLLECT_GCC_OPTIONS on lines 9 and 11. I guess that represents an > environment string? Yes. It's our round-about-way of passing the gcc options as the user gave them downwards in case collect2 (a wrapper for the linking step for, gah, don't ask) needs to call gcc itself recursively. But in the -### (or -v) output, if the assembler is invoked in your example (i.e. cobol1 doesn't fail for some reason) you should see your -I options being passed to that one (wrongly so, of course :) ). Ciao, Michael.