|
"official" MAME exe compiler settings?
#296110 - 09/19/12 06:17 AM
|
|
|
I just built mame 0.147 from the source.
I used the latest 64-bit compiler tools, and I just ran make on the stock makefile with no changes.
The resulting mame64.exe doesn't match the "official" 64-bit exe from the mamedev site.
The size is different...
Official 81,700,864 bytes Compiled 83,250,688 bytes
So it looks like some command line switches must be used with make on the official builds. Does anyone know what they are?
|
GroovyMAME support forum on BYOAC
|
|
B2K24 |
MAME @ 15 kHz Sony Trinitron CRT user
|
|
|
Reged: 10/25/10
|
Posts: 2663
|
|
|
Send PM
|
|
|
Re: "official" MAME exe compiler settings?
[Re: krick]
#296113 - 09/19/12 07:32 AM
|
|
|
If you compile with make all you would see none of the applications match in size to what is packaged in mame0147b_64bit. Even chdman is a whopping 1,245 KB compared to 620 or 630 KB. It's a complete mystery too me
|
|
|
|
Re: "official" MAME exe compiler settings?
[Re: B2K24]
#296114 - 09/19/12 07:49 AM
|
|
|
|
Tafoid |
I keep on testing.. testing.. testing... into the future!
|
|
|
Reged: 04/19/06
|
Posts: 3138
|
Loc: USA
|
|
Send PM
|
|
|
Re: "official" MAME exe compiler settings?
[Re: krick]
#296122 - 09/19/12 11:46 AM
|
|
|
> I don't think it can be a debug exe, but that would probably be larger. > > What about -Os ? > > That's supposed to optimize for size.
If I had to guess, the binary packages are set up with a .sym file which effects the binary size of all the .exe's made under that config. Default optimization should be untouched (-o3).
|
|
|
|
Re: "official" MAME exe compiler settings?
[Re: krick]
#296131 - 09/19/12 04:08 PM
|
|
|
> I just built mame 0.147 from the source. > > I used the latest 64-bit compiler tools, and I just ran make on the stock makefile > with no changes. > > The resulting mame64.exe doesn't match the "official" 64-bit exe from the mamedev > site. > > The size is different... > > Official 81,700,864 bytes > Compiled 83,250,688 bytes > > So it looks like some command line switches must be used with make on the official > builds. Does anyone know what they are?
I didn't look myself, but this is what I was told. I can dig more if you still can't.
set ARCHOPTS= set DEBUG= set GTK_INSTALL_ROOT= set MAP= set OPTIMIZE=3 set OSD= set PROFILER= set SYMBOLS=1 set SYMLEVEL=1 set SUFFIX=
The tools are double the size because they have the symbols in and they aren't stripped, while the mame64.exe has it's symbols in a .sym file and they are stripped from the exe.
|
|
|
R. Belmont |
Cuckoo for IGAvania
|
|
|
Reged: 09/21/03
|
Posts: 9716
|
Loc: ECV-197 The Orville
|
|
Send PM
|
|
|
Re: "official" MAME exe compiler settings?
[Re: B2K24]
#296133 - 09/19/12 06:23 PM
|
|
|
> If you compile with make all you would see none of the applications match in size to > what is packaged in mame0147b_64bit. Even chdman is a whopping 1,245 KB compared to > 620 or 630 KB. It's a complete mystery too me
Strip the exe afterwards and it'll come much closer. (Exact matches aren't possible unless you compile in the same path at the same time).
|
|
|
|
Re: "official" MAME exe compiler settings?
[Re: R. Belmont]
#296137 - 09/19/12 07:01 PM
|
|
|
> Strip the exe afterwards and it'll come much closer. (Exact matches aren't possible > unless you compile in the same path at the same time).
Compilers should be deterministic, so the actual binary output should be identical with the same compiler version and settings. The object files should be the same. Once everything's linked, the windows resource properties will be different because of timestamps, but the final exe should be the same size.
I don't see how the path figures into it. Why would it matter?
|
GroovyMAME support forum on BYOAC
|
|
R. Belmont |
Cuckoo for IGAvania
|
|
|
Reged: 09/21/03
|
Posts: 9716
|
Loc: ECV-197 The Orville
|
|
Send PM
|
|
|
Re: "official" MAME exe compiler settings?
[Re: krick]
#296141 - 09/19/12 07:42 PM
|
|
|
> > Strip the exe afterwards and it'll come much closer. (Exact matches aren't possible > > unless you compile in the same path at the same time). > > Compilers should be deterministic, so the actual binary output should be identical > with the same compiler version and settings. The object files should be the same. > Once everything's linked, the windows resource properties will be different because > of timestamps, but the final exe should be the same size.
The actual binary code and data *are* identical, assuming you use the same settings and optimize for the same processor as the official build. But modern executables include significant amounts of metadata, including the timestamp and absolute paths involved in the compile. You're unlikely to get a perfect checksum match between two compiles of the same source unless you distill all the way down to a bare binary (like DOS .COM files were).
|
|
|
|
Re: "official" MAME exe compiler settings?
[Re: R. Belmont]
#296148 - 09/19/12 08:25 PM
|
|
|
> But modern executables > include significant amounts of metadata, including the timestamp and absolute paths > involved in the compile. You're unlikely to get a perfect checksum match between two > compiles of the same source unless you distill all the way down to a bare binary > (like DOS .COM files were).
Yeah, I figured internal timestamps would be different, so the resulting checksums would obviously not match. But I didn't know they included paths in the executable. Good to know.
|
GroovyMAME support forum on BYOAC
|
|
|
Re: "official" MAME exe compiler settings?
[Re: krick]
#296278 - 09/21/12 07:22 PM
|
|
|
> Yeah, I figured internal timestamps would be different, so the resulting checksums > would obviously not match. But I didn't know they included paths in the executable. > Good to know.
I'm not sure there are for windows exe's. I don't appear to using the options I'm using for building anyway.
The main differences is going to be not using the same options or the same compiler. They'll never tie up if you compile them differently.
|
|
|
|
|
> I didn't look myself, but this is what I was told. I can dig more if you still can't. > > set ARCHOPTS= > set DEBUG= > set GTK_INSTALL_ROOT= > set MAP= > set OPTIMIZE=3 > set OSD= > set PROFILER= > set SYMBOLS=1 > set SYMLEVEL=1 > set SUFFIX= > > The tools are double the size because they have the symbols in and they aren't > stripped, while the mame64.exe has it's symbols in a .sym file and they are stripped > from the exe.
Thanks. I just built with the settings above, then I ran strip on the resulting EXE and now both are the same size. There are some binary differences but I assume they're related to timestamps or possibly uninitialized variables or arrays.
EDIT: I just rebuilt and stripped another EXE using the same settings and it also has binary differences in the same places.
[ATTACHED IMAGE - CLICK FOR FULL SIZE]
Edited by krick (09/23/12 06:58 PM)
|
GroovyMAME support forum on BYOAC
|
|