Forum > FPC development

Recompile changed FPC RTL unit

(1/2) > >>

Ondrej Pokorny:
I am using FPC + Lazarus trunk. I made some patches to the RTL units (I sent them as a bug report as well).

How do I recompile RTL sources quickly?

For example, I modify the classes.pp file and I want to recompile it. How to do it quickly? For now I used to recompile the whole FPC compiler with make (which worked) but this needs a lot of time.

Jonas Maebe:
The problem is that if you modify the classes unit, you also have to recompile all units under packages that depend on the classes unit. So doing this kind of thing selectively very easily leads to unusable unit trees.

Note that you can significantly speed up the FPC source tree compilation by adding FPMAKEOPT="-T x" (with x = the number of cpu cores you have) to the make command line. You can also add NOWPOCYCLE=1 to reduce the number of times the compiler itself gets recompiled.

Leledumbo:
Do make inside RTL folder

Ondrej Pokorny:

--- Quote from: Leledumbo on March 09, 2015, 05:36:29 pm ---Do make inside RTL folder

--- End quote ---

This looks very promising. Although I am not really successful.
My source trunk directory: p:\software\FPC_trunk
The target directory: p:\software\FPC_trunk_exp

For the full FPC build, I use this batch script (started from p:\software) that works just fine:

--- Code: ---@echo on
set mypath=p:\software\FPC_trunk_exp
set mybinutils=p:\software\Lazarus\fpc\2.6.4\bin\i386-win32
cd FPC_trunk
p:\software\Lazarus\fpc\2.6.4\bin\i386-win32\make clean all OPT="-gl -O-"
p:\software\Lazarus\fpc\2.6.4\bin\i386-win32\make install INSTALL_PREFIX=%mypath% PP=%mybinutils%\ppc386.exe
cd ..
--- End code ---

For the RTL build, I came up with such script (also started from p:\software):

--- Code: ---@echo on
set mypath=p:\software\FPC_trunk_exp
set mybinutils=p:\software\FPC_trunk_exp\bin\i386-win32
cd FPC_trunk\rtl
p:\software\Lazarus\fpc\2.6.4\bin\i386-win32\make clean all OPT="-gl -O-"
p:\software\Lazarus\fpc\2.6.4\bin\i386-win32\make install INSTALL_PREFIX=%mypath% PP=%mybinutils%\ppc386.exe
cd ..\..
--- End code ---

It does produce .o and .ppu files but the Lazarus compiler doesn't seem to notice that (breakpoints at the old places, running old code) - what I am doing wrong? (The full build works fine.)

Jonas Maebe:

--- Quote from: ondrejpokorny on March 10, 2015, 12:21:15 am ---
--- Quote from: Leledumbo on March 09, 2015, 05:36:29 pm ---Do make inside RTL folder

--- End quote ---

This looks very promising. Although I am not really successful.

--- End quote ---

Please don't do that. And if you start doing that anyway, never report any bugs before performing a complete make and install (like you have been doing until now) and reproducing the problem that way.

Navigation

[0] Message Index

[#] Next page

Go to full version