Hi Basil, Yes, I have seen this as well. After compiling I always calculate a CRC over the entire binary, and this is not identical over compile cycles.
It has been some time since I investigated this, but Windows 10 (and 11) contain some memory protection features that are not present in Windows 7: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/overview-of-threat-mitigations-in-windows-10#table-2 These should not influence "correct" programs, but I suspect SDCC somewhere uses uninitialized memory and/or pointers. At the time I did not dig further in the problem, but if it helps I can check my notes again and recreate a test case. Eric > -----Original Message----- > From: Basil Hussain <[email protected]> > Sent: dinsdag 4 november 2025 00:13 > To: SDCC User Mailing List <[email protected]> > Subject: [Sdcc-user] Potential issues with non-deterministic compilation of > 8051 > code on W10/11? > > Hi all, > > This is not a problem I am personally experiencing, but I am writing to see > if any > other SDCC users/devs have any opinion on what is going on here. > > On the EEVblog forums, there is thread recently started by a user who claims > that > ever since he moved his SDCC development environment from Windows 7 to > Windows 10, his 8051 code base (for an EFM8) no longer compiles > deterministically, which apparently causes the resultant firmware image size > to > be too large. He claims that when running the same compilation multiple times > back-to-back on W10, the code size varies every time, but on W7 it does not. > > Link to thread: > https://www.eevblog.com/forum/microcontrollers/w10-sdcc-4-2-0-generates- > unpredictable-results-but-with-w7-all-is-fine/ > > Details about the situation are not forthcoming, but some of the apparent > facts > seem to be: > > - Same SDCC binaries (of v4.2.0) are being run on W7 and W10. > - Behaviour doesn't change if SDCC executables are set to run in W7 > compatibility > mode. > - Code size inconsistency appears to be due to differing register allocations > each > time, which causes different code to be generated. > > Said user currently doesn't want to consider this might be a problem with > SDCC, > try the latest SDCC release, nor engage in any of the support avenues for SDCC > (i.e. mailing lists or SF tickets), and seems to be spiralling off into wild > theories > alleging flawed memory allocation processes on Windows 10/11, and that now all > his software is "untrustworthy". :-/ > > Anyone with any thoughts on this? Perhaps a latent bug in SDCC revealed by a > subtle difference in behaviour of W10/11 versus W7? I know Philipp has > occasionally posted on EEVblog forums in the past, so perhaps he could engage > there? > > Regards, > Basil Hussain > > > _______________________________________________ > Sdcc-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/sdcc-user _______________________________________________ Sdcc-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sdcc-user
