|
Compiling for a single driver
#389690 - 01/25/21 04:03 AM
|
|
|
Hi there... Im trying to update a single driver. I have removed all the other drivers from the .lst file, but when I compile, I still end up with a 138M hbmame64.exe... I thought there was an easy way to limit the build so it could compile and link pretty quick?
I tried with SOURCES= in the make command to a single driver, but my hbmame64.exe was still 138M.
make PTR64=1 TARGET=hbmame SOURCES=/src/hbmame/drivers/mhavoc.cpp
thanks!
|
|
|
|
Re: Compiling for a single driver
[Re: mhavoc]
#389717 - 01/27/21 09:29 AM
|
|
|
The executable will stay that size. MAME's framework is big, it's not only the drivers. What you can do is speed up the linking using lld as a linker, by doing set ARCHOPTS=-fuse-ld=lld before launching make. Remember to add REGENIE=1 if it isn't a clean compile.
Also, if you are using SOURCES you don't need to remove anything from the .lst files.
|
.
|
|
|
Re: Compiling for a single driver
[Re: mhavoc]
#389727 - 01/27/21 04:31 PM
|
|
|
> Hi there... Im trying to update a single driver. I have removed all the other drivers > from the .lst file, but when I compile, I still end up with a 138M hbmame64.exe... I > thought there was an easy way to limit the build so it could compile and link pretty > quick? > > I tried with SOURCES= in the make command to a single driver, but my hbmame64.exe was > still 138M. > > make PTR64=1 TARGET=hbmame SOURCES=/src/hbmame/drivers/mhavoc.cpp > > thanks!
The main problem with linking is not MAME, or the number of drivers, but the default linker being absolute awful. Even on a single driver build, from an SSD, it can take 8 minutes to link here for every minor change.
If you type set ARCHOPTS=-fuse-ld=lld before doing the initial 'make' that builds the scripts, then you use the alternate linker, which links, basically instantaneously.
Quite how / why the default linker is so bad I don't know.
There are downsides to this, I believe it was mentioned it doesn't work properly with the debug symbols and such (haven't tested, as I haven't needed to recently) but for day to day MAME development it's basically essential.
|
|
|
|
Re: Compiling for a single driver
[Re: Osso1]
#389744 - 01/28/21 05:23 PM
|
|
|
oh yeah! that made all the difference in the world... my linker was taking about 20 minutes so making single line tweaks was super painful.
I tried restoring the full driver list and included SOURCES=src/hbmame/drivers/mhavoc.cpp but I had a weird genie.lua error that I couldn't get past (not using REGENIE on that first build). So, I just trimmed the driver list down.
End result, links now in about 15 seconds. :-) Thank you both!!
|
|
|