cancel
Showing results for 
Search instead for 
Did you mean: 

Didn't get the same binaries with the same compiler

DrMaxoudeBon
Associate

Hi everyone,

I'm currently trying to build my project on two differents computers. 
My computers have not the same STM32CubeIDE: 1.13.1 and 1.11.2. 
Compilers are the same, I ckecked it with version 10.3-2021-10. 
Flags and options of compilation are the same (verified one by one). 

Someone can tell me if I need to update my IDE ? 

Thank you for your answers. 

Have a nice day. 

Maxime

7 REPLIES 7

Binaries or ELF object files?

Lot of moving parts here, potentially code and path differences. Going to be hard to generate identical binaries without a much more controlled environment. 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi @Tesla DeLorean 
Thanks for your response. 

I was talking about .hex files generated. 

When camparing bits to bits, the two .hex generated in two differents IDE are not the same. 
Still looking for a solution. 

As I said, I really paid attention to compilation flags and options. 

Source code is the same, I can ensure it by my git repository. 

Bob S
Principal

> As I said, I really paid attention to compilation flags and options.
> Source code is the same, I can ensure it by my git repository.

The Eclipse project file (.cproject, perhaps .project as well) should also be in your git repo, as that is where the build options are stored.  That way you KNOW they are the same.  Not sure from your description whether you have done that.

Are the hex files the same size, just differing in some (or lots) of bytes?  Or are they different sizes?  You can use the first difference in the hex file along with the 2 map files and/or list files ("MCU Post build outputs", "generate list file") to see what part of the code is being handled differently.

Are the linker files the same (STM32xxxxx.ld)?  Again, these should be part of your git repo, but just checking.

Are both IDEs build the same build config (i.e. "Debug" vs. "Release")?

GLASS
Senior

With 1.13.0 ans 1.13.1 there are bugs in libc/nanolib wirh thread safe...

If lib are not the same, for sure the resultant binary is not the same...

@GLASS libc (newlib/nano) is part of the toolchain, it comes together with the compiler. If the OP selected same toolchain on both computers, they  have the same newlib.

Diff/Delta the .MAP files would be a way to understand where/how they diverge. Ordering of objects might also be an issue due to the linear / single-pass methods used in the linker.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Piranha
Chief II

And does a rebuild on the same computer always give the same binary? Maybe the code just uses the __DATE__ and/or __TIME__ macros somewhere.

https://en.cppreference.com/w/c/preprocessor/replace