Skip to content

Commit

Permalink
NASM use default debug format (#1747)
Browse files Browse the repository at this point in the history
### Issues
* Addresses: aws/aws-lc-rs#470

### Description of changes: 
* NASM object files were previously setup to always contain debug
information, including source file paths.
* `-gcv8` produces the ["CodeView 8"
format](https://www.nasm.us/doc/nasmdoc8.html#section-8.5.3).
* Simply using `-g` will produce the [default debug
format](https://www.nasm.us/doc/nasmdoc2.html#section-2.1.14) for the
target.
* For "release" and "minsizerel" builds, inclusion of debug information
is not desirable.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.

---------

Co-authored-by: dkostic <[email protected]>
  • Loading branch information
justsmth and dkostic authored Aug 28, 2024
1 parent 621bceb commit f0002cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ if(NOT OPENSSL_NO_ASM)
endif()
find_program(NASM_EXECUTABLE nasm)
set(CMAKE_ASM_NASM_COMPILER ${NASM_EXECUTABLE})
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -gcv8")
if("${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "relwithdebinfo" OR
"${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "debug")
# Provide debug in the default format
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -g")
endif()

# On Windows, we use the NASM output.
set(ASM_EXT asm)
Expand Down

0 comments on commit f0002cb

Please sign in to comment.