[En-Nut-Discussion] Strange newlib syscall dependencies / linker problems when using 64bit integers

Ulrich Prinz ulrich.prinz at googlemail.com
Wed Feb 8 13:46:32 CET 2012


Got a part of it:

in app/Makevars.cm3-gcc the linker lines where disabled. If you add
back the line
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT)
-Wl,-Map=$(PROJ).map,--cref,--gc-sections -L$(LIBDIR)
 it works without the overhead.

For latest version it must be modified to LDPATH and LDNAME.

Might be that you have to run 'Create Sampledirectory' from qnutconf
again to apply the modification to the nutconf.mk files.

Creating a local project without this modification results in a binary
image of 90k, with patch applied it is 85k.
Bootloader without patch is 14850 bytes, with patch applied it is 8252 bytes.

Ulrich

Am 7. Februar 2012 17:40 schrieb Uwe Bonnes
<bon at elektron.ikp.physik.tu-darmstadt.de>:
>>>>>> "Ulrich" == Ulrich Prinz <ulrich.prinz at googlemail.com> writes:
>
>    Ulrich> Hi Ole, I never had this kind of problem, but I never used 64
>    Ulrich> bit variables...
>
>    Ulrich> But... I compared the local nut/os version for cortexM3 with the
>    Ulrich> sourceforge one and the only bigger difference is the double -L
>    Ulrich> parameter for the linker.  You remember the problem I have that
>    Ulrich> building a simple uart example results in 14k code instead of 6k
>    Ulrich> or less in older versions?  I guess (but didn't test, cause lack
>    Ulrich> of time) that this might be the problem.
>
>    Ulrich> Can you test again with LDFLAGS =
>    Ulrich> ...-T'path/to/linker/ldscript.ld' ... -L'path_to_libs' instead
>    Ulrich> of LDFLAGS = ... -L'path/to/linker/' -T'ldscript.ld'
>    Ulrich> ... -L'path_to_libs'
>
>    Ulrich> It's just a feeling...  Linker might test the first search path
>    Ulrich> only and include stdlibs on failing result even the nutos libs
>    Ulrich> exist in the second one.
>
>
>
> The order doesn't seem to make a difference:
> * Order as produced by our tree:
>
> arm-none-eabi-gcc owi_test.o owi_timer.o -mcpu=cortex-m3 -mthumb -mlittle-endian -D__CORTEX__ -nostartfiles -L../../../devnut_m3n_git/nut/arch/cm3/ldscripts -Tstm32f107xC_flash.ld -Wl,-Map=owi_test.map,--cref,--gc-sections -L../.././lib -Wl,--start-group ../.././lib/nutinit.o -lnutcrt -lnutarch -lnutdev -lnutos -lnutdev -lnutarch   -Wl,--end-group -o owi_test.elf
>  > arm-none-eabi-size owi_test.elf
>   text    data     bss     dec     hex filename
>  24296     320    1380   25996    658c owi_test.elf
>
> * All linker specific files at the end:
>> arm-none-eabi-gcc owi_test.o owi_timer.o -mcpu=cortex-m3 -mthumb -mlittle-endian -D__CORTEX__ -nostartfiles -L../.././lib ../.././lib/nutinit.o -lnutcrt -lnutarch -lnutdev -lnutos -lnutdev -lnutarch -nostartfiles -L../../../devnut_m3n_git/nut/arch/cm3/ldscripts -Tstm32f107xC_flash.ld -Wl,-Map=owi_test.map,--cref,--gc-sections -Wl,--start-group -Wl,--end-group -o owi_test.elf
>
>> arm-none-eabi-size owi_test.elf
>  text    data     bss     dec     hex filename
>  24296     320    1380   25996    658c owi_test.elf
>
> --
> Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de
>
> Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
> --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion



More information about the En-Nut-Discussion mailing list