Re: [fpc-pascal] Pass open array to static array?

2020-04-04 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal  schrieb am
Fr., 3. Apr. 2020, 21:03:

>
>
> > On Apr 3, 2020, at 10:09 PM, Sven Barth 
> wrote:
> >
> > If your DoThis would be declared with a dynamic array parameter (e.G.
> "specialize TArray") then you'd in fact have a temporary dynamic
> array constructed on the heap.
> >
> > Also I didn't say that dynamic arrays can't be constant, but that they
> only are so if declared in a const section.
> >
>
> can you post an example of a const dynamic array? I tried and it thinks
> it's a set so I can't assign to an open array.
>

It needs to be a typed constant:

const
  MyArray: array of LongInt = (1, 2, 3);

If the writable constants switch is off then this dynamic array won't be
writable either.


> Also that made me think, is it possible for an open array parameter to be
> written to if its source was a static array? You said it's a pointer so I
> wonder if it's possible to use them instead of passing a static array
> pointer with an additional parameter for the length.
>

Yes that is indeed the case though you'll have to declare the parameter as
var as otherwise the compiler will create a copy on the stack which will be
lost afterwards.

Also open array *always* start at index 0. So if you pass a static array
that's declared as 4..6 then your function will get an open array stsrting
at 0 with length 3 with the element at 0 being the element at 4 of the
static array.

And as a special functionality open arrays allow slicing. That is if you
have an open array parameter you can pass along parts of it to another open
array:

SomeFunc(MyArrayArg[3..High(MyArrayArg) - 3]);

This will also work correctly with var/out open array parameters.

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


[fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread Juha Manninen via fpc-pascal
Hello

I installed FPC 3.2RC1 Win32 version under Wine in Linux Manjaro 64-bit.
Wine version is a recent 5.5-1.
Compiling a hello.lpr program works.
Then I made a symbolic link for my Lazarus trunk sources and tried to build
with both "make all" and "make bigide".
All components compile well but with lazbuild it stops with an error (see
below).
What does "008b:fixme:ntdll:server_ioctl_file Unsupported ioctl" mean?
A net search gave only few links and they told to ignore the message if the
program works.
Well, this does not work.
Has anybody built Lazarus under Wine? Should I test with FPC 3.0.4? Is this
somehow related to the new version? Or is it about 32 / 64 bits?
I remember building Lazarus under Wine some years ago but then I installed
from Lazarus installer and later created a symlink for trunk sources.

Juha

---

make[1]: Leaving directory `c:/lazarus_trunk/components/lazdebuggergdbmi'
make -C ide lazbuilder LCL_PLATFORM=nogui
make[1]: Entering directory `c:/lazarus_trunk/ide'
make --assume-new=lazbuild.lpr lazbuild.exe OPT='
-Fu../packager/units/i386-win32 -Fu../components/codetools/units/i386-win32
-Fu../components/debuggerintf/lib/i386-win32
-Fu../components/lazutils/lib/i386-win32 -Fu../lcl/units/i386-win32
-Fu../lcl/units/i386-win32/nogui
-Fu../components/buildintf/units/i386-win32
-Fu../components/ideintf/units/i386-win32/nogui
-Fu../components/synedit/units/i386-win32/nogui
-Fu../components/lazcontrols/lib/i386-win32/nogui
-Fu../components/lazdebuggergdbmi/units/i386-win32/nogui
-Fu../units/i386-win32/nogui '
make[2]: Entering directory `c:/lazarus_trunk/ide'
c:/FPC/3.2.0rc1/bin/i386-Win32/ppc386.exe -gl -vbqewnhi -Sci -dlclnogui
-Fu../designer -Fu../debugger -Fu../debugger/frames -Fu../converter
-Fu../packager -Fu../packager/frames -Fu../components/custom -Fuinclude/win
-Fuframes -Fu. -Fiinclude -Fiinclude/win32 -Fi../images -FE..
-FU../units/i386-win32/nogui -Fu../packager/units/i386-win32
-Fu../components/codetools/units/i386-win32
-Fu../components/debuggerintf/lib/i386-win32
-Fu../components/lazutils/lib/i386-win32 -Fu../lcl/units/i386-win32
-Fu../lcl/units/i386-win32/nogui
-Fu../components/buildintf/units/i386-win32
-Fu../components/ideintf/units/i386-win32/nogui
-Fu../components/synedit/units/i386-win32/nogui
-Fu../components/lazcontrols/lib/i386-win32/nogui
-Fu../components/lazdebuggergdbmi/units/i386-win32/nogui
-Fu../units/i386-win32/nogui -di386 lazbuild.lpr
Hint: (11030) Start of reading config file
c:\FPC\3.2.0rc1\bin\i386-Win32\fpc.cfg
Hint: (11031) End of reading config file
c:\FPC\3.2.0rc1\bin\i386-Win32\fpc.cfg
Free Pascal Compiler version 3.2.0rc1 [2020/02/29] for i386
Copyright (c) 1993-2020 by Florian Klaempfl and others
008b:fixme:ntdll:server_ioctl_file Unsupported ioctl 900a8 (device=9
access=0 func=2a method=0)
Error: (1017) Path "..\" does not exist
make[2]: *** [lazbuild.exe] Error 1
make[2]: Leaving directory `c:/lazarus_trunk/ide'
make[1]: *** [lazbuilder] Error 2
make[1]: Leaving directory `c:/lazarus_trunk/ide'
make: *** [lazbuild] Error 2
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread Alexander Grotewohl
my guess is that function of wine is unimplemented (pretends to work but does 
nothing)

try to see if you can fix the cause of the second error? does wine handle 
relative paths gracefully?

--
Alexander Grotewohl
https://dcclost.com


From: fpc-pascal  on behalf of Juha 
Manninen via fpc-pascal 
Sent: Saturday, April 4, 2020 1:32:21 PM
To: FPC-Pascal users discussions 
Cc: Juha Manninen 
Subject: [fpc-pascal] Wine + Unsupported ioctl

Hello

I installed FPC 3.2RC1 Win32 version under Wine in Linux Manjaro 64-bit.
Wine version is a recent 5.5-1.
Compiling a hello.lpr program works.
Then I made a symbolic link for my Lazarus trunk sources and tried to build 
with both "make all" and "make bigide".
All components compile well but with lazbuild it stops with an error (see 
below).
What does "008b:fixme:ntdll:server_ioctl_file Unsupported ioctl" mean?
A net search gave only few links and they told to ignore the message if the 
program works.
Well, this does not work.
Has anybody built Lazarus under Wine? Should I test with FPC 3.0.4? Is this 
somehow related to the new version? Or is it about 32 / 64 bits?
I remember building Lazarus under Wine some years ago but then I installed from 
Lazarus installer and later created a symlink for trunk sources.

Juha

---

make[1]: Leaving directory `c:/lazarus_trunk/components/lazdebuggergdbmi'
make -C ide lazbuilder LCL_PLATFORM=nogui
make[1]: Entering directory `c:/lazarus_trunk/ide'
make --assume-new=lazbuild.lpr lazbuild.exe OPT=' 
-Fu../packager/units/i386-win32 -Fu../components/codetools/units/i386-win32 
-Fu../components/debuggerintf/lib/i386-win32 
-Fu../components/lazutils/lib/i386-win32 -Fu../lcl/units/i386-win32 
-Fu../lcl/units/i386-win32/nogui -Fu../components/buildintf/units/i386-win32 
-Fu../components/ideintf/units/i386-win32/nogui 
-Fu../components/synedit/units/i386-win32/nogui 
-Fu../components/lazcontrols/lib/i386-win32/nogui 
-Fu../components/lazdebuggergdbmi/units/i386-win32/nogui 
-Fu../units/i386-win32/nogui '
make[2]: Entering directory `c:/lazarus_trunk/ide'
c:/FPC/3.2.0rc1/bin/i386-Win32/ppc386.exe -gl -vbqewnhi -Sci -dlclnogui 
-Fu../designer -Fu../debugger -Fu../debugger/frames -Fu../converter 
-Fu../packager -Fu../packager/frames -Fu../components/custom -Fuinclude/win 
-Fuframes -Fu. -Fiinclude -Fiinclude/win32 -Fi../images -FE.. 
-FU../units/i386-win32/nogui -Fu../packager/units/i386-win32 
-Fu../components/codetools/units/i386-win32 
-Fu../components/debuggerintf/lib/i386-win32 
-Fu../components/lazutils/lib/i386-win32 -Fu../lcl/units/i386-win32 
-Fu../lcl/units/i386-win32/nogui -Fu../components/buildintf/units/i386-win32 
-Fu../components/ideintf/units/i386-win32/nogui 
-Fu../components/synedit/units/i386-win32/nogui 
-Fu../components/lazcontrols/lib/i386-win32/nogui 
-Fu../components/lazdebuggergdbmi/units/i386-win32/nogui 
-Fu../units/i386-win32/nogui -di386 lazbuild.lpr
Hint: (11030) Start of reading config file 
c:\FPC\3.2.0rc1\bin\i386-Win32\fpc.cfg
Hint: (11031) End of reading config file c:\FPC\3.2.0rc1\bin\i386-Win32\fpc.cfg
Free Pascal Compiler version 3.2.0rc1 [2020/02/29] for i386
Copyright (c) 1993-2020 by Florian Klaempfl and others
008b:fixme:ntdll:server_ioctl_file Unsupported ioctl 900a8 (device=9 access=0 
func=2a method=0)
Error: (1017) Path "..\" does not exist
make[2]: *** [lazbuild.exe] Error 1
make[2]: Leaving directory `c:/lazarus_trunk/ide'
make[1]: *** [lazbuilder] Error 2
make[1]: Leaving directory `c:/lazarus_trunk/ide'
make: *** [lazbuild] Error 2

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread fredvs via fpc-pascal
Hello Juha.

Here on Linux Dedian 10.2 64 bit multi-arch it is working perfectly.
I use wine + fpc.exe to compile many project, included MSEide or ideU.

Where did you install fpc.exe, in .wine/drive_ ?

Here where I did install it:

/home/fred/.wine/drive_c/FPC/3.0.4/bin/i386-win32/ppc386.exe

Did you install the Lazarus source also in .wine/drive_c ?

What command line are you using, I use this?

wine /home/fred/.wine/drive_c/FPC/3.0.4/bin/i386-win32/ppc386.exe
myprogram.pas

Fre;D




--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread Juha Manninen via fpc-pascal
On Sat, Apr 4, 2020 at 8:43 PM Alexander Grotewohl  wrote:

> my guess is that function of wine is unimplemented (pretends to work but
> does nothing)
> try to see if you can fix the cause of the second error? does wine handle
> relative paths gracefully?
>

Ok, the fatal error was the "Path "..\" does not exist" instead of
"Unsupported ioctl".
Yes, wine handles relative paths for sure. I don't what could cause such an
error.


On Sat, Apr 4, 2020 at 9:42 PM fredvs via fpc-pascal <
fpc-pascal@lists.freepascal.org> wrote:

> Here on Linux Dedian 10.2 64 bit multi-arch it is working perfectly.
> I use wine + fpc.exe to compile many project, included MSEide or ideU.
>
> Where did you install fpc.exe, in .wine/drive_ ?
> Did you install the Lazarus source also in .wine/drive_c ?
>

FPC is in drive_c/FPC. I just started the 3.2RC1 installer from Dolphin and
it ran with Wine. Nice.
Lazarus source dir is a symlink to my current sources. It should AFAIK. (?)
$ ls -la drive_c/
yhteensä 32
drwxr-xr-x  8 juha juha 4096  4. 4. 19:45  .
drwxr-xr-x  4 juha juha 4096  4. 4. 21:36  ..
drwxr-xr-x  3 juha juha 4096  4. 4. 19:37  FPC
lrwxrwxrwx  1 juha juha   28  4. 4. 19:45  lazarus_trunk ->
/home/juha/SW/lazarus_trunk/
drwxr-xr-x  7 juha juha 4096 29. 3. 02:04  ProgramData
drwxr-xr-x  7 juha juha 4096 29. 3. 02:04 'Program Files'
drwxr-xr-x  8 juha juha 4096 29. 3. 02:04 'Program Files (x86)'
drwxr-xr-x  4 juha juha 4096 29. 3. 00:56  users
drwxr-xr-x 20 juha juha 4096  4. 4. 21:36  windows


What command line are you using, I use this?
>
> wine /home/fred/.wine/drive_c/FPC/3.0.4/bin/i386-win32/ppc386.exe
> myprogram.pas
>

 wine cmd
 cd lazarus_trunk
 make bigide

All packages were built correctly before the error.

BTW, I installed Wine stable 5.0-2 from Manjaro AUR but got the exact same
errors.
Installing from AUR was impressive. It compiled with GCC for over half an
hour with all 8 cores at 100% load. Then it just worked...
I have a new passively cooled miniPC super-computer (!) with Ryzen 1605B
embedded processor.
I used the opportunity to measure its thermal design. This was the hottest
it got after ~half an hour:
-Sensors-
../../nvme0/temp1 Temperature 71,00°C
k10temp/temp1 Temperature 86,88°C
k10temp/temp2 Temperature 86,88°C
../../thermal_zone0/temp1 Temperature 66,00°C
amdgpu/temp1 Temperature 86,00°C
thermal/thermal_zone0 Temperature 67,00°C

Within the limits, no throttling. Nice! That was about the heaviest load it
will get.

Regards,
Juha
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread Juha Manninen via fpc-pascal
On Sat, Apr 4, 2020 at 10:13 PM Juha Manninen 
wrote:

> Lazarus source dir is a symlink to my current sources. It should AFAIK. (?)
>

Should be: "It should work as far as I know."
My brain capacity is getting low after some bug fixing etc.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread fredvs via fpc-pascal
> Ok, the fatal error was the "Path "..\" does not exist" instead of
"Unsupported ioctl".

Not sure to understand.

So is it ok, only a warning to fix "Unsupported ioctl" or the linking still
fails?



--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread Juha Manninen via fpc-pascal
On Sat, Apr 4, 2020 at 10:48 PM fredvs via fpc-pascal <
fpc-pascal@lists.freepascal.org> wrote:

> Not sure to understand.
>
> So is it ok, only a warning to fix "Unsupported ioctl" or the linking still
> fails?
>

After Alexander Grotewohl's reply I understood the only line with text
"error" is this one:
 Error: (1017) Path "..\" does not exist
The "Unsupported ioctl" thing can possibly be ignored as my web search
suggested.
I don't know how to fix the path error. I will try other ways of building
under Wine tomorrow.

Wine 5.0 versus Wine 5.5 made no difference. The output was identical.

Juha
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Wine + Unsupported ioctl

2020-04-04 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Sat, 4 Apr 2020, Juha Manninen via fpc-pascal wrote:

> I installed FPC 3.2RC1 Win32 version under Wine in Linux Manjaro 64-bit.
> Wine version is a recent 5.5-1. Compiling a hello.lpr program works.
> (...)
 > Has anybody built Lazarus under Wine? Should I test with FPC 3.0.4? Is
> this somehow related to the new version? Or is it about 32 / 64 bits? I
> remember building Lazarus under Wine some years ago but then I installed
> from Lazarus installer and later created a symlink for trunk sources.

Sorry for my ignorance, but why do you add an extra emulation layer?

If you want a compiler under Linux, which can produce Win32 executables,
you can just use a normal Linux native ppc386 compiler. With FPC, the
compiler binaries are only target CPU specific but not target OS specific,
therefore all OSes for the given CPU target target are supported by all
compilers, regardless of which OS they run on.

So you can tell the Linux ppc386 to target Windows (-Twin32), then specify
the Win32 unit files via -Fu and you should
get a Windows exe as result, without going through Wine during the
compilation process. (Yes, the unit files between the Linux ppc386 and the
Windows ppc386.exe are compatible too.)

Of course, your 64bit Linux has to be prepared to run 32bit Linux
binaries, but as the Linux ppc386 doesn't even link against libc, this
should be pretty easy.

If you don't want to use FPC's internal linker or assembler for some
reason, I'm sure most Linux distros supply mingw cross-win32-binutils as
well.

Charlie

(Ps: of course you could compile an x64 hosted ppc386 as well, but that
would require your own crosscompiler builds, probably. What I described
can be achieved by just downg pre-baked FPC binaries, and cherry picking
what you need.)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal