Vincent R. wrote:
> to have multiple files with in general only one or two differences.
Funny, I thought that was good modular design with inheritance and override.
YMMV!
> For instance here is some part of our patch :
>
> --- libgcc/config/arm/t-wince-pe (revision 0)
> +++ libgcc/config/arm/t-wince-pe (revision 0)
> @@ -0,0 +1,11 @@
> +CUSTOM_CRTSTUFF = yes
> +
> +crtbegin.o: $(gcc_srcdir)/config/i386/cygming-crtbegin.c
> + $(crt_compile) -fno-omit-frame-pointer -c \
> + $(gcc_srcdir)/config/i386/cygming-crtbegin.c
>
> so as you can see even if we are working on a arm platform we are using a
> file in i386.
That is not good. If there's some common functionality it could be
extracted into a new file in config/ which could then be referenced from both
config/arm/ and config/i386/.
> Once again we are referencing i386/t-gthr-win32, i386/t-dw2-eh and
> i386/t-sjlj-eh
> and this is stupid because those files have only one definition that is not
> i386 specific.
Or you could add your own fragments in config/arm/ to provide the
definitions that you want for your system. But yes, you can't extract just
part of the i386 CRT EH machinery without dragging the rest with it. I guess
nobody thought at the time it would turn out to be general enough to apply to
the embedded windows platforms as well as the i386.
> Once again we are referencing a file in i386 that is not specific ...
>
>
> What I propose is to reorganize a bit files for ms support and to put
> together common declaration and stop to consider it as i386 specific.
> For information all the ms platforms are sharing lots of defintions and the
> following platforms could benefit from it because right now we are have to
> copy/paste for every new ms derived platform or reference files in i386
> folder.
I think there are more options than just those two, but certainly it is
right to common out the shared functionality. I believe it should just go one
level up in config/ rather than have a subdir; there's a ton of shared stuff
in that directory already.
cheers,
DaveK