[fpc-pascal] TPath enhancements (Issue #40513): can somebody test with Delphi 12?

2023-11-18 Thread Bart via fpc-pascal
Hi,

I'm trying to implement the new features that were added in Delphi 12 to TPath.
I've made a naive implementation based upon available documentation.
Some questions about how it is supposed to behave are missing though:
1. The docs state that an exception is raised if the given paths
contain invalid characters. Does the vlaue of the ValidateParams have
any influence on this?
2. If not: what does this ValidateParams parameter do then?
3. if multiple paths are absolute (e.g. the 2nd, 3rd and 6th path is
absolute): what will be returned? (My guess: either the first absolute
one it finds, or the last one.)

Could anybody with Delphi 12 test the TPath.Combine(const Paths: array
of string; const ValidateParams: Boolean = True): string; function
with the test program that is in the bugtracker
(https://gitlab.com/freepascal.org/fpc/source/-/issues/40513#note_1645757436)?
Does it behave like the implementation I came up with?
If a parameter is "invalid", but it is not used in the result (e.g.
because there is a valid absolute path as the second or later argument
in the array), will there be an exception?

Without (black box) testing it'll be impossible to implement these features.
-- 
Bart
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Cannot build fpc on Raspberry Pi4B running PiOS 64 bit (aarch64 Linux)

2023-11-18 Thread Sven Barth via fpc-pascal
Bo Berglund via fpc-pascal  schrieb am
Sa., 18. Nov. 2023, 11:32:

> Today after realizing that I did the following on an RPi4B where I have
> used apt
> to install the fpc compiler so I could use that as the seed compiuler to
> build
> from sources.
>

Why don't you simply follow what I DID? First of deinstall that apt fpc
again. Then download 3.2.2 for aarch64-linux from SourceForge, install it
and add /path/to/where/you/installed/fpc/bin to your PATH (using "export
PATH=/new/path:$PATH").
Best pick in an installation path like /wherever/fpc/ and select
"yes" when asked whether to adjust the fpc.cfg with $fpcversion, that will
come in handy later.

Next download the sources for 3.2.3 and extract them somewhere different
than "/wherever/fpc". Change into that directory and execute the commands
as I had written in my previous mail (you should be in the same command
line session where you adjusted PATH for this to work otherwise you need to
set it again). The INSTALL_PREFIX should be "/wherever/fpc/3.2.3".

Next set your PATH again, but this time use the directory for 3.2.3 ("echo
$PATH" plus selecting and pasting is your friend here, cause you don't want
to *extend* your path, but replace it; or simply start a new console
windows and append the path there now that I think about it ).

Now you should have a working FPC and you can compile Lazarus from source
(sorry, don't know how to setup fpcupdeluxe to use an existing compiler,
cause I don't use it).

In Lazarus you then also need to set the path to your compiler.

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


Re: [fpc-pascal] Cannot build fpc on Raspberry Pi4B running PiOS 64 bit (aarch64 Linux)

2023-11-18 Thread Bo Berglund via fpc-pascal
On Fri, 17 Nov 2023 11:27:53 +0100, Sven Barth via fpc-pascal
 wrote:

>Bo Berglund via fpc-pascal  schrieb am
>Do., 16. Nov. 2023, 08:19:
>
>> From the Lazarus list:
>>
>> >Just a quick follow-up here:
>> >It seems like the fpc sources have not been updated with the solution to
>> the bug
>> >discussed here:
>> >
>> >https://gitlab.com/freepascal.org/fpc/source/-/issues/39295
>> >
>> >This causes the build of Lazarus using fpcupdeluxe with the latest fpc
>> 3.2.2 to
>> >fail because of a problem with __libc_csu_init during linking.
>> >
>> >Apparently it is fixed in non-released sources of fpc which we are waiting
>> >for...
>>
>> The GitLab ticket was opened 2 years ago:
>> https://gitlab.com/freepascal.org/fpc/source/-/issues/39295
>>
>> According to a post on the Lazarus forum the fix that solves the fatal
>> error
>> during fpc build on 64 bit aarch64 Linux (like on Raspberry Pi4B with
>> Pi-OS 64
>> bit) has *not* been ported to the target aarch64 Linux, only to powerpc.
>>
>>
>> https://forum.lazarus.freepascal.org/index.php/topic,34645.msg496883.html#msg496883
>
>
>Wrong. Who said that the solution consisted only of a single commit?
>
>
>>
>> So I am sitting here unable to run Lazarus/FPC on the RPi4B with the
>> latest 64
>> bit Pi-OS...
>>
>> Is any solution to this problem in the works?
>> I have tried every fpc source release from 3.2.2 up to trunk with the
>> exact same
>> result (here from a build try on trunk):
>>
>> /bin/ld:
>> /home/bosse/devtools/lazarus/2.2.6/fpcsrc/rtl/units/aarch64-linux/cprt0.o:
>> in
>> function `_start':
>> (.text+0x54): undefined reference to `__libc_csu_init'
>> /bin/ld: (.text+0x58): undefined reference to `__libc_csu_init'
>> /bin/ld: (.text+0x5c): undefined reference to `__libc_csu_fini'
>> /bin/ld: (.text+0x60): undefined reference to `__libc_csu_fini'
>> make[1]: *** [Makefile:2682: packages_smart] Error 2
>> make: *** [Makefile:2837: build-stamp.aarch64-linux] Error 2
>> fpmake.pp(60) Error: Error while linking
>> fpmake.pp(60) Fatal: There were 1 errors compiling module, stopping
>> Fatal: Compilation aborted
>>
>> I believe that a lot of people will experience this since the 64 bit OS on
>> RPi4
>> has been recently released as the *recommended* version on that popular
>> platform...
>>
>
>I can not reproduce. On a Raspberry OS 10 64-bit I downloaded FPC 3.2.2 for
>aarch64-linux from SourceForge as well as the sources of both 3.2.3 and
>3.3.1 from GitLab.
>I install 3.2.2, setup PATH to find the compiler and simply do the
>following for each 3.2.3 and 3.3.1 (in their corresponding source
>directories):
>
>make all FPMAKEOPT="-T 4" -j 4
>make install INSTALL_PREFIX=/path/for/fpc/ - j 4
>cd /path/for/fpc//bin
>ln -s .. /lib/fpc//ppca64 ppca64
>
>(the -T and -j are simply for parallel compilation)
>
>Both 3.2.3 and 3.3.1 (don't forget to set PATH correctly!) can successfully
>compile a hello world program that links against the C library (in my case
>by using the cthreads unit) while 3.2.2 can not (as expected).
>

Hi Sven,
I realized that my tests were not really isolating the problem tp fpc...
I was using fpcupdeluxe for aarch64 to install the Lazarus environment.
That always failed with the error I showed.


Today after realizing that I did the following on an RPi4B where I have used apt
to install the fpc compiler so I could use that as the seed compiuler to build
from sources.

Then I retrieved the fpc 3.2.2 sources from GitLab and extracted them into dir
$home/devtools/fpc/3.2.2

Next I ran these two commands in the 3.2.2 directory:
make clean FPC="/usr/bin/ppca64"  This succeeeded
time make all FPC="/usr/bin/ppca64" This ran for 5m23s and then displayed:

make[3]: Leaving directory '/home/bosse/devtools/fpc/3.2.2/packages/fpmkunit'
/home/bosse/devtools/fpc/3.2.2/compiler/ppca64 fpmake.pp
-Fu/home/bosse/devtools/fpc/3.2.2/packages/fpmkunit/units_bs/aarch64-linux
-Fu/home/bosse/devtools/fpc/3.2.2/rtl/units/aarch64-linux
Free Pascal Compiler version 3.2.2 [2023/11/18] for aarch64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for AArch64
Compiling fpmake.pp
fpmake.pp(16,3) Note: Local variable "T" is assigned but never used
Assembling fpmake
Linking fpmake
/usr/bin/ld: /home/bosse/devtools/fpc/3.2.2/rtl/units/aarch64-linux/cprt0.o: in
function `_start':
(.text+0x54): undefined reference to `__libc_csu_init'
/usr/bin/ld: (.text+0x58): undefined reference to `__libc_csu_init'
/usr/bin/ld: (.text+0x5c): undefined reference to `__libc_csu_fini'
/usr/bin/ld: (.text+0x60): undefined reference to `__libc_csu_fini'
fpmake.pp(60) Error: Error while linking
fpmake.pp(60) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[2]: *** [Makefile:1719: fpmake] Error 1
make[2]: Leaving directory '/home/bosse/devtools/fpc/3.2.2/packages'
make[1]: *** [Makefile:2682: packages_smart] Error 2
make[1]: Leaving directory '/home/bosse/devtools/fpc/3.2.2'
make: *** [Makefile:2837: build-stamp.aarch64-linux] Error 2

Next