This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: target.ld


Hi,

    On Tue, Aug 20, 2002 at 03:00:26PM +0100, Bart Veer wrote:
    > >>>>> "Motoya" == Motoya Kurotsu <kurotsu@allied-telesis.co.jp> writes:
    > 
    >     Motoya> I found the fact that target.ld doesn't always reflect the
    >     Motoya> update of mlt files. You may not find it while you follow
    >     Motoya> the normal process like ecosconfig new xxx, ecosdonfig
    >     Motoya> tree and make. But once you execute make clean and make
    >     Motoya> again, you will find that target.ld never reflects the
    >     Motoya> later update of mlt files. The cause is that
    >     Motoya> target.ld.deps is cleared by make clean and never
    >     Motoya> reprodued by the next make. I think that it is better to
    >     Motoya> reflect the latest mlt files to target.ld in any case. The
    >     Motoya> attachment is my sugestion to fix it. It is only for
    >     Motoya> vr4300 as an example, but all architecture can be fixed
    >     Motoya> likewise. If you have any smarter idea or any reason why I
    >     Motoya> shouldn't do so, please tell me.
    > 
    > I have not investigated closely, but this does not look quite right to
    > me. Your new makefile rule has a target ldscript which will never
    > actually be generated, and which will not be declared as phony. 

Yes. A target ldscript isn't a file. So strictly speaking, .PHONY may
be required. But this works actually. The trick is perhaps in ecosconfig 
although I haven't examined its source code. Since I can see the lines 
such like the following in the top level makefile.

build: headers $(PREFIX)/include/pkgconf/ecos.mak
	...

	$(MAKE) -r -C hal/mips/xxxx/current ldscript
	...

    > Won't you end up rebuilding the linker script every time, irrespective of
    > whether or not anything has changed?

Yes, it's what I originally mean. I agree that it is not good idea. 

    > A possible alternative (untested) would be to list the .ldi files
    > explicitly as a dependency, e.g.:
    > 
    > <PREFIX>/lib/target.ld: <PACKAGE>/src/mips_vr4300.ld $(wildcard <PREFIX>/include/pkgconf/*.ldi)
    > 
    > The $(wildcard ) means that the rule does not have to know the startup
    > type, and may avoid problems during the first build. You could still
    > end up doing an unnecessary rebuild if e.g. you change
    > mlt_<whatever>_rom.ldi when the linker script is actually using
    > mlt_<whatever>_ram.ldi, but that is fairly unlikely.

It looks better. $(wildcard ) seems to be taken care by ecosconfig. 
So I think the following is enough.

    <PREFIX>/lib/target.ld: <PACKAGE>/src/mips_vr4300.ld <PREFIX>/include/pkgconf/*.ldi



Thanks,
Motoya Kurotsu
Allied Telesis K. K.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]