Hi Martin,
I saw your post to CodeSourcery's mailing list. After experimenting a bit, I
see that CS flthdr variant, as we suspected, completely ignores the FLTFLAGS
environment variable and the uclinux.org toolchain does pick up this
environment variable.

The best approach seemed to be to modify
vendors/config/m68knommu/config.arch as this
LDFLAGS += -Wl,-elf2flt="$(FLTFLAGS)"

But this doesn't work unfortunately, since each program compiled under
'user' is called with a recursive make call. And at that time of the
recursive call the above make variables have already been evaluated. The
trick done in the makefiles before, was to export FLTFLAGS as environment
variable, which is pickuped by the recursively spawned make process

The only way, as I see it, would be to reorganize makefiles for all user
level programs to include config.arch directly, rather than exporting
variables.This would be rather tedious though....

Myself I keep a very minimized root file system, and I can see that 'ftpd'
and 'telnetd' are the only executables with modified stacksizes. For
simplicity, I ended up modifying the vendor/<your board>, as this

BFLT_EXECS = ftpd telnetd

image:
     for i in $(BFLT_EXECS); do \
            echo Increasing stacksize for $(ROMFSDIR)/bin/$$i; \
            m68k-uclinux-flthdr -s 8192 $(ROMFSDIR)/bin/$$i; \
     done

Harry


On Mon, May 19, 2008 at 5:01 AM, Harry Gunnarsson <[EMAIL PROTECTED]>
wrote:

> Hi, I can confirm that root file system creation leaves 'ftpd' for instance
> with 0x1000 as stacksize.
> I will look into this.
> So far, do you have any new findings?
>
> Thanks,
> Harry
>
>
> On Fri, May 16, 2008 at 7:47 AM, Martin Voss <[EMAIL PROTECTED]> wrote:
>
>> Hi all,
>>
>> I followed this excellent tip for user application stack profiling from
>> Erwin:
>>
>> http://mailman.uclinux.org/pipermail/uclinux-dev/2008-April/046349.html
>>
>> Works really, really nice.
>>
>> I have also been testing CodeSourcery 4.2.1 m68k-uclinux-gcc toolchain.
>>
>> See Harry's comments:
>>
>> http://mailman.uclinux.org/pipermail/uclinux-dev/2007-November/044576.ht
>> ml<http://mailman.uclinux.org/pipermail/uclinux-dev/2007-November/044576.html>
>> .
>>
>> In our system we use the ftpd, and when running stackcheck on the
>> running system compiled with the CS toolchain, I noticed 0 free stack
>> for ftpd efter logging in to the ftp server. After checking the stack of
>> ftpd with m68k-uclinux-flthdr it reported 0x1000, i.e. the default stack
>> size, NOT the 8192 stack size from the Makefile in the ftpd directory.
>> (FLTFLAGS += -s 8192).
>>
>> I tried the 20061214 toolchain, and this accepted the change to 0x2000,
>> and ftpd works without overflowing the stack.
>>
>> I have not checked any other applications, but this feels very dangerous
>> for me. Have I missed something obvious, causing the CS toolchain to not
>> accept the FLTFLAGS += -s 8192 in the Makefile. But I think it's a bit
>> strange since the 20061214 accepts it.
>>
>> Without using Erwin's stackcheck, this would probably have passed
>> undetected, possibly wrecking havoc in the entire system and cause all
>> sorts of unpredictable behavior. :)
>>
>> Anyone else with experiences from the CS toolchain and the FLTFLAGS
>> problem we are seeing?
>>
>> Regards,
>>
>> Martin Voss
>>
>>
>> _______________________________________________
>> uClinux-dev mailing list
>> [email protected]
>> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
>> This message was resent by [email protected]
>> To unsubscribe see:
>> http://mailman.uclinux.org/mailman/options/uclinux-dev
>>
>
>
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to