Re: [fpc-pascal] help with porting project
Hi Jessica, the link to the forum post doesn't work, can you post the correct link? And maybe mention the name of the topic, in case the link doesn't work. Cheers, Tobias On Sun, 23 Jan 2022 04:01:46 + Jessica Jones via fpc-pascal wrote: > Hi > > I need help with porting an open source project from delphi 7 to latest > version of lazarus (target is win64). > > Please read all details here > > https://forum.lazarus.freepascal.org/index.php/topic,57968.msg431830/topicseen.html > > I hope somebody wants to help. I'm a beginner and in the future I would like > to maintain this project. > For now, I would be very happy with a lazarus project that successfully > compiles the (preferred) latest version of the source code. > > Thank you so much > Jessica > > Sent with [ProtonMail](https://protonmail.com/) Secure Email. Kind Regards, Tobias Giesen Subscribe to our newsletter here: https://www.syncovery.com/newsletter/ Syncovery on YouTube: https://www.youtube.com/channel/UCnZXQbuXJwiS6c6rsRJwxPQ Follow Me on Twitter: https://twitter.com/superflexible Super Flexible Software GmbH & Co. KG Buddenstr. 29-31 48143 Münster, Germany www.superflexible.com www.tgtools.com --- Registered at register court Münster as HRA 9716 Liability / general partner: TGTools GmbH Registered at register court Münster as HRB 17763 Directors: Tobias Giesen and Claudia Giesen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] FPC 3.2.2 (In)complete Boolean Evaluation on 32bit MacOS
Hello, it seems that the newest 32-bit FPC sometimes creates complete Boolean Evaluation rather than partial, which causes my application to crash. My context is like this: type BOOL=LongBool; PBOOL=^LongBool; function DoSomething(const Cancel:PBOOL=nil); begin if Assigned(Cancel) and Cancel^ then Exit; end; This crashes because Cancel and Cancel^ are always evaluated, even if Cancel is nil. It works fine in 64-bit. Is this a known problem? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compilation speed on Apple M1
Hello Florian, many thanks for this! To compare performance, is it sufficient to add the FTP=xxx parameter and point it to the different ppca64 versions? And should I compile the older source snapshort with the older version, and today's snapshot with the newer ppca64? I just want to do the test correctly. Cheers, Tobias On Sun, 22 Nov 2020 11:28:18 +0100 Florian Klämpfl via fpc-pascal wrote: > In r47526, I implemented support of the prefetch intrinsic on aarch64. On my > Raspi4 it reduced make cycle time by 25 % > (!). I would be very interested to get numbers for the M1. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compilation speed on Apple M1
Hi, many thanks for the replies! I actually think most of the time is used by clang for assembling. If I can find out more precise details, I will let you know. And it is already a little bit faster on M1 than on my Intel. Kind Regards, Tobias Giesen Super Flexible Software GmbH & Co. KG On Sat, 21 Nov 2020 14:15:24 +0100 Florian Klämpfl via fpc-pascal wrote: > Am 21.11.2020 um 12:54 schrieb Tobias Giesen via fpc-pascal: > > > > According to Geekbench, the single core performance on the new Mac is > > around 1.8x as fast as my Intel Mac. Multicore is also much faster. I > > wonder why I don't see the speed increase in compiling though. Yes I am > > using different FPC and XCode versions, but I wonder what else could > > have an influence? My project is very large and not divided into > > packages, so I frequently need to recompile the whole project. > > Large parts of FPC are memory throughput limited so I suspect the M1 is not > that much better in this regard, not to > mention that most likely the AAarch code generator is worse than the x86 one. > x86 received a lot of work in this field. > > Maybe it's possible that you build using an LLVM compiler the FPC with native > backend. As I do not use macOS, I have no > clue how to do this though. > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal Kind Regards, Tobias Giesen Super Flexible Software GmbH & Co. KG Buddenstr. 29-31 48143 Münster, Germany www.superflexible.com www.tgtools.com --- Registered at register court Münster as HRA 9716 Liability / general partner: TGTools GmbH Registered at register court Münster as HRB 17763 Directors: Tobias Giesen and Claudia Giesen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Compilation speed on Apple M1
Hello, first and foremost, many thanks to the creators and contributors of FPC and Lazarus, who enabled me to release my product natively for Apple Silicon only one day after receiving an M1 Mac. Fantastic work! FPC and Lazarus both run natively and work very well. According to Geekbench, the single core performance on the new Mac is around 1.8x as fast as my Intel Mac. Multicore is also much faster. I wonder why I don't see the speed increase in compiling though. Yes I am using different FPC and XCode versions, but I wonder what else could have an influence? My project is very large and not divided into packages, so I frequently need to recompile the whole project. I would be most grateful for any performance tips. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] macOS linker error ld: framework not found CoreImage
Hello Jonas, many thanks for the information, that’s very interesting and helpful. Cheers, Tobias > Am 01.08.2020 um 23:58 schrieb Jonas Maebe : > > On 01/08/2020 23:42, Tobias Klaus Giesen via fpc-pascal wrote: >> I am mainly working on MacOS 10.10 (Yosemite). >> >> After updating from FPC 3.0.4 to 3.2.0, and Lazarus from 2.0.4 to >> 2.0.10, I now get this linker error: >> ld: framework not found CoreImage >> >> The same error occurs with a 32-bit Carbon project and a 64-bit Cocoa >> project (even minimal applications created as new projects). >> >> I haven't found where CoreImage is referenced at all ... any ideas? > > It's an bug that was indeed introduced in the CocoaAll unit of FPC 3.2.0 > (and which has been fixed in the fixes branch). > > Besides building and installing a compiler + units from the fixes > branch, there is unfortunately no workaround other than > 1) compiling with -Cn > 2) editing the generated link.res file and removing the following lines > -framework > CoreImage > 3) executing the generated ./ppas.sh file > > > Jonas > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Linking with putty C code, various linker errors
Hello again, here's a quick update, I decided to make a DLL instead. Much easier and cleaner. Making good progress. Will publish when done. Cheers, Tobias On Tue, Oct 8, 2019 at 6:50 PM wrote: > Hello, > I am trying to make an SFTP client class based on putty. It will be open > source and I think quite useful > for many people, but it looks like I need some help :=) > > I need to link in over 100 .o files compiled with gcc. > I am using the fpc 3.1.1 snapshot on Win64 for now. > > ISSUE #1: > Undefined symbol: fopen > this line does not help: > function fopen(filename: PAnsiChar; mode: PAnsiChar): Pointer; cdecl; > external 'MSVCRT.DLL' name 'fopen'; > It works only when I write the function myself using cdecl; export; > Can this be fixed? > > ISSUE #2: > Undefined symbol: __imp_isspace > Undefined symbol: __imp_GetTickCount > and similar ones ... I think gcc added the __imp prefix ... > apparently I need to add an import library, but how? > > Overall the linker errors are not so many and I believe it will eventually > work. > > Cheers, > Tobias > > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] The unfortunate deprecation of GetTickCount
Hello, personally I use this 64 bit emulation: var CurrentIncrement:Int64=0; LastTickCount:Int64=0; function TGGetTickCount64:Int64; begin {$ifdef CPUX64} Result:=GetTickCount64; {$else} Result:=GetTickCount+CurrentIncrement; if Result wrote: > El 11/04/18 a les 10:06, Luca Olivetti ha escrit: > > > > BEFORE (with gettickcount): > > > > -- > > var PreviousTick:DWORD; > > > > ... > > PreviousTick:=GetTickCount; > > ... > > ... if DWORD(GetTickCount-PreviousTick)>WaitTime then > > > BTW, the DWORD typecast is only necessary with fpc, the following > program gives 4 and 4 if compiled with delphi 2, 4 and -4294967292 if > compiled with fpc 3.0.4 > > > program project1; > > uses >windows; > > var t1,t2,t3:dword; > begin >t1:=$fffe; >t2:=2; >t3:=t2-t1; >writeln(t3); >writeln(t2-t1); > end. > > > -- > Luca > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal Kind Regards, Tobias Giesen Super Flexible Software Ltd. & Co. KG Buddenstr. 29-31 48143 Münster, Germany www.superflexible.com www.tgtools.com --- Registered at register court Münster as HRA 9716 Liability / general partner: TGTools Ltd. Company No. 05513299 Registered in England and Wales Directors: Tobias Giesen and Claudia Giesen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Get user ID for name on Linux
Many thanks! That's great. The completeness of FPC units and packages is really astonishing. Cheers, Tobias On Wed, 3 Jan 2018 06:36:32 + Graeme Geldenhuys <mailingli...@geldenhuys.co.uk> wrote: > On 2018-01-03 00:12, Tobias Giesen wrote: > > Unfortunately Libc and UnixUtils don't seem to be available in 64-bit, so I > > can't call the > > functions getpwnam or GetUserId. > > As Marco said, you can use the "users" unit. Here is an example of how I > use in in fpGUI, and it supports 32-bit and 64-bit systems. > > > https://github.com/graemeg/fpGUI/blob/develop/src/corelib/x11/fpg_x11.pas#L4010-L4044 > > Note though that it only works for Linux. So other UNIX-type systems > like FreeBSD and Solaris are not supported. > > > Regards, >Graeme > > -- > fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal > http://fpgui.sourceforge.net/ > > My public PGP key: http://tinyurl.com/graeme-pgp > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal Kind Regards, Tobias Giesen Super Flexible Software Ltd. & Co. KG Buddenstr. 29-31 48143 Münster, Germany www.superflexible.com www.tgtools.com --- Registered at register court Münster as HRA 9716 Liability / general partner: TGTools Ltd. Company No. 05513299 Registered in England and Wales Directors: Tobias Giesen and Claudia Giesen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Get user ID for name on Linux
Hello, I would like to get the user ID for a Linux user name. Unfortunately Libc and UnixUtils don't seem to be available in 64-bit, so I can't call the functions getpwnam or GetUserId. Is there a replacement? Or could I define and import the function myself? Thanks for any help! Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] System call ABI problem on ppc Linux
Interesting! But my report was based on my development machine, a PowerBook G4. Apparently the special instructions are not used or not causing a problem because it also runs fine on the NAS. - Please excuse the shortness of this mail which was sent from my mobile phone. If necessary, I will send more information later. Cheers, Tobias Giesen > Am 05.12.2017 um 19:20 schrieb Karoly Balogh (Charlie/SGR) > <char...@scenergy.dfmk.hu>: > > Hi, > >> On Tue, 5 Dec 2017, tobiasgie...@gmail.com wrote: >> >> I think the only problem is with fpmake, which doesn't include >> FPC_ABI_EABI for powerpc 32-bit processors. >> >> My use case is running my software on a Synology DS-413 NAS, which has a >> PowerPC processor. It's only a few years old. Nowadays they use only >> Intel and ARM. > > Please note that your NAS has a Freescale P1022 CPU, which has an e500v2 > CPU core. In Linux architecture terms, this isn't a regular PowerPC but > PowerPCSPE, as it has a non-standard FPU. This means that classic PowerPC > FPU instructions are not supported, or supported only with kernel > emulation. It's also entirely incompatible with regular applications using > Altivec or VMX SIMD, as the instruction encoding overlaps. It could also > mean that the syscall ABI *could* be different to regular PowerPCs. I > don't know if it is, but could be. > > Free Pascal doesn't support PPCSPE CPUs officially (we always generate > classic FPU code for memory copies for example, and the PPC code generator > doesn't support the SPE FPU or the softfpu at this point), so at least we > should verify if your patch doesn't cause problems on regular PPC Linux > installations, or if this bug also exist there. > > Charlie > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] System call ABI problem on ppc Linux
Hello, I just filed a bug report about FpFtruncate passing the parameters incorrectly to the system. For example, setting a file size to $D would cause the file to have the size $D 000D. Apparently the conditional define FPC_ABI_EABI would fix it, but what other impact does it have? I wonder which other system calls might be affected? My application seems to work fine except for this function. https://bugs.freepascal.org/view.php?id=32772 Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Minimum Linux version for FPC 3.0.2 (armhf)
Hello, I wonder what the minimum Linux version is ... I have made NAS versions of my app, and it runs fine on an older Synology NAS with this uname info: Linux DS-212j 2.6.32.12 armv5tel GNU/Linux synology_88f6281_212j But it crashes with access violations, and EThread exceptions on this old QNAP Linux: Linux QNAPTS109II 2.6.12.6-arm1 armv5tejl unknown All newer QNAP versions running Linux 3.x are fine. But that firmware is not available for the some of the really old boxes. I admit that it's not important for me to support the old Linux, but I wonder what causes it and if it can be fixed? I suspect that TCriticalSection and threading causes it, but it is really hard to find out. The AVs seem to be memory corruption related (allocating/freeing strings for example). Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC (trunk) on Linux/ppc64le
Hello Pierre, wow, absolutely fantastic! Many thanks. It runs and I was able to compile and link a simple Hello World program. Pointer size is 8 Bytes :=) I will report back after compiling a really large project. Cheers, Tobias On Thu, 19 Oct 2017 06:32:39 -0200 Pierre Muller <pie...@freepascal.org> wrote: > Hi Tobias, > > I just generated a powerpc64le-linux fpc-3.1.1.powerpc64-linux.tar file > > It should be downloadable at: > > ftp://ftp.freepascal.org/pub/fpc/snapshot/trunk/powerpc64le-linux/fpc-3.1.1.powerpc64-linux.tar > > > Please let us know if this works as expected! > > Pierre > > Le 18/10/2017 à 10:53, tobiasgie...@gmail.com a écrit : > > Hello, > > > > I wonder if anybody has a compiled binary that she or he could share? I > > need to run > > FPC natively on an IBM ppc64 LE Linux platform. > > > > Cheers, > > Tobias > > > > > > ___ > > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal Kind Regards, Tobias Giesen Super Flexible Software Ltd. & Co. KG Buddenstr. 29-31 48143 Münster, Germany www.superflexible.com www.tgtools.com --- Registered at register court Münster as HRA 9716 Liability / general partner: TGTools Ltd. Company No. 05513299 Registered in England and Wales Directors: Tobias Giesen and Claudia Giesen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Free Pascal Setup
I think you were on the wrong page. You probably want this, which includes the Lazarus IDE: https://www.lazarus-ide.org/index.php?page=downloads - Please excuse the shortness of this mail which was sent from my mobile phone. If necessary, I will send more information later. Cheers, Tobias Giesen > Am 05.05.2017 um 03:09 schrieb John van der Linden <john.lin...@outlook.com>: > > Hi, > > When I download the Free Pascal I get a file called i386-win32-ppc386.zip > which contains 1 file called ppc386.exe which does not contain the Setup > system for the Free Pascal IDE that I was expecting. > > I have gone right through the Web Site and , although there is a lot of > words, there is nothing about installing this thing, where is Setup. > > This whole project is very diss appointing so far, can you help me. As the > idea sounds very interesting. > > Kind regards, > > John van der Linden > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] AArch64 / Linux
Wow, fantastic, many thanks! Will try to build it :=) - Please excuse the shortness of this mail which was sent from my mobile phone. If necessary, I will send more information later. Cheers, Tobias Giesen > Am 18.04.2017 um 23:34 schrieb Jonas Maebe <jo...@freepascal.org>: > > > Tobias Giesen wrote: >> I now have two machines running Linux on 64-bit ARM. So I wonder, what's the >> best >> way to get FPC 3.0.2 running natively on AArch64 and producing AArch64 >> programs? > > FPC 3.0.2 does not support AArch64. AArch64 is only supported in trunk, > and in a separate 3.0.x backport branch > (view-source:http://svn.freepascal.org/svn/fpc/branches/fixes_3_0_ios/ > -- this branch includes Linux/AArch64 support as well) > > > Jonas > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] AArch64 / Linux
Hello, me again trying new platforms :=) I now have two machines running Linux on 64-bit ARM. So I wonder, what's the best way to get FPC 3.0.2 running natively on AArch64 and producing AArch64 programs? Thanks for any tips. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Run-time checks
Hello, I have a few questions about run-time checks. Is it possible to check class typecasts such as TMyIniFile(AnIniFile) ? Or only "AnIniFile as TMyIniFile"? If only the second, it would be cool if it were possible to disallow the first kind of typecast. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] FPC 3: disabling automatic AnsiString codepage conversion
Hello, my application uses the AnsiString type to store UTF-8 data. That was totally fine. Now in FPC 3, automatic conversions cause data loss. I get question marks replacing Chinese characters, for example. I do not fully understand at which points these conversions are done. The FPC 3 Unicode documentation says something about "passing it to a RTL routine". What about this code: var a,b:Ansistring; begin a:=Utf8Encode(AWideString); b:=Copy(a,1,10); end; Is "Copy" an RTL routine? Is this OK or not? Best for me would be to be able to turn the conversions off completely. Is that possible? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lack of 'volatile' a serious issue.
Hello, I am interested in this problem too. My app is highly multithreaded, working mostly with TObject descendants such as TStringList and TCollections. I am ensuring thread safety thru CriticalSections. In fact I have made my own TThreadSafeStringList. I have been distributing the app with optimizations OFF because it didn't work with optimizations on. I only try optimizations ON once every three to four years but quickly go back to optimizations OFF. I optimize my code in such a way that compiler optimizations are not really needed, but obviously I wouldn't say no if they were reliable. Could it be related to this discussion? Do optimizations make apps less thread safe in FPC? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Does TThread.Execute terminate thread on exit?
Yes it will terminate and free (if FreeOnTerminate is true). - Please excuse the shortness of this mail which was sent from my mobile phone. If necessary, I will send more information later. Cheers, Tobias Giesen > On 01.11.2015, at 15:25, Bo Berglund <bo.bergl...@gmail.com> wrote: > > I have seen that the Execute method must chect for Terminated in its > loop and exit if Terminated is set to true. > But I cannot find mention on what happens if the Execute method exits > without Terminated having first been set. > Does this cause the thread itself to terminate and free or what > happens? > > -- > Bo Berglund > Developer in Sweden > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Linking FPC units with Visual Studio 2013 projects
Hello, many thanks for all the insight! I will be able to complete it now. A separate DLL should be easy enough, too. Cheers, Tobias Am 21.08.2015 08:40 schrieb Tobias Giesen tobiasgie...@gmail.com: Hello, I have to compile a few Pascal units with FPC and add them to a Visual C++ project. After adding system.o to the Visual C++ project, I get linker errors like this: system.o : error LNK2001: unresolved external symbol _$dll$kernel32$Sleep Apparently the Microsoft linker does not recognize the FPC way of mangling the DLL dependencies? Is there a way to compile the RTL in a way that Microsoft can link? Or anything else I can do? Short answer: no Long answer: ... ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Linking FPC units with Visual Studio 2013 projects
Hello, I have to compile a few Pascal units with FPC and add them to a Visual C++ project. After adding system.o to the Visual C++ project, I get linker errors like this: system.o : error LNK2001: unresolved external symbol _$dll$kernel32$Sleep Apparently the Microsoft linker does not recognize the FPC way of mangling the DLL dependencies? Is there a way to compile the RTL in a way that Microsoft can link? Or anything else I can do? Thanks. Tobias Giesen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Linking FPC units with Visual Studio 2013 projects
The particular symbol should be defined in libimpsystem.a Fantastic! After adding some more libraries, the only remaining missing symbol is FPC_WIDEINITTABLES. I can probably just create a dummy for that in a Pascal unit, as the code does not need widestrings. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Linking FPC units with Visual Studio 2013 projects
Hello, yes, to interface between Pascal and C I use 'extern C'. I do not have any problems linking between my C code and the Pascal code. The only problem is that the Pascal RTL uses DLL imports, which the Microsoft linker cannot resolve, for example: unresolved external symbol _$dll$kernel32$Sleep So again the question is how to enable the Microsoft linker to resolve the DLL dependencies. Cheers, Tobias On 08/20/2015 12:27 PM, tobiasgie...@gmail.com wrote: Hello, I have to compile a few Pascal units with FPC and add them to a Visual C++ project. As the object structure (and supposedly the naming scheme for overloaded functions) is different in fpc and C++ you can't link them (neither statically nor dynamically). You need to do a flat interface between the parts of the project using e.,g. STDCALL on either site. -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] How to handle SIGPIPE
Hello, my app does http transfers using the Synapse library on Windows and Mac OS X. The transfers happen in separate threads. On Mac OS X only, the app is occasionally stopped due to a SIGPIPE. How can I avoid or handle a SIGPIPE? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: How to handle SIGPIPE
Hoping is not enough when changing random values. See http://bugs.freepascal.org/view.php?id=9401 for more info. Wow. Many thanks! I read that MSG_NOSIGNAL is now supported by MacOS, too, but I don't really know. So now I am calling fpsetsockopt with SO_NOSIGPIPE as the first thing after every fpSocket call. That should probably do it, right? The bug comments on the above URL are not totally clear because you cannot actually pass any options to the Connect call. So I assume you should use fpsetsockopt before the Connect call. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] FPC 2.4.2 i386 MacOS: Inc broken for Int64's
Hello, my app uses the built-in Inc function to add Int64 variables. Unfortunately, they are treated as UInt32, so the values are truncated as 32 bit values. Wow! That is an impressive bug. I assume it is known? What's the recommendation, which FPC version should I use? Could it be an incompatibility with a specific version of the Developer Tools from Apple? It used to work fine a few years ago but no longer. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Leak narrowed down
Jonas wrote: export MallocStackLogging=1 Then, once the program is running and has leaked memory, run leaks nameofyourprogram Thanks for this tip! It is very interesting, however in this situation it does not detect the lost memory. At this point I have to give up on GetTextWidth - I will avoid it for now. Maybe next year the problem can be solved. I will send a note to the Lazarus list and submit a bug report, provided I can confirm the issue with a minimal testing program. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Widestring Questions
A bug may show anytime anywhere, but the built in ref counted string types are AFAIK thread safe what concerns the ref count per se. I suspect a subtle flaw in the client code is more probable. No, it is a compiler bug. The same code works 100% perfectly on Windows using Delphi, as well as on Mac OS X using FPC 2.2. Starting with FPC 2.4, it loses memory, which can be fixed by using UniqueString in a number of spots in the code. That is proof enough that the compiler has a bug. I am trying to isolate it today by finding out where exactly the UniqueString is necessary. Kind Regards, Tobias Giesen To avoid a reboot, make sure that no SuperFlexible or ExtremeSync processes are running in Task Manager before installing an update. Super Flexible Software Ltd. Co. KG Lessingstr. 42 48485 Neuenkirchen, Germany www.superflexible.com www.tgtools.com --- Registered at register court Steinfurt as HRA 5061 Liability / general partner: TGTools Ltd. Company No. 05513299 Registered in England and Wales Directors: Tobias Giesen and Claudia Giesen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Widestring Questions
Hi, I was wrong, UniqueString does not help after all. I am now using an extended version of the heaptrc unit to show the reference count (and string value) for unfreed WideStrings and they usually have 1 as a reference count. Will keep you posted. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Widestring Questions
Hi Jonas, thanks very much!!! I am sorry for the wrong things that I wrote. Now I can clearly see that the memory is not lost on the FPC heap. The total heap size doesn't even change at all. So there's no difference with CMem either. More work to do ... Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Heaptrc with symbolic stack trace or map file on Mac OS X ?
Hello, I'm trying to find a memory leak but I am unable to get a symbolic stack trace from the heaptrc dump. Also the option -Xm does not generate a map file on Mac OS X. Or at least I don't see it. If I could get a detailed map file with line numbers and offsets, I would probably be happy. Any ideas? Thanks. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Widestring memory leaks with FPC 2.4.0?
Hello, I'm using FPC 2.4.0 on Mac and I have a problem with WideString memory leaks. Is there any known issue, such that temporary WideStrings are not always freed, or any bug in reference counting? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Widestring memory leaks with FPC 2.4.0?
Hi, I am doing a regular heaptrc.DumpHeap now and I see that WideString memory blocks are still allocated for string values which are no longer in use. Is the memory freed in some lazy way? Or should a value that is no longer assigned to any WideString be freed immediately? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Widestring memory leaks with FPC 2.4.0?
Unless heaptrc shows leaks when the program exits, no memory leaks happen. It's a leak. The program loses hundreds of MBs of memory just by working with WideStrings. I compared it against FPC 2.2.4 - no leak. An SVN snapshot of 2.5.1 from around 3 months ago also leaks. Will update from SVN now. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Widestring memory leaks with FPC 2.4.0?
Then you'll have to provide a compilable example that demonstrates the problem so we can fix it. I will try! Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Widestring Questions
Hi, is it possible to turn off reference counting, for a test? Is there a difference between UnicodeString and WideString on the Mac version (i386) of FPC 2.4 / 2.5? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Widestring Questions
Hi, I think the problem might be that Widestring reference counting is not thread safe. But it worked fine in FPC 2.2. I will add some UniqueString calls and also try to isolate the issue. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] gdb Segmentation Fault - $D- does not help?
Hello, I am still struggling with the Segmentation Fault that gdb produces when loading my app's symbols on Mac OS X. I inserted $D- at the top of a few hundred units, but the app still has the exact same file size. Is the $D- compiler directive ignored? Shouldn't the symbols shrink? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Thanks for an awesome tip: -Ur = create release units
Hello, thanks to Jonas for this tip in April! This command line switch can really solve some recompiling problems: -Ur (= create release units) I had the problem Recompiling XYZ, checksum changed for ZZZ when recompiling Lazarus with my component package. It's now solved. For the benefit of everybody I am quoting the original tips again: In some cases, the compiler will want to immediately recompile previously compiled units: a) if you use a unit that has in its interface section a procedure that is declared normally, but which is declared as external. Solution: declare it immediately as external in the interface and remove the version in the implementation b) if you have inline procedures in the interface of unit1 and a unit that uses unit1 is (indirectly) used in the implementation of unit1. Solution: compile everything with -Ur (= create release units; the compiler will never try to recompile such units afterwards, except if the interface section of a unit that it uses has been changed and this other unit has been recompiled). Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Mac OS X gdb: Segmentation Fault loading my project
Hello, I am back developing for Mac! My compiled application with symbold is 93.5 MB in size and gdb cannot load it, so the debugger in Lazarus fails too. This happens on both Leopard and Snow with FPC 2.2.x and 2.4.0 and Lazarus 0.9.28 and 0.9.29. Only the 2 year old installation on Tiger still works. Note that I have to use -Cg- to disable PIC due to some assembler code. Could this have an influence? I tried to reduce the symbol size by compiling the LCL without symbols, but the option -g- did not do the trick - how could I try that? Should I try installing FPC 2.5 from SVN? Or install a newer gdb? Any other ideas? Thanks for any help! Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Mac OS X gdb: Segmentation Fault loading my project
With FPC 2.4.0 I get Fatal: Compilation aborted: Unhandled exception at ... on line 1 of some units. Does it still happen after cleaning the project and then rebuilding it? I manually deleted all .ppu, .o, and .rst files and it happens on a fresh build. By the way could -Cs2000 do any harm? Maybe one 0 too many? I saw 2.4.3 for Windows on the snapshots page, is there any such update for Mac? Kind Regards, Tobias Giesen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Mac OS X gdb: Segmentation Fault loading my project
Then please file a bug report with source code to reproduce the crash. I'd love to but probably it only happens in my project with close to 500 units, it can be really hard to strip such things down. There is unfortunately a lot of closed source code in it. I will try installing FPC 2.5. Probably going to take a while to figure that out from SVN. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Compiling FPC
Hi, I have the sources from SVN now, do I just cd into the folder and type make? I couldn't find any documentation on making FPC anywhere on freepascal.org. Maybe I missed something? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiling FPC
On the website on the right is a link Documentation. http://freepascal.org/docs.var OK after some more searching I found the Building faq (PDF) on http://freepascal.org/moreinfo.var Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] 2.5.1: Ansi string constants vs Unicode
Hello, I've got 2.5.1 now. I have a string constant like this: const Vec:AnsiString=#$094#$06D; This should just be 8-bit data with no conversion. But I get Error: Unicodechar/string constants cannot be converted to ansi/shortstring at compile-time. Can I tell the compiler to interpret all string constants as Ansi rather than Unicode? I read the FPC UNICODE SUPPORT wiki page but it doesn't go into such detail. Kind Regards, Tobias Giesen Super Flexible Software Ltd. Co. KG Lessingstr. 42 48485 Neuenkirchen, Germany www.superflexible.com www.tgtools.com --- Registered at register court Steinfurt as HRA 5061 Liability / general partner: TGTools Ltd. Company No. 05513299 Registered in England and Wales Directors: Tobias Giesen and Claudia Giesen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] 2.5.1: Ansi string constants vs Unicode
const Vec:AnsiString=#$094#$06D; This should just be 8-bit data with no conversion. try const Vec:AnsiString=#$94#$6D; Works! Thanks Dmitry! Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus Snapshots Intel Mac with FPC 2.4.1?
Another, more seldom reason for recompilation problems is that you happen to name one of your own units the same as a rtl/fcl/lcl library unit. In that case the compiler thinks that your file is the new source and it wants to recompile the library units Wow, that is very useful information! It's very possible that I have a naming conflict somewhere. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus Snapshots Intel Mac with FPC 2.4.1?
Which bugs? I'm sorry but it was a few months ago. Before trying again I wanted to make sure I had the best version of FPC available. I had problems with units not being found although they were on the search path allright. Also installing packages into Lazarus caused all kinds of unit conflicts (Recompiling XYZ.pas because the checksum changed although it didn't). Well I will try again soon. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus Snapshots Intel Mac with FPC 2.4.1?
This usually means that they were compiled by a previous compiler, or that they use units which have been changed and recompiled since the previous compilation. In that case, the compiler will ignore the precompiled unit and try to recompile it. If it then doesn't find the sources, you'll get an error about the unit not being found. Yes but the sources were there. They were in the search path, but the compiler didn't search properly. I will look into it again and if there are bugs, I will fix them in the FPC sources and submit the fixes. (Recompiling XYZ.pas because the checksum changed although it didn't). I deleted all .o and .ppu files and still this happened. I'm not mixing anything. The problem is that FPC sometimes doesn't like its own units - maybe because of different compiler switches? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Lazarus Snapshots Intel Mac with FPC 2.4.1?
Hello, thanks very much, Jonas and Mattias! I think your tips will help me a lot. I will go back to Macintosh development in about a month. If you don't hear from me, I'm fine! Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Lazarus Snapshots Intel Mac with FPC 2.4.1?
Hello, I'm having serious problems with bugs in FPC 2.4.0 on Intel Mac OS X. Would it be possible to post snapshots with 2.4.1? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Floating point miscalculations on PowerPC
Hello, I'm using FPC 2.2.4 (ppcppc) to create a PowerPC app with Lazarus. It's running under Rosetta on an Intel Mac. Simple floating point operations like this result in wrong code that creates wrong results: --- var it:Int64; dt:TDateTime begin it:=ANumber; dt:Trunc(it/10.0+0.5) / 86400.0; end; --- Does anybody remember a bug with TDateTime calculations and floating point constants that would only occur on the PowerPC platform? Has it been fixed? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: getting started with threads
But how can I prevent race conditions? If threads X and Y happen to call the task assignment function at the same time, it seems to me that they could both be assigned to the same task. Use for example the cross-platform implementations of Enter/LeaveCriticalSection. Like this: EnterCriticalSection(MyCritVar); try DoStuff finally LeaveCriticalSection(MyCritVar); end; Then the main loop can assign a new task by starting a new thread, whenever it finds one that is finished. Also possible but not easier. Threads should not be started or stopped for each task, instead they should wait for an event telling them to continue with the next task. For example using SetEvent / ResetEvent as well as: {$ifdef win32} WaitForSingleObject(ContinueEvent,INFINITE); {$else} RTLEventWaitFor(ContinueEvent); {$endif} Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Weak linking on Mac OS?
Hello, I wasn't able to find information on this on the web - apparently it has been implemented for Mac OS X but how can I use it? Is there a special keyword for it? Thanks. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Missing functions in FPCMacOSAll.pas
Hello, frequently I need to use a function that is missing in FPCMacOSAll.pas. Trying to declare it myself usually results in successful compilation and linking, but most of the time the functions crash at run time. So I wonder if these are not implemented or if I declare them wrong. Today I need the function FSMountServerVolumeSync and I declared it like this: function FSMountServerVolumeSync(const url:CFURLRef; const mountDir:CFURLRef; const user:CFStringRef; const password:CFStringRef; const mountedVolumeRefNum:FSVolumeRefNumPtr):OSStatus; external name '_FSMountServerVolumeSync'; It compiles and links but it crashes (access violation). What am I doing wrong? Is this only for Cocoa? How can I make it available? Previously, I have been successful with the following function: function LSOpenItemsWithRole( const (*var*) inRef: FSRef; const inItemCount: CFIndex; const inRole: LSRolesMask; const inAEParam: UInt32; const inAppParams: LSApplicationParameters; const outPSNs: ProcessSerialNumberPtr; const inMaxPSNCount: CFIndex ): OSStatus; external name '_LSOpenItemsWithRole'; This function, too, is listed as available in MacOS X but not available in CarbonLib. What's the difference between these two functions, I wonder ... Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Missing functions in FPCMacOSAll.pas
Hi, thanks very much, it works now! I created a new unit for my declarations and just copied the whole compiler instructions block from FPMacOSAll.pas: {$mode macpas} {$packenum 1} {$macro on} {$inline on} {$calling mwpascal} So now I have access to a whole range of super advanced additional stuff like FSMountServerVolumeSync ;=) Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: How to initialize thread vars?
Hi, I think that thread variables are automatically initialized to zero. So you just need to use them in such a way that zero is the desired start value. Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Re: Socket library for Mac OS X
I never used synapse before (only ICS with Delphi), so I don't know exactly what you mean with a C compatible library Well on Windows, it uses the Windows sockets and on Mac OS X, it uses the standard Unix library units that come with FreePascal. So you don't need to worry about libraries at all. Synapse is much more compact and less bloated than Indy, for example. If you have any problems or need any customization, you will be able to work with the Synapse source code much better than with Indy. Kind Regards, Tobias Giesen Super Flexible Software Ltd. Co. KG Lessingstr. 42 48485 Neuenkirchen, Germany www.superflexible.com www.tgtools.com --- Registered at register court Steinfurt as HRA 5061 Liability / general partner: TGTools Ltd. Company No. 05513299 Registered in England and Wales Directors: Tobias Giesen and Claudia Hübl ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: Socket library for Mac OS X
Hello, Synapse works extremely well with maybe only 1 change due to an undefined symbol at compile time, which can be defined as 0. http://synapse.ararat.cz/doku.php Cheers, Tobias http://www.superflexible.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: chown on Mac OS X
Hi, OK I added this as a bug: http://mantis.freepascal.org/view.php?id=11705 This is caused by FpChown missing from oscdeclh.inc in the rtl/unix folder. I tried adding it but it causes an exception. But chown is present in the libc. Why can't it be called? I can't believe that nobody uses chown from Pascal? Probably works on Linux but not on other Unix systems? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] chown on Mac OS X
Hello, I am trying to call fpchown but it causes an infinite recursion. fpchmod works fine. This happens in all FPC 2.x versions. Any ideas? How can I recompile the FCL with debugging information, so I can trace into these problems with Lazarus? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] GDB Crash with FPC 2.2.1 (works with 2.2.0)
Hello, now that the Lazarus snapshots are including FPC 2.2.1 for OS X (i386), I am using this version. I had to add the -Cg- option because my old assembly code is not compatible with PIC. Unfortunately the debugger crashes with the following crash report. Is there anything I can do to make it work? I am compiling a medium-sized application with LCL and the Carbon widgetset. Thanks Tobias --- Date/Time: 2008-05-31 11:27:52.612 +0200 OS Version: 10.4.11 (Build 8S2167) Report Version: 4 Command: gdb-i386-apple-darwin Path:/usr/libexec/gdb/gdb-i386-apple-darwin Parent: lazarus [6600] Version: ??? (???) PID:7572 Thread: 0 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x4d7f9dd4 Thread 0 Crashed: 0 gdb-i386-apple-darwin 0x0019f5ec d_substitution + 151 1 gdb-i386-apple-darwin 0x001a2ddd cplus_demangle_type + 885 2 gdb-i386-apple-darwin 0x001a2ec1 cplus_demangle_type + 1113 3 gdb-i386-apple-darwin 0x001a2f2e d_bare_function_type + 61 4 gdb-i386-apple-darwin 0x001a2ca4 cplus_demangle_type + 572 5 gdb-i386-apple-darwin 0x001a2f2e d_bare_function_type + 61 6 gdb-i386-apple-darwin 0x001a38ac d_encoding + 1007 7 gdb-i386-apple-darwin 0x001a3b1a d_demangle + 532 8 gdb-i386-apple-darwin 0x001a3c86 cplus_demangle_v3 + 20 9 gdb-i386-apple-darwin 0x000de332 cplus_demangle + 128 10 gdb-i386-apple-darwin 0x0002fa60 symbol_find_demangled_name + 99 11 gdb-i386-apple-darwin 0x0002fcca symbol_set_names + 567 12 gdb-i386-apple-darwin 0x000b0c61 prim_record_minimal_symbol_and_info + 395 13 gdb-i386-apple-darwin 0x0015284b record_minimal_symbol + 1209 14 gdb-i386-apple-darwin 0x001574bb read_dbx_symtab + 1358 15 gdb-i386-apple-darwin 0x0015a023 dbx_symfile_read + 593 16 gdb-i386-apple-darwin 0x00166c7a macho_build_psymtabs + 2601 17 gdb-i386-apple-darwin 0x00166dd5 macho_symfile_read + 263 18 gdb-i386-apple-darwin 0x0008d570 syms_from_objfile + 1282 19 gdb-i386-apple-darwin 0x000912af symbol_file_add_with_addrs_or_offsets + 647 20 gdb-i386-apple-darwin 0x00091a06 symbol_file_add_main_1 + 233 21 gdb-i386-apple-darwin 0x00091b27 symbol_file_command + 216 22 gdb-i386-apple-darwin 0x0009fce3 file_command + 44 23 gdb-i386-apple-darwin 0x00022bbd execute_command + 702 24 gdb-i386-apple-darwin 0x00015ff0 mi_execute_cli_command + 144 25 gdb-i386-apple-darwin 0x00017003 captured_mi_execute_command + 371 26 gdb-i386-apple-darwin 0x0003d661 catch_exception + 65 27 gdb-i386-apple-darwin 0x000163d8 mi_execute_command + 157 28 gdb-i386-apple-darwin 0x0001657f mi_execute_command_wrapper + 47 29 gdb-i386-apple-darwin 0x00040962 handle_file_event + 344 30 gdb-i386-apple-darwin 0x00040361 process_event + 132 31 gdb-i386-apple-darwin 0x0004123e gdb_do_one_event + 1159 32 gdb-i386-apple-darwin 0x0003d87f catch_errors + 76 33 gdb-i386-apple-darwin 0x000403bf start_event_loop + 81 34 gdb-i386-apple-darwin 0x00017abd captured_command_loop + 17 35 gdb-i386-apple-darwin 0x0003d87f catch_errors + 76 36 gdb-i386-apple-darwin 0x00018ddb captured_main + 4835 37 gdb-i386-apple-darwin 0x0003d87f catch_errors + 76 38 gdb-i386-apple-darwin 0x00018e1b gdb_main + 62 39 gdb-i386-apple-darwin 0x24b9 main + 51 40 gdb-i386-apple-darwin 0x246a _start + 216 41 gdb-i386-apple-darwin 0x2391 start + 41 ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] WARNING: Widestring Delete function causes crashes (FPC 2.2.0)
As I noted in your bug report, this has been fixed in 2.2.1 for several months already. But the fix must be copied to 2.2.0 too, because the Lazarus team is still spreading this crash on their daily snapshots. I don't know who is responsible for that. Can you tell me? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] WARNING: Widestring Delete function causes crashes (FPC 2.2.0)
Hello, the Widestring Delete function in wstrings.inc accesses memory beyond the end of the string. This causes crashes after a while. The Delete function has been fixed in FPC 2.3 but the fix must be copied to the earlier branches too. I have submitted this as a bug in Mantis: http://bugs.freepascal.org/view.php?id=11365 Until it is fixed, developers can just use the fixed code below instead of the one in the System unit. You just need to find out if your platform uses FPC_WINLIKEWIDESTRING or not. On my platform, MacOS X, this is not defined. Type PWideRec = ^TWideRec; TWideRec = Packed Record {$ifdef FPC_WINLIKEWIDESTRING} Len : DWord; {$else FPC_WINLIKEWIDESTRING} Ref : SizeInt; Len : SizeInt; {$endif FPC_WINLIKEWIDESTRING} First : WideChar; end; Const WideRecLen = SizeOf(TWideRec); WideFirstOff = SizeOf(TWideRec)-sizeof(WideChar); Procedure Delete (Var S : WideString; Index,Size: SizeInt); overload; Var LS : SizeInt; begin If Length(S)=0 then exit; if index=0 then exit; LS:=PWideRec(Pointer(S)-WideFirstOff)^.Len div sizeof(WideChar); if (Index=LS) and (Size0) then begin UniqueString (S); if Size+IndexLS then Size:=LS-Index+1; if Index+Size=LS then begin Dec(Index); System.Move(PWideChar(S)[Index+Size],PWideChar(S)[Index], (LS-Index-Size+1)*sizeof(WideChar)); end; Setlength(s,LS-Size); end; end; Kind Regards, Tobias Giesen http://www.superflexible.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: FPC on Mac OS X
Hi Sandy, FPC is just the command line compiler. I suppose you could integrate it with Apple's XCode, but the real GUI that goes with it is called Lazarus. The installation is a bit complicated but it will make you very happy. The instructions are here: http://wiki.lazarus.freepascal.org/OS_X_Programming_Tips And the discussion list is here: http://www.lazarus.freepascal.org/mailman/listinfo/lazarus Kind Regards, Tobias Giesen Super Flexible Software Ltd. Co. KG Lessingstr. 42 48485 Neuenkirchen, Germany www.superflexible.com www.tgtools.com --- Registered at register court Steinfurt as HRA 5061 Liability / general partner: TGTools Ltd. Company No. 05513299 Registered in England and Wales Directors: Tobias Giesen and Claudia Hübl ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] no_dead_strip not recognized by OS X 10.3 assembler
Hello, I am now trying the latest Lazarus snapshots on OS X 10.3 on a powerpc Mac. The application compiles 99% fine but at the end it fails with the following errors (from the assembler, I assume): unknown section attribute: no_dead_strip [...] Error while assembling Exit Code 1 Is there a solution for this problem? Thanks! Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Compiling / Make problems, latest SVN
Hello, thanks for the new Makefiles! I am now at SVN rev. 8988 and when I enter cd fpc/compiler make cycle CPU_TARGET=powerpc I get: Makefile:125: *** Compiler ppcrossppc not found. Stop. I don't know what's happening. In this step, I do not want to crosscompile. I want to _make_ the cross-compiler. Thanks for any help!! Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] no_dead_strip not recognized by OS X 10.3 assembler
Yes, add the -CX- -X- command line options. Or better: turn off all smart linking related options in Lazarus. Thanks! I did both, but somehow the error is still there. All the units compile fine, only the last step where the .dpr file is compiled fails. The .s file of the main program remains in the folder. Can I edit it and do the final steps manually, just for a test? Cheers, Tobias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Compiling FPC 2.3 with FPC 2.2 (Mac OS i386)
Hello, I have installed FPC 2.2 from the Lazarus snapshots. Now I am trying to compile the latest FPC sources from SVN. A few weeks ago, this worked but now I get: variants.pp(518,14) Fatal: Unknown compilerproc fpc_copy_proc. Check if you use the correct run time library. How can I check this? According to my fpc.cfg file which came with Lazarus, the compiler should automatically go into the correct folders for its library: -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/* -Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/rtl The reason I want to recompile is the improvements to tppumodule.search_unit. In Lazarus, I often have to rebuild the whole project because files are not found when I only hit F9. Have the improvements to tppumodule.search_unit been ported back to version 2.2 yet? Where can I get the 2.2 sources? Thanks. Kind Regards, Tobias Giesen www.superflexible.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Re: Compiling ... Got it working
Hello, I cleaned up some folders, deleting files from previous compilations and updating to the latest SVN and now it's working. FPC 2.3.1 finds my files much better than 2.2. Maybe the improvements in fppu.pas (tppumodule.search_unit) could be ported back to version 2.2 so that other developers will enjoy them too. Cheers, Tobias http://www.superflexible.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] Compiling FPC 2.2 on Mac OS X / i386
Hello, I would like to compile FPC. Do I need a special make tool? When I type make all, I get many error messages, apparently because the make tool from Apple is not the right one. Thanks for any tips! Cheers, Tobias http://www.superflexible.com ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal
[fpc-pascal] WideUpperCase on Mac OS X / Intel - Runtime error 215
Hello, apparently the WideUpperCase function does not work, what can I do? I get a runtime error 215 when I call it. I am using fpc-2.2.0 with Lazarus. Kind Regards, Tobias Giesen ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal