Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/1900 remove debug symbols release #2072

Open
wants to merge 5 commits into
base: v4.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
export CC=gcc-11
export CXX=g++-11
export TARGET=all
export CMAKE_BUILD_TYPE=RelWithDebInfo
export CMAKE_BUILD_TYPE=Release
cd deps
./clean.sh
rm -f ./libwebsockets-from-git.tar.gz
Expand All @@ -118,7 +118,7 @@ jobs:
make skaled -j$(nproc)
#echo "Ensure release mode skaled does not have any debug markers"
cp skaled/skaled skaled/skaled-debug
strip skaled/skaled
strip --strip-all skaled/skaled
cd ..
- name: Configure historic state build
run: |
Expand All @@ -141,7 +141,7 @@ jobs:
make skaled -j$(nproc)
#echo "Ensure release mode skaled does not have any debug markers"
cp skaled/skaled skaled/skaled-debug
strip skaled/skaled
strip --strip-all skaled/skaled
cd ..
- name: Build and publish container
run: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/setup-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ jobs:
export CMAKE_BUILD_TYPE=$BUILD_TYPE
cd build
make skaled -j$(nproc)
if [[ "$BUILD_TYPE" = "Release" ]]; then
debug_wc=$(objdump -h skaled/skaled | grep -i debug | wc -l)
sym_wc=$(readelf -s skaled/skaled | wc -l)
if (( debug_wc != 0 || sym_wc > 10000 )); then
exit 1
fi
fi
cd ..
- name: Build and publish container
env:
Expand Down
8 changes: 2 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ list( APPEND CMAKE_MODULE_PATH ${DEPS_INSTALL_ROOT}/lib/cmake )

link_directories( ${CMAKE_BINARY_DIR}/deps/lib ) # HACK for not-found -lff in testeth

if( NOT CMAKE_BUILD_TYPE MATCHES "Debug" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -rdynamic" )
endif()

option( SKALED_PROFILING "Build for profiling" OFF )
if( SKALED_PROFILING )
set( CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -pg" )
Expand All @@ -32,6 +26,8 @@ if( SKALED_PROFILING )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg" )
endif()

set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s")

if( CMAKE_BUILD_TYPE STREQUAL "Release" )
set( CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -O3" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3" )
Expand Down
2 changes: 1 addition & 1 deletion cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA

set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -DNDEBUG -g")

option(USE_LD_GOLD "Use GNU gold linker" ON)
if (USE_LD_GOLD)
Expand Down
25 changes: 12 additions & 13 deletions deps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1166,11 +1166,10 @@ then
# eval ./autogen.sh
# eval ./configure "${CONF_CROSSCOMPILING_OPTS_GENERIC}" --enable-static --disable-shared --with-pic --prefix="$INSTALL_ROOT" "${CONF_DEBUG_OPTIONS}"
#--with-sysroot=="$INSTALL_ROOT"
mkdir build && cd build
eval "$CMAKE" "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" \
-DBUILD_SHARED_LIBS=OFF -DLIBUV_BUILD_SHARED=OFF\
..
cd ../..
mkdir -p build && cd build
eval "$CMAKE" "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" \
-DBUILD_SHARED_LIBS=OFF -DLIBUV_BUILD_SHARED=OFF ..
cd ../..
fi
echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}"
cd libuv/build
Expand Down Expand Up @@ -1401,11 +1400,11 @@ then
echo -e "${COLOR_INFO}configuring and building it${COLOR_DOTS}...${COLOR_RESET}"
eval ./bootstrap.sh --prefix="$INSTALL_ROOT" --with-libraries=atomic,context,filesystem,program_options,regex,system,thread,date_time,iostreams

if [ "$DEBUG" = "1" ]; then
variant=debug
else
variant=release
fi
if [ "$DEBUG" = "1" ]; then
variant=debug
else
variant=release
fi

if [ ${ARCH} = "arm" ]
then
Expand Down Expand Up @@ -2099,7 +2098,7 @@ then
eval tar -xzf folly-from-git.tar.gz
fi
echo -e "${COLOR_INFO}fixing it${COLOR_DOTS}...${COLOR_RESET}"
sed -i 's/list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES})/list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES} lzma)/' ./folly/CMake/folly-deps.cmake
sed -i 's/list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES})/list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES} lzma)/' ./folly/CMake/folly-deps.cmake
sed -i 's/google::InstallFailureFunction(abort);/google::InstallFailureFunction( reinterpret_cast < google::logging_fail_func_t > ( abort ) );/g' ./folly/folly/init/Init.cpp
echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}"
cd folly
Expand All @@ -2123,8 +2122,8 @@ then
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}"
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}" install
if [ "$DEBUG" = "0" ]; then
eval strip --strip-debug "${INSTALL_ROOT}"/lib/libfolly*.a
fi
eval strip --strip-debug "${INSTALL_ROOT}"/lib/libfolly*.a
fi
cd "$SOURCES_ROOT"
else
echo -e "${COLOR_SUCCESS}SKIPPED${COLOR_RESET}"
Expand Down
Loading