Re: [fpc-devel] Binary Package System Discussion?

2014-09-06 Thread Marco van de Voort
On Sat, Sep 06, 2014 at 01:24:36PM -0500, Den wrote:
>  I know this has been brought up from time to time, but the more I 
> use NetBeans and other big editors.. The more I miss the fact that it 
> isolates you from being in their pool of source code to build whenever 
> you add a component, etc. 


> Having a binary-only Lazarus would mean an 
> entire overhaul of a binary package system.  What would be amazing to 
> see actually, is FPC being able to compile into a universal object 
> (which supports the basic byte code, and sections which will only be 
> used when converting to a certain architecture if necessary.. Like SSE 
> optimized code), then being able to convert into native code at 
> destination machine.  Something like Chrome's Native Client does now, 
> which compiles the code into a universal op-code base, and converts it 
> to native at their servers..

Aside from the fact that it requires a bunch of tech that is not there and
costly to develop (even if you wanted to), it still doesn't solve the
recompile on installation of a package (specially if they contain code,
like designtime editors).

Then there is of course the problem that Java solves by simply not being
multiplatform at all.  (but run inside a Java world with the real machine at
arms length) 

Such universal code system would still fall down at the first OS specific
ifdef.  (since code for only the selected platform would be compiled into
bytecode ).

>  Having this universal binary package system, means we can 
> distribute one package, and have it convert on the destination machine.  

Yes. And then you would have what exactly? Still only a binary package compiled 
at
the host binary, the link to the IDE is still not done.

> Means we don't really have to do tricks when distributing your unit when 
> you don't want to distribute the source code (ie. Commercial Packages).

Good to remind, that is also the problem, since like most bytecodes the
intermediate format would be easily decompilable.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Binary Package System Discussion?

2014-09-06 Thread Den

Hi Sven!

I suppose you can just have Build Servers and build all major 
OS/Architectures.  The platform differences could be solved by an 
additional 'target dependent' package.  But I suppose with the Dynamic 
Packages, we could just bundle the different architectures in the one 
Package File, and have a header which states which architectures it has 
in it, or even in the file listings in the Package in a certain 
directory.  When that time comes, fun stuff will happen, as the Lazarus 
could be made to auto-update and such for the normal folk. (I know mine 
is practically auto-update.. Update VCS and then rebuild :p ) and then 
there's FPCUP .. But just thought something like Netbeans.


I was also thinking, when I have time, I wanted to make an API for 
Lazarus which devs could make their own VCS and have it display in the 
IDE, to make it more modern.. But I have a project due very very soon, 
so I can't really work on it yet. :p


Anyway, thanks for the reply Sven! I'll have that bug fix tested as soon 
as I get a moment.

Take care!

- Den

On 14-09-06 03:29 PM, Sven Barth wrote:


> Any thoughts?

Dream on. FPC is a native compiler and someone would need to implement 
that proposed bytecode and maintain it.
Even once we support LLVM we wouldn't drop any of our native code 
generators and even if we did LLVM simply does not support all those 
platforms that we support (e.g. m68k as CPU or OS/2 as OS).
Additionally there'd still be the platform differences which would 
stop you from distributing one set of blobs: on Windows you need to 
use the WinAPI, on Linux C API and X11 and on Mac OS X C API and 
Carbon/Cocoa. If you'd encode all this currently handled by ifdefs and 
different units into those blobs you could simply distribute the 
source as well.


Please note that support for binary packages (aka dynamic packages) 
will come. But they will depend on a target just as compiled units 
currently do already.


Regards,
Sven



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] MIPS big-endian program starts but does nothing

2014-09-06 Thread Sven Barth
Am 06.09.2014 11:27 schrieb "Reinier Olislagers" <
reinierolislag...@gmail.com>:
> program hellomips;
>
> {$mode objfpc}
> // let's use short strings {.$H+}
>
> {not$DEFINE UseCThreads} //otherwise it seems we get pthreads which gdb
> can't debug
> uses
>   {$IFDEF UNIX}{$IFDEF UseCThreads}
>   cthreads,
>   {$ENDIF}{$ENDIF}
>   Classes
>   ;
>
> begin
>   writeln('hello mips');
> end.

Would you please as a test remove the Classes unit as well? It does some
rather heavyweight initialization (which I noticed during getting m68k back
to life).

>
> with options
>  -MObjFPC -Scghi -Tlinux -Pmips -CpMIPS32R2 -Xs -vewnhibq
> -Filib\mips-linux -Fu. -FUlib\mips-linux -l

Are you sure "mips" is the big endian version? (I don't remember whether
it's mips and mipsle or mipsbe and nips...)

Additionally a simple Helloworld binary like that should not have any
library dependencies (FPC's RTL normally uses syscalls directly on Linux
after all). Would you please check with the mips objdump whether this is
really the case?

Regards,
Sven
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Binary Package System Discussion?

2014-09-06 Thread Sven Barth
> Any thoughts?

Dream on. FPC is a native compiler and someone would need to implement that
proposed bytecode and maintain it.
Even once we support LLVM we wouldn't drop any of our native code
generators and even if we did LLVM simply does not support all those
platforms that we support (e.g. m68k as CPU or OS/2 as OS).
Additionally there'd still be the platform differences which would stop you
from distributing one set of blobs: on Windows you need to use the WinAPI,
on Linux C API and X11 and on Mac OS X C API and Carbon/Cocoa. If you'd
encode all this currently handled by ifdefs and different units into those
blobs you could simply distribute the source as well.

Please note that support for binary packages (aka dynamic packages) will
come. But they will depend on a target just as compiled units currently do
already.

Regards,
Sven
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] MIPS big-endian program starts but does nothing

2014-09-06 Thread Reinier Olislagers
On 06/09/2014 18:40, Nikolai Zhubr wrote:
> Prebuilt/preflashed openwrt images most definitely do not have normal
> glibc, which is supposedly expected by normal linux rtl. Although I
> haven't checked myself, I think you could either try to somehow remove
> glibc dependancy for your test, or rebuild (and reflash) openwrt
> yourself with glibc/eglibc enabled, which might in turn require some
> digging and patching, see e.g.
> https://forum.openwrt.org/viewtopic.php?id=31174
Thanks. I'll have a look...

> On the other hand, if you are going to do some fpc-related
> testing/development/etc on mips, I can create and account for you on one
> of my debian mips boxes for remote access (Those are only used for daily
> builds so are idle most time of day).

Thanks for your kind offer, but apart from some DBF related stuff I
doubt I'll be going to do some FPC-related development on the box.
When circumstances change, I'll get in touch ;)
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] Binary Package System Discussion?

2014-09-06 Thread Den

Hello all,

I know this has been brought up from time to time, but the more I 
use NetBeans and other big editors.. The more I miss the fact that it 
isolates you from being in their pool of source code to build whenever 
you add a component, etc.  Having a binary-only Lazarus would mean an 
entire overhaul of a binary package system.  What would be amazing to 
see actually, is FPC being able to compile into a universal object 
(which supports the basic byte code, and sections which will only be 
used when converting to a certain architecture if necessary.. Like SSE 
optimized code), then being able to convert into native code at 
destination machine.  Something like Chrome's Native Client does now, 
which compiles the code into a universal op-code base, and converts it 
to native at their servers..


Having this universal binary package system, means we can 
distribute one package, and have it convert on the destination machine.  
Means we don't really have to do tricks when distributing your unit when 
you don't want to distribute the source code (ie. Commercial Packages).


Any thoughts?

- Den
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] MIPS big-endian program starts but does nothing

2014-09-06 Thread Mark Morgan Lloyd

Reinier Olislagers wrote:

On 06/09/2014 12:20, Mark Morgan Lloyd wrote:

I think the previous discussion wound down with the consensus that the
distro had custom libraries, possibly derived from ulibc, and that the
compiler etc. would have to be specially built for those. I was hoping
to set a Qemu-based system to investigate, but didn't get anywhere due
to other commitments.


Ok. It's running openwrt (also so that may well be the case; however I
copied over [1] the libs [2] from the device to my desktop, so that
should be a step in the right direction but presumably I need to
match the cross binutils [3] ld with the uclibc ld one?!?


This might be completely unhelpful, but I'll post it anyway just in case 
it's perversely relevant.


I had FPC running on SPARC under Solaris 10, and investigated getting it 
running on Solaris 8. The problem turned out to be that a system library 
(let's say it was libc.so, but I'm working from memory) was symlinked to 
libc.so.2 on Solaris 10 but libc.so.1 on Solaris 8, and the linking 
stage was resolving the symlink rather than leaving it until the program 
was run.


In the end I did something like copying libc.so.2 to libc.so.1 and 
changing libc.so to point to the latter. I built FPC (possibly just 
ppcsparc) and copied that to the v8 system, then restored the original 
symlink. At that point FPC ran OK on v8.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] MIPS big-endian program starts but does nothing

2014-09-06 Thread Nikolai Zhubr

Hi!

06.09.2014 14:53, Reinier Olislagers:
[...]

Ok. It's running openwrt (also so that may well be the case; however I


Prebuilt/preflashed openwrt images most definitely do not have normal 
glibc, which is supposedly expected by normal linux rtl. Although I 
haven't checked myself, I think you could either try to somehow remove 
glibc dependancy for your test, or rebuild (and reflash) openwrt 
yourself with glibc/eglibc enabled, which might in turn require some 
digging and patching, see e.g. 
https://forum.openwrt.org/viewtopic.php?id=31174


On the other hand, if you are going to do some fpc-related 
testing/development/etc on mips, I can create and account for you on one 
of my debian mips boxes for remote access (Those are only used for daily 
builds so are idle most time of day).


Nikolai


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] MIPS big-endian program starts but does nothing

2014-09-06 Thread Reinier Olislagers
Arggghhh. Ok, thanks, Sergei!

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] MIPS big-endian program starts but does nothing

2014-09-06 Thread Sergei Gorelkin

06.09.2014 14:53, Reinier Olislagers пишет:

On 06/09/2014 12:20, Mark Morgan Lloyd wrote:

I think the previous discussion wound down with the consensus that the
distro had custom libraries, possibly derived from ulibc, and that the
compiler etc. would have to be specially built for those. I was hoping
to set a Qemu-based system to investigate, but didn't get anywhere due
to other commitments.


Ok. It's running openwrt (also so that may well be the case; however I
copied over [1] the libs [2] from the device to my desktop, so that
should be a step in the right direction but presumably I need to
match the cross binutils [3] ld with the uclibc ld one?!?

Also tested with fpc at
ftp://ftp.freepascal.org/pub/fpc/snapshot/trunk/mips-linux/
which (perhaps unsurprisingly given the above) shows the same problem.

The reason could be that uclinux kernel passes argc,argv and envp on startup different to regular 
linux, which is not yet supported for mips targets.


Regards,
Sergei

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] MIPS big-endian program starts but does nothing

2014-09-06 Thread Reinier Olislagers
On 06/09/2014 12:20, Mark Morgan Lloyd wrote:
> I think the previous discussion wound down with the consensus that the
> distro had custom libraries, possibly derived from ulibc, and that the
> compiler etc. would have to be specially built for those. I was hoping
> to set a Qemu-based system to investigate, but didn't get anywhere due
> to other commitments.

Ok. It's running openwrt (also so that may well be the case; however I
copied over [1] the libs [2] from the device to my desktop, so that
should be a step in the right direction but presumably I need to
match the cross binutils [3] ld with the uclibc ld one?!?

Also tested with fpc at
ftp://ftp.freepascal.org/pub/fpc/snapshot/trunk/mips-linux/
which (perhaps unsurprisingly given the above) shows the same problem.

[1] from my notes
openwrt router mips (big endian) uclibc libuClibc-0.9.33.2
copied
/lib
/usr/lib
(only the root dirs)

[2]
crtbegin.o
crtbeginS.o
crtbeginT.o
crtend.o
crtendS.o
crtfastmath.o
ld-uClibc.so.0
ld-uClibc-0.9.33.2.so
libblkid.so.1
libblkid.so.1.1.0
libblobmsg_json.so
libc.so.0
libcrypt.so.0
libcrypt-0.9.33.2.so
libcrypto.so.1.0.0
libcurses.so
libdl.so.0
libdl-0.9.33.2.so
libelf.so.0
libelf.so.0.8.13
libform.so
libform.so.5
libform.so.5.7
libfreeswitch.so.1
libfreeswitch.so.1.0.0
libgcc.a
libgcc_eh.a
libgcc_s.so.1
libgcov.a
libhistory.so
libhistory.so.5
libhistory.so.5.2
libip4tc.so
libip4tc.so.0
libip4tc.so.0.0.0
libiwinfo.so
libjpeg.so.62
libjpeg.so.62.0.0
libjson.so.0
libjson.so.0.0.1
liblua.so.5.1.4
liblzo2.so
liblzo2.so.2
liblzo2.so.2.0.0
libm.so.0
libm-0.9.33.2.so
libmenu.so
libmenu.so.5
libmenu.so.5.7
libncurses.so
libncurses.so.5
libncurses.so.5.7
libnl-tiny.so
libpanel.so
libpanel.so.5
libpanel.so.5.7
libpcap.so
libpcap.so.1.1
libpcap.so.1.1.1
libpng.so.3
libpng.so.3.46.0
libpng12.so.0
libpng12.so.0.46.0
libpq.so.5
libpq.so.5.3
libpthread.so.0
libpthread-0.9.33.2.so
libreadline.so
libreadline.so.5
libreadline.so.5.2
librt.so.0
librt-0.9.33.2.so
libsqlite.so.0
libsqlite.so.0.8.6
libsqlite3.so.0
libsqlite3.so.0.8.6
libssl.so.1.0.0
libstdc++.so.6
libstdc++.so.6.0.16
libubox.so
libubus.so
libuci.so
libuClibc-0.9.33.2.so
libusb.so
libusb-0.1.so.4
libusb-0.1.so.4.4.4
libutil.so.0
libutil-0.9.33.2.so
libuuid.so.1
libuuid.so.1.3.0
libxtables.so
libxtables.so.5
libxtables.so.5.0.0
libz.so
libz.so.1
libz.so.1.2.7

[3]
mips-linux-ar.exe
mips-linux-as.exe
mips-linux-ld.exe
mips-linux-nm.exe
mips-linux-objcopy.exe
mips-linux-objdump.exe
mips-linux-strip.exe
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] MIPS big-endian program starts but does nothing

2014-09-06 Thread Mark Morgan Lloyd

Reinier Olislagers wrote:

Hi,

Periodically I try to cross-compile a simple program [1] for my router
with fpc trunk.
It starts but does nothing (does not return to command prompt).

Noticed an earlier mail from Dennis Poon where he described the same
behaviour.


I think the previous discussion wound down with the consensus that the 
distro had custom libraries, possibly derived from ulibc, and that the 
compiler etc. would have to be specially built for those. I was hoping 
to set a Qemu-based system to investigate, but didn't get anywhere due 
to other commitments.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] MIPS big-endian program starts but does nothing

2014-09-06 Thread Reinier Olislagers
Hi,

Periodically I try to cross-compile a simple program [1] for my router
with fpc trunk.
It starts but does nothing (does not return to command prompt).

Noticed an earlier mail from Dennis Poon where he described the same
behaviour.

Any suggestions?
Thanks,
Reinier

cat /proc/cpuinfo
system type : Atheros AR9344 rev 2
machine : TP-LINK TL-WDR3600/4300/4310
processor   : 0
cpu model   : MIPS 74Kc V4.12
BogoMIPS: 278.93
wait instruction: yes
microsecond timers  : yes
tlb_entries : 32
extra interrupt vector  : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x,
0x0ff8, 0x0ff8, 0x0ff8]
ASEs implemented: mips16 dsp
shadow register sets: 1
kscratch registers  : 0
core: 0
VCED exceptions : not available
VCEI exceptions : not available

]1]
program hellomips;

{$mode objfpc}
// let's use short strings {.$H+}

{not$DEFINE UseCThreads} //otherwise it seems we get pthreads which gdb
can't debug
uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes
  ;

begin
  writeln('hello mips');
end.

with options
 -MObjFPC -Scghi -Tlinux -Pmips -CpMIPS32R2 -Xs -vewnhibq
-Filib\mips-linux -Fu. -FUlib\mips-linux -l

relevant fpc.cfg snippet
# begin fpcup do not remove mips-linux
#cross compile settings dependent on both target OS and target CPU
#IFDEF CPUMIPS
#IFDEF LINUX
# Inserted by fpcup 06/09/2014 11:05:24
-CpMIPS32R2
-CfSOFT
-FDC:\development\cross\bin\mips-linux\
-XPmips-linux-
-Tlinux
-FlC:\development\cross\lib\mips-linux\
-Xr/usr/lib
-FL/usr/lib/ld-linux.so.2
#ENDIF
#ENDIF
# end fpcup do not remove
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] MIPS big-endian program starts but does nothing

2014-09-06 Thread Reinier Olislagers
Hi,

Periodically I try to cross-compile a simple program [1] for my router
with fpc trunk.
It starts but does nothing (does not return to command prompt).

Noticed an earlier mail from Dennis Poon where he described the same
behaviour.

Any suggestions?
Thanks,
Reinier

cat /proc/cpuinfo
system type : Atheros AR9344 rev 2
machine : TP-LINK TL-WDR3600/4300/4310
processor   : 0
cpu model   : MIPS 74Kc V4.12
BogoMIPS: 278.93
wait instruction: yes
microsecond timers  : yes
tlb_entries : 32
extra interrupt vector  : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x,
0x0ff8, 0x0ff8, 0x0ff8]
ASEs implemented: mips16 dsp
shadow register sets: 1
kscratch registers  : 0
core: 0
VCED exceptions : not available
VCEI exceptions : not available

]1]
program hellomips;

{$mode objfpc}
// let's use short strings {.$H+}

{not$DEFINE UseCThreads} //otherwise it seems we get pthreads which gdb
can't debug
uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes
  ;

begin
  writeln('hello mips');
end.

with options
 -MObjFPC -Scghi -Tlinux -Pmips -CpMIPS32R2 -Xs -vewnhibq
-Filib\mips-linux -Fu. -FUlib\mips-linux -l

relevant fpc.cfg snippet
# begin fpcup do not remove mips-linux
#cross compile settings dependent on both target OS and target CPU
#IFDEF CPUMIPS
#IFDEF LINUX
# Inserted by fpcup 06/09/2014 11:05:24
-CpMIPS32R2
-CfSOFT
-FDC:\development\cross\bin\mips-linux\
-XPmips-linux-
-Tlinux
-FlC:\development\cross\lib\mips-linux\
-Xr/usr/lib
-FL/usr/lib/ld-linux.so.2
#ENDIF
#ENDIF
# end fpcup do not remove
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel