Re: [MSEide-MSEgui-talk] MSElang Objects

2017-05-12 Thread Martin Schreiber
On Friday 12 May 2017 20:28:54 Fred van Stappen wrote:
>
> >  accidentally not working -XX, with active smartlinking it was reduced to
> > 26072 bytes.
>
> Do you mean that you have a trick to do smartlinking working for libraries
> ?
>
No, the first time I presented the benchmark results in the meaning I had 
added -XX to the FPC parameters but actually I had not.

> > Yup, I get 29.9 KB with fpc -k--gc-sections libnude.pas
>
> So what is the conclusion, what is the trick ?
>
Compile with
"
fpc -k--gc-sections libnude.pas
"
Every FPC program or library contains system.o which is 710KB before strip.
It seems that -XX does not work with "library" so the --gc-sections linker 
command must be supplied to the linker directly.

"
fpc -XX -s prognude.pas
"
produces ppas.sh:

===
#!/bin/sh
DoExitAsm ()
{ echo "An error occurred while assembling $1"; exit 1; }
DoExitLink ()
{ echo "An error occurred while linking $1"; exit 1; }
echo Linking prognude
OFS=$IFS
IFS="
"
/usr/bin/ld -b elf32-i386 -m elf_i386--gc-sections -s -L. -o prognude 
link.res
if [ $? != 0 ]; then DoExitLink prognude; fi
IFS=$OFS
===

"
fpc -XX -s libnude.pas
"
produces ppas.sh:

===
#!/bin/sh
DoExitAsm ()
{ echo "An error occurred while assembling $1"; exit 1; }
DoExitLink ()
{ echo "An error occurred while linking $1"; exit 1; }
echo Linking liblibnude.so
OFS=$IFS
IFS="
"
/usr/bin/ld -b elf32-i386 -m elf_i386  -init FPC_SHARED_LIB_START -fini 
FPC_LIB_EXIT -soname liblibnude.so -shared -L. -o liblibnude.so link.res
if [ $? != 0 ]; then DoExitLink liblibnude.so; fi
IFS=$OFS
echo Linking liblibnude.so
OFS=$IFS
IFS="
"
/usr/bin/strip --discard-all --strip-debug liblibnude.so
if [ $? != 0 ]; then DoExitLink liblibnude.so; fi
IFS=$OFS
===
Note the missing --gc-sections.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSElang Objects

2017-05-12 Thread Fred van Stappen

> BTW, the mergesort benchmark binary also was 177576 bytes with accidentally
> not working -XX, with active smartlinking it was reduced to 26072 bytes.

Hello Martin.

In a other topic, they talk about to use : -k--gc-sections.

Fre;D
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSElang Objects

2017-05-12 Thread Martin Schreiber
On Friday 12 May 2017 06:06:41 Martin Schreiber wrote:
> On Friday 12 May 2017 00:07:09 Fred van Stappen wrote:
> > > It is logical that the libraries are bigger because the libraries
> > > contain all named code
> >
> > Huh, :
> >
> >
> > program prognude ;
> > begin
> > end.
> > => 26.9 k
> >
> > library libnude ;
> > begin
> > end.
> > => 196.3 k
>
> Have you checked with objdump what is in libnude?
>
BTW, the mergesort benchmark binary also was 177576 bytes with accidentally 
not working -XX, with active smartlinking it was reduced to 26072 bytes.

Martin



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSElang Objects

2017-05-12 Thread Martin Schreiber
On Friday 12 May 2017 03:44:30 Edson H wrote:
>
> I'm currently developing a Pascal Compiler

Do you refer to
https://github.com/t-edson/PicPas
? Looks good! Does the IDE have integrated debug capabilities?
I worked many years with PIC16xxx. Programming always was done in assembler.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSElang Objects

2017-05-12 Thread Martin Schreiber
On Friday 12 May 2017 13:52:36 Fred van Stappen wrote:
> > BTW, the mergesort benchmark binary also was 177576 bytes with
> > accidentally not working -XX, with active smartlinking it was reduced to
> > 26072 bytes.
>
> Hello Martin.
>
> In a other topic, they talk about to use : -k--gc-sections.
>
Yup, I get 29.9 KB with
fpc -k--gc-sections libnude.pas 
"
library libnude ;

procedure test();
begin
end;

exports
 test;
end. 
"
"
objdump -h -T -t liblibnude.so

liblibnude.so: file format elf32-i386

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .hash 0014  00d4  00d4  00d4  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .gnu.hash 0020  00e8  00e8  00e8  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .dynsym   0020  0108  0108  0108  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .dynstr   0022  0128  0128  0128  2**0
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .rel.dyn  1528  014c  014c  014c  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .text 4af0  1680  1680  1680  2**4
  CONTENTS, ALLOC, LOAD, READONLY, CODE
  6 .rodata   01b0  6170  6170  6170  2**4
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .eh_frame   6320  6320  6320  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .dynamic  00a8  7f58  7f58  6f58  2**2
  CONTENTS, ALLOC, LOAD, DATA
  9 .data 03f0  8000  8000  7000  2**4
  CONTENTS, ALLOC, LOAD, DATA
 10 .bss  1664  83f0  83f0  73f0  2**4
  ALLOC
SYMBOL TABLE:
00d4 ld  .hash   .hash
00e8 ld  .gnu.hash   .gnu.hash
0108 ld  .dynsym .dynsym
0128 ld  .dynstr .dynstr
014c ld  .rel.dyn    .rel.dyn
1680 ld  .text   .text
6170 ld  .rodata .rodata
6320 ld  .eh_frame   .eh_frame
7f58 ld  .dynamic    .dynamic
8000 ld  .data   .data
83f0 ld  .bss    .bss
1680 g F .text  0005 test


DYNAMIC SYMBOL TABLE:
1680 gDF .text  0005 test
"
Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSElang Objects

2017-05-12 Thread Fred van Stappen

On Friday 12 May 2017 13:52:36 Fred van Stappen wrote:
> > BTW, the mergesort benchmark binary also was 177576 bytes with
> > accidentally not working -XX, with active smartlinking it was reduced to
> > 26072 bytes.
>
> Hello Martin.
>
> In a other topic, they talk about to use : -k--gc-sections.
>
Yup, I get 29.9 KB with
fpc -k--gc-sections libnude.pas
"
library libnude ;

procedure test();
begin
end;

exports
 test;
end.
"
"
objdump -h -T -t liblibnude.so

liblibnude.so: file format elf32-i386

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .hash 0014  00d4  00d4  00d4  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .gnu.hash 0020  00e8  00e8  00e8  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .dynsym   0020  0108  0108  0108  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .dynstr   0022  0128  0128  0128  2**0
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .rel.dyn  1528  014c  014c  014c  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .text 4af0  1680  1680  1680  2**4
  CONTENTS, ALLOC, LOAD, READONLY, CODE
  6 .rodata   01b0  6170  6170  6170  2**4
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .eh_frame   6320  6320  6320  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .dynamic  00a8  7f58  7f58  6f58  2**2
  CONTENTS, ALLOC, LOAD, DATA
  9 .data 03f0  8000  8000  7000  2**4
  CONTENTS, ALLOC, LOAD, DATA
 10 .bss  1664  83f0  83f0  73f0  2**4
  ALLOC
SYMBOL TABLE:
00d4 ld  .hash   .hash
00e8 ld  .gnu.hash   .gnu.hash
0108 ld  .dynsym .dynsym
0128 ld  .dynstr .dynstr
014c ld  .rel.dyn    .rel.dyn
1680 ld  .text   .text
6170 ld  .rodata .rodata
6320 ld  .eh_frame   .eh_frame
7f58 ld  .dynamic    .dynamic
8000 ld  .data   .data
83f0 ld  .bss    .bss
1680 g F .text  0005 test


DYNAMIC SYMBOL TABLE:
1680 gDF .text  0005 test
"
Martin

--

Hello Martin.

Hum, sorry but I am a little bit loosed...

>  accidentally not working -XX, with active smartlinking it was reduced to 
> 26072 bytes.

Do you mean that you have a trick to do smartlinking working for libraries ?

> Yup, I get 29.9 KB with fpc -k--gc-sections libnude.pas

So what is the conclusion, what is the trick ?

Thanks.

Fre;D

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] MSElang Objects

2017-05-12 Thread Edson H
Yes. That's my compiler. It has only basic features. The idea is to integrate 
the PIC12F and PIC18F series, a simulator, a burning software and a debug 
integrated.  But it will be later.

By now it's a very optimized compiler. It's better than some other commercial 
products.



De: Martin Schreiber 
Enviado: viernes, 12 de mayo de 2017 07:11 a.m.
Para: mseide-msegui-talk@lists.sourceforge.net
Asunto: Re: [MSEide-MSEgui-talk] MSElang Objects

On Friday 12 May 2017 03:44:30 Edson H wrote:
>
> I'm currently developing a Pascal Compiler

Do you refer to
https://github.com/t-edson/PicPas
[https://avatars2.githubusercontent.com/u/7736802?v=3=400]

GitHub - t-edson/PicPas: Compilador en Pascal para 
...
github.com
README.md PicPas 0.5.3. Pascal compiler for PIC microcontrollers. NOTE: This 
compiler is still in alpha phase and has limited functionality. PicPas is a 
simple ...


? Looks good! Does the IDE have integrated debug capabilities?
I worked many years with PIC16xxx. Programming always was done in assembler.

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mseide-msegui-talk Info Page - 
SourceForge
lists.sourceforge.net
mseide-msegui-talk -- General list for MSEide+MSEgui About mseide-msegui-talk


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk