Recompile FPC units in Lazarus lazarus / 64-FPC development ---------------------------------------------------------------------- BeanzMaster · 2018-06-27 13:47 Hi,  it is possible to include (or force FPC's units) to be recompiled) in Lazarus from command "clean and compile" or another. I'm search where is a bug (see : http://forum.lazarus.freepascal.org/i ndex.php/topic,41674.msg289709.html#msg289709)  is. I not sure  where it is exactly and i want to make some test before report it in bugtracker. Thanks in advance ---------------------------------------------------------------------- wp · 2018-06-27 15:43 This is a bit more difficult than recompiling LCL units, and I am not sure if I myself am doing it in the most efficient way. First of all, get yourself fpc trunk because your issue may already have been fixed, don't waste your time on solved issues, and fpc developers usually only accept patches for the current version. Then get yourself fpcupdeluxe and install trunk versions of fpc and Lazarus. Before doing this click "Setup+" and enter "-gl" ('l" is lowercase L) in the option boxes for fpc and Lazarus - this means that both programs will be built for the debugger. This installation does not interfere with the standard installation. When fpcupdeluxe is finished (it puts an icon on the desktop, after some time...) you are ready to go. ---------------------------------------------------------------------- BeanzMaster · 2018-06-27 21:57 Quote from: wp on June 27, 2018, 05:43:55 pmThis is a bit more difficult than recompiling LCL units, and I am not sure if I myself am doing it in the most efficient way. First of all, get yourself fpc trunk because your issue may already have been fixed, don't waste your time on solved issues, and fpc developers usually only accept patches for the current version. Same bug in Lazarus 1.9 FPC 3.1.1 revision 58201 Quote from: wp on June 27, 2018, 05:43:55 pmThen get yourself fpcupdeluxe and install trunk versions of fpc and Lazarus. Before doing this click "Setup+" and enter "-gl" ('l" is lowercase L) in the option boxes for fpc and Lazarus - this means that both programs will be built for the debugger. This installation does not interfere with the standard installation. When fpcupdeluxe is finished (it puts an icon on the desktop, after some time...) you are ready to go. I say perfectly how work FPCUpDeluxe i've made a tutorial on it. Thank for trick for Setup+ and -gl parameters. I don't know this. I'll try thanks ---------------------------------------------------------------------- BeanzMaster · 2018-06-27 22:54 Ok i've test but not worked if i make some change in FPCanvas.inc for example how force this unit to be recompile. At this time i can put whatever  in fpc source files they are never recompiled Do I have to go through Make in the command line every time? How to ? Note i have also delphi installed on my pc ---------------------------------------------------------------------- PascalDragon · 2018-06-28 20:32 Yes, you need to rebuild so that all dependencies are updated as well. ---------------------------------------------------------------------- BeanzMaster · 2018-06-28 21:51 Hi Thanks PascalDragon I'll try ---------------------------------------------------------------------- wp · 2018-06-28 22:29 Rebuilding the entire fpc is a pain! This is what Michl once told me, and it is great:You need a test project - don't do this with a "real" project if possible.Then add the fpc unit which you want to debug to the project. Confirm to add the path to the unit path.Try to compile.It will fail because other units are not found.Look at the error message to learn which unit or include file is missing.If you don't know where the unit is look at the uses list of the unit in which the missing unit is reported. CTRL-Click on the unit name to open it from its original place. Move the mouse over the corresponding tab of the source editor. A hint window will pop up showing the path to the missing unit.Add it to the project, too.Sometimes there is a version conflict or duplicate unit message. In this case do a "Run" > "Clean up and build".Repeat, i.e. compile and add the missing unit to the project. Always accept to add the path.In the end you will be able to compile your test project; all compiled files will go into your project's lib folder, i.e. you should not interfere with the installation (don't kill me if it does...)Now go to the project options, "Additions and overrides" and add a Custom Option "-gw2". This is definitely good for Windows, maybe you have to experiment in case of other OSs (you find the -g* options on page "Debugger").compile. This will rebuild the project and all required units with dwarf2 debugger information (or what you selected).Debug your problem, change the fpc unit, and the changed unit will be used in your project. Test your change etc -- standard debugging...Apart from the setup phase during which you must add all needed units this is like debugging and testing any other project.Quote from: BeanzMaster on June 27, 2018, 11:57:13 pmSame bug in Lazarus 1.9 FPC 3.1.1 revision 58201 Still I urge you to debug with with FPC 3.1.1. Because if you can fix the issue and submit a patch the developers can more easily apply it. ---------------------------------------------------------------------- Pascal · 2018-06-29 04:20 Quote from: BeanzMaster on June 27, 2018, 11:57:13 pmThank for trick for Setup+ and -gl parameters. I don't know this. You should also use "-O-". This prevents strange behaviour when debugging fpc units due to optimizations. ---------------------------------------------------------------------- balazsszekely · 2018-06-29 07:43 In order to debug fpc units you must recompile fpc with the following options: "-g -gl -O-". To avoid complication just use Fpcupdeluxe(very useful application), all you have to do is to add "-g -gl -O-" to Advanced settings/FPC options, see attached image for more details. This is why I always keep a separate FPC/Lazarus install for debugging. When necessary I do a quick update, it takes only a few minutes. ---------------------------------------------------------------------- BeanzMaster · 2018-06-29 21:30 Hi to all @getmem : Thanks but not working with last trunk and last fpcudeluxe 1.6.1e returns errors : Quotefpcupdeluxe: info: FPC builder: Detected source version FPC: 3.1.1 fpcupdeluxe: info: FPC builder: Using FPC bootstrap compiler with version: 3.0.4 fpcupdeluxe: Start of compile error summary. genmath.inc(2036,12) Error: Incompatible types: got "Single" expected "TExtended80Rec.Array[0..9] Of Byte" fpcupdeluxe: Start of compile error summary. system.pp(665) Fatal: There were 1 errors compiling module, stopping genmath.inc(2036,12) Error: Incompatible types: got "Single" expected "TExtended80Rec.Array[0..9] Of Byte" fpcupdeluxe: Start of compile error summary. Fatal: Compilation aborted system.pp(665) Fatal: There were 1 errors compiling module, stopping fpcupdeluxe: Start of compile error summary. fpcupdeluxe: ERROR: FPCNativeInstaller (BuildModuleCustom: FPC): Error running make for FPC failed with exit code 2Same issue with "-g -gl", "-gl -O-", only "-gl" and also with nothing It's seems the problem come from the Last Changed Date: 2018-06-29 22:51:32 +0200 (ven., 29 juin 2018) So i'm just waiting a bit @wp : I'll try with another installed trunk version i have ---------------------------------------------------------------------- balazsszekely · 2018-06-29 21:48 Quote@getmem : Thanks but not working with last trunk and last fpcudeluxe 1.6.1e The error has nothing to do with: "-g -gl -O-". You should wait for the next fix. Such issues are normal for a dynamical system as FPC trunk. ---------------------------------------------------------------------- PascalDragon · 2018-06-30 08:49 Quote from: wp on June 29, 2018, 12:29:23 amRebuilding the entire fpc is a pain! I don't know about you, but for me it's a simple Code: [Select]make clean all install FPMAKEOPT="-T " -j INSTALL_PREFIX=/whereever/I/put/my/trunk/install ---------------------------------------------------------------------- wp · 2018-06-30 09:15 How long does it take? ---------------------------------------------------------------------- BrunoK · 2018-06-30 12:42 The content of message Posted by: wp « on: June 29, 2018, 12:29:23 am is very good. === Windows only === For myself, in my FPC D:\fpc-laz-asus\FPC directory I have the following substructure : D:\fpc-laz-asus\FPC\3_0_4               : Complete 3_0_4 source and -O2 units D:\fpc-laz-asus\FPC\3_0_4-dbg-bak : Only units I build for debugging -O1 + some debug switches D:\fpc-laz-asus\FPC\3_0_4-dbg        : Only units that I copied from D:\fpc-laz-asus\FPC\3_0_4-dbg-bak that interest me with the correct substructure. They have to be deleted from this directory when in non debug mode in fpc.cfg used by fpc.exe I have AFTER the # searchpath for units and other system dependent things etc... block 2 additional lines : # DEBUG searchpath for debug units -FuD:\fpc-laz-asus\FPC\3_0_4-dbg\units\$fpctarget/* The fpc compiler then considers that additional -FuD as overrides, for .o and .ppu's in it, BEFORE the normal -O2 in D:\fpc-laz- asus\FPC\3_0_4\units are considered. See attachment .txt file containing the commands I copy to the command prompt for building the FPC rtl directory. I more or less frequently also build debug version for \packages\fcl- db with usable results. Switches that give me reasonable success for debugging are : FPC : OPT="-O1 -gw2 -godwarfsets -gl" + in lazarus : -O1  -gw2 -godwarfsets -gl option -OoREGVAR improves speed but makes debugging slightly more difficult ... Note 1 : Sometimes I manage to make a real mess ... that takes hours to clean up. Dont forget backups ! Note 2 : If you have made modifications to an FPC source within Lazarus editor, don't forget to save them before redoing a make, I have been catched by that a few times. ---------------------------------------------------------------------- BeanzMaster · 2018-06-30 13:30 Thanks Bunok, i'll test to. Those take me a little time to see what the best way for me