Skip to content

Commit

Permalink
Add flag -ggdb to enable debug information in Release build (#146)
Browse files Browse the repository at this point in the history
Co-authored-by: apetcher-amazon <[email protected]>
  • Loading branch information
pennyannn and apetcher-amazon authored May 10, 2024
1 parent 0581cde commit 1a3784b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions NSym/scripts/build_aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ mkdir -p build_src/aarch64
cd build_src/aarch64
export LDFLAGS="-fuse-ld=lld"
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_CXX_FLAGS="-ggdb" \
-DCMAKE_C_FLAGS="-ggdb" \
-DBUILD_LIBSSL=OFF \
-DKEEP_ASM_LOCAL_SYMBOLS=1 \
-DCMAKE_TOOLCHAIN_FILE=../../scripts/build_aarch64.cmake \
Expand Down
4 changes: 3 additions & 1 deletion SAW/scripts/aarch64/build_llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export LLVM_COMPILER=clang
export BINUTILS_TARGET_PREFIX=aarch64-linux-gnu

cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_CXX_FLAGS="-ggdb" \
-DCMAKE_C_FLAGS="-ggdb" \
-DBUILD_LIBSSL=OFF \
-DCMAKE_TOOLCHAIN_FILE=../../scripts/aarch64/build_llvm.cmake \
-DCMAKE_C_FLAGS="--target=${TARGET} -I/usr/aarch64-linux-gnu/include -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu" \
Expand All @@ -25,4 +27,4 @@ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
../../../src

NUM_CPU_THREADS=$(grep -c ^processor /proc/cpuinfo)
make -j $NUM_CPU_THREADS VERBOSE=1
make -j $NUM_CPU_THREADS
2 changes: 1 addition & 1 deletion SAW/scripts/x86_64/build_llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export CC=wllvm
export CXX=clang++
# The extern function __breakpoint__inv used in proof of ec_GFp_nistp384_point_mul_public is not defined
# Option -DCMAKE_CXX_LINK_FLAGS="-Wl,--unresolved-symbols=ignore-in-object-files" allows it
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_LIBSSL=OFF -DCMAKE_CXX_LINK_FLAGS="-Wl,--unresolved-symbols=ignore-in-object-files" ../../../src
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS="-ggdb" -DCMAKE_C_FLAGS="-ggdb" -DBUILD_LIBSSL=OFF -DCMAKE_CXX_LINK_FLAGS="-Wl,--unresolved-symbols=ignore-in-object-files" ../../../src
NUM_CPU_THREADS=$(grep -c ^processor /proc/cpuinfo)
make -j $NUM_CPU_THREADS
2 changes: 1 addition & 1 deletion SAW/scripts/x86_64/build_x86.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export CC=clang
export CXX=clang++
# The extern function __breakpoint__inv used in proof of ec_GFp_nistp384_point_mul_public is not defined
# Option -DCMAKE_CXX_LINK_FLAGS="-Wl,--unresolved-symbols=ignore-in-object-files" allows it
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_LIBSSL=OFF -DCMAKE_CXX_LINK_FLAGS="-Wl,--unresolved-symbols=ignore-in-object-files" ../../../src
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS="-ggdb" -DCMAKE_C_FLAGS="-ggdb" -DBUILD_LIBSSL=OFF -DCMAKE_CXX_LINK_FLAGS="-Wl,--unresolved-symbols=ignore-in-object-files" ../../../src
NUM_CPU_THREADS=$(grep -c ^processor /proc/cpuinfo)
make -j $NUM_CPU_THREADS

0 comments on commit 1a3784b

Please sign in to comment.