This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2434: Release and Debug Library Build

Part Number: AM2434


Tool/software:

Hi Team,

Can you tell me the difference between the two library builds (release, and debug)?

I understand that there is a difference in release and debug project builds such as compiler optimization, pre and post processing options, but what is the difference between debug and release version of libraries, like the libraries below.

(only release versions are shown below)

ethercat_slave_bkhf_ssc.am243x_evm.r5f.ti-arm-clang.release.lib

ethercat_slave.am243x_evm.r5f.ti-arm-clang.release.lib

Best regards,

Mari Tsunoda

  • Hello Mari, 

    I'm looping in another team member who can better comment on your question. Please expect a possible delay in response.

    -Daolin

  • Tsunoda-san,

    The same difference among release and debug projects applies to library builds too. In the example project, the release build will pick the release (optimized) version of libraries and correspondingly for debug build.

    Regards,
    Aaron

  • Can you give me more detailed difference between release and debug libraries?

  • Tsunoda-san,

    Couple of differences between Release (-Os) and Debug build (-O0):

    Debug (-O0):

    • The compiler does not perform any optimizations, and the generated code is essentially a direct translation of the source code. This means that the code is not optimized for performance, size, or any other criteria.
    • The resulting binary is typically larger in size and may run slower due to the lack of optimization.
    • However, this mode is useful for debugging purposes, as the code is easier to step through and understand.
    • The compiler will also include debugging information, such as symbol tables and line numbers, which can be useful for debugging.

    Release (-Os):

    • The compiler optimizes the code for minimal size, which results in smaller binaries and better performance.
    • This mode is useful when code size is a critical factor, such as when working with limited memory.
    • The compiler will perform optimizations using techniques such as removing unnecessary code and data, using smaller instruction sequences, eliminating redundant code.
    • Debugging release mode builds will be difficult as you won't be able to step through the code sequentially as the overall flow will be jumbled up.

    I hope this answers your query.

    Regards,
    Aaron