public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gaius Mulley <gaiusmod2@gmail.com>
To: Iain Sandoe <idsandoe@googlemail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,  Jakub Jelinek <jakub@redhat.com>
Subject: Re: [PATCH modula2] PR-108142 Remove empty directories created in the build directory
Date: Thu, 29 Dec 2022 11:56:08 +0000	[thread overview]
Message-ID: <877cyafmp3.fsf@debian> (raw)
In-Reply-To: <6956FD0F-E3FE-4329-8F8C-7F6A5C8B4735@googlemail.com> (Iain Sandoe's message of "Mon, 26 Dec 2022 20:45:31 +0000")

Iain Sandoe <idsandoe@googlemail.com> writes:

> Hi Gaius,
>
> I’m finding it hard to figure out how the configuration is supposed to work for cross compilers (and more so for Canadian/native crosses).
>
> Apologies if this is already answered in other review (but maybe some notes would help in that case).
>
> questions in-line, thanks
> Iain

Hi Iain,

many thanks for the comments.  The patch only addresses the empty
directories issue.  I take your point about Canadian cross compiler
problems.  I think there is confusion in my use of stage1, stage2,
stage3 directory names which perhaps should be renamed cxxobj1, m2obj2,
m2obj3.  All objects in cxxobj1 are created by 'mc' and 'g++' and this
would occur if the compiler is built native or in any cross
configuration.

The m2obj2 objects would be built from modula-2 sources using cxxobj1
and would be a developer/maintainer enabled option principally used for
debugging.  Finally m2obj3 is also used by developers to allow the
compiler generations output to be compared (cxxobj1 vs m2obj2 vs
m2obj3).  

This could coexist with the standard stage1, stage2, stage3 of gcc.  The
gcc stage check would only check cxxobj1 having been rebuilt by the
relevant g++/gcc.

I propose to rework the patch (renaming the directories) and ensure that
Canadian cross works (currently it doesn't) - although it was tested for
classic cross (build == host != target).

regards,
Gaius


>> On 26 Dec 2022, at 14:46, Gaius Mulley via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>>
>>
>> Hello,
>>
>> Bootstrapped on amd64 GNU/Linux.  Ok for trunk?
>>
>> regards,
>> Gaius
>>
>> --- 8< ---
>>
>> PR-108142 Remove empty directories created in the build directory.
>>
>> This patch removes empty directories created in the build directory.
>> Directories are only created if required and all modula-2 build output
>> is created under m2.  Add m2.stageprofile and m2.stagefeedback rules.
>>
>> gcc/m2/ChangeLog:
>>
>>        * PR m2/108142
>> 	* Make-lang.in: Change build directory to m2.
>>        Change all rules to dynamically create subdirectories
>>        when required.
>> 	(m2.stageprofile): New.
>> 	(m2.stagefeedback): New.
>> 	* Make-maintainer.in: Change build directory to m2.
>>        Change all rules to dynamically create subdirectories when
>>        required.
>> 	* config-lang.in: Remove static creation of build directories.
>>
>> diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in
>> index a8bd7fe4d19..828eaad6285 100644
>> --- a/gcc/m2/Make-lang.in
>> +++ b/gcc/m2/Make-lang.in
>> @@ -27,7 +27,7 @@ GM2_CROSS_NAME = `echo gm2|sed '$(program_transform_cross_name)'`
>>
>> M2_MAINTAINER = no
>>
>> -GM2_1 = ./gm2 -B./stage1/m2 -g -fm2-g
>> +GM2_1 = ./gm2 -B./m2/stage1 -g -fm2-g
>
> What does “stage1” mean in the case of a cross-compiler or a
> —disable-bootstrap configure?

stage1 (or the proposed newly named cxxobj1) is created when the first
generation modula-2 compiler is built (using mc/g++).

>> GM2_FOR_TARGET = $(STAGE_CC_WRAPPER) ./gm2 -B./ -B$(build_tooldir)/bin/ -L$(objdir)/../ld $(TFLAGS)
>>
>> @@ -61,7 +61,6 @@ m2.srcextra: m2/SYSTEM-pim.texi m2/SYSTEM-iso.texi m2/gm2-libs.texi m2/gm2-ebnf.
>> 	-cp -p m2/SYSTEM-iso.texi $(srcdir)/m2
>> 	-cp -p m2/gm2-libs.texi $(srcdir)/m2
>> 	-cp -p m2/gm2-ebnf.texi $(srcdir)/m2
>> -	find . -name '*.texi' -print
>> else
>> m2.srcextra:
>> endif

<snip>

>> @@ -565,6 +518,7 @@ m2/gm2-gcc/m2configure.o: $(srcdir)/m2/gm2-gcc/m2configure.cc \
>>                $(SYSTEM_H) $(GCC_H) $(CONFIG_H) \
>>                m2/gm2config.h $(TARGET_H) $(PLUGIN_HEADERS) \
>>                $(generated_files) $(C_TREE_H) insn-attr-common.h
>> +	-test -d m2/gm2-gcc || $(mkinstalldirs) m2/gm2-gcc
>> 	$(COMPILER) $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
>>          $(DRIVER_DEFINES) \
>> 		-DLIBSUBDIR=\"$(libsubdir)\" \
>> @@ -585,6 +539,7 @@ m2/m2pp.o : $(srcdir)/m2/m2pp.cc $(GCC_HEADER_DEPENDENCIES_FOR_M2)
>>
>> m2/gm2-gcc/rtegraph.o: $(srcdir)/m2/gm2-gcc/rtegraph.cc $(GCC_HEADER_DEPENDENCIES_FOR_M2) \
>>                        gt-m2-rtegraph.h
>> +	-test -d m2/gm2-gcc || $(mkinstalldirs) m2/gm2-gcc
>> 	$(COMPILER) -c -g -I$(GM2GCC) $(ALL_COMPILERFLAGS) \
>
> GM2GCC = -I$(srcdir)/m2 -Im2 -I$(srcdir)/m2/gm2-gcc -Im2/gm2-gcc ?

allows g++ to pick up the mc translated definition modules in the build
directory gcc/m2/gm2-gcc/G*.h.  Maybe I've misunderstood the question?
There is some redundancy when this macro is used within some rules (I'll
reduce the paths), thanks for spotting it!

> (and in two other places).
>
>>             $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
>>
>> @@ -593,6 +548,7 @@ c-family/m2pp.o : $(srcdir)/m2/m2pp.cc $(GCC_HEADER_DEPENDENCIES_FOR_M2)
>>             $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
>>

<snip>

      reply	other threads:[~2022-12-29 11:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-26 14:46 Gaius Mulley
2022-12-26 20:45 ` Iain Sandoe
2022-12-29 11:56   ` Gaius Mulley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cyafmp3.fsf@debian \
    --to=gaiusmod2@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=idsandoe@googlemail.com \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).