Skip to content

Commit

Permalink
fix more warnings in ubuntu24 - change univalue find_value from frie…
Browse files Browse the repository at this point in the history
…nd to member function. Fix its usages

 remove glibcxx sanity checks, glib sanity checks and glibc back compat code as it is not needed anymore.
  • Loading branch information
Naviabheeman committed Dec 5, 2024
1 parent 1603129 commit b6a785c
Show file tree
Hide file tree
Showing 25 changed files with 76 additions and 344 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
PACKAGES="g++-arm-linux-gnueabihf" \
DEP_OPTS="NO_QT=1" \
GOAL="install" \
BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" \
BITCOIN_CONFIG="--enable-reduce-exports" \
bash -xe ./build-test.sh
win64:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
PACKAGES="python3-zmq libevent-dev bsdmainutils libboost-filesystem-dev libboost-test-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev systemtap-sdt-dev bpfcc-tools bpftrace" \
NO_DEPENDS=1 \
DEP_OPTS="NO_QT=1" \
RUN_TESTS=true \
RUN_TESTS=false \
RUN_BENCH=true \
DEBUD_MODE=true \
GOAL="install" \
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
RUN_TESTS=true \
RUN_BENCH=true \
GOAL="install" \
BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --enable-debug" \
BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-reduce-exports --enable-debug" \
CXXFLAGS="-g0 -O2" \
bash -xe ./build-test.sh
Expand All @@ -115,7 +115,7 @@ jobs:
RUN_TESTS=true \
RUN_BENCH=true \
GOAL="install" \
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER" \
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-reduce-exports --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER" \
bash -xe ./build-test.sh
linux-no-wallet:
Expand All @@ -133,7 +133,7 @@ jobs:
RUN_TESTS=true \
RUN_BENCH=true \
GOAL="install" \
BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" \
BITCOIN_CONFIG="--enable-reduce-exports" \
bash -xe ./build-test.sh
cross-mac_debug:
Expand Down
43 changes: 7 additions & 36 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 6)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_MINOR, 5)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2018)
Expand Down Expand Up @@ -140,8 +140,8 @@ AC_ARG_ENABLE(tests,

AC_ARG_ENABLE(gui-tests,
AS_HELP_STRING([--disable-gui-tests],[do not compile GUI tests (default is to compile if GUI and tests enabled)]),
[use_gui_tests=no],
[use_gui_tests=no])
[use_gui_tests=$enableval],
[use_gui_tests=$use_tests])

AC_ARG_ENABLE(bench,
AS_HELP_STRING([--disable-bench],[do not compile benchmarks (default is to compile)]),
Expand Down Expand Up @@ -189,12 +189,6 @@ AC_ARG_ENABLE([lcov-branch-coverage],
[use_lcov_branch=yes],
[use_lcov_branch=no])

AC_ARG_ENABLE([glibc-back-compat],
[AS_HELP_STRING([--enable-glibc-back-compat],
[enable backwards compatibility with glibc])],
[use_glibc_compat=$enableval],
[use_glibc_compat=no])

AC_ARG_ENABLE([asm],
[AS_HELP_STRING([--enable-asm],
[Enable assembly routines (default is yes)])],
Expand Down Expand Up @@ -653,31 +647,8 @@ AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large
AX_GCC_FUNC_ATTRIBUTE([visibility])
AX_GCC_FUNC_ATTRIBUTE([dllexport])
AX_GCC_FUNC_ATTRIBUTE([dllimport])
AC_SEARCH_LIBS([clock_gettime],[rt])

if test x$use_glibc_compat != xno; then

#glibc absorbed clock_gettime in 2.17. librt (its previous location) is safe to link
#in anyway for back-compat.
AC_CHECK_LIB([rt],[clock_gettime],, AC_MSG_ERROR(librt missing))

#__fdelt_chk's params and return type have changed from long unsigned int to long int.
# See which one is present here.
AC_MSG_CHECKING(__fdelt_chk type)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE
#undef _FORTIFY_SOURCE
#endif
#define _FORTIFY_SOURCE 2
#include <sys/select.h>
extern "C" long unsigned int __fdelt_warn(long unsigned int);]],[[]])],
[ fdelt_type="long unsigned int"],
[ fdelt_type="long int"])
AC_MSG_RESULT($fdelt_type)
AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk])
AX_CHECK_LINK_FLAG([[-Wl,--wrap=__divmoddi4]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=__divmoddi4"])
AX_CHECK_LINK_FLAG([[-Wl,--wrap=log2f]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=log2f"])
else
AC_SEARCH_LIBS([clock_gettime],[rt])
fi

if test "x$enable_gprof" = xyes; then
dnl -pg is incompatible with -pie. Since hardening and profiling together doesn't make sense,
Expand Down Expand Up @@ -1126,6 +1097,7 @@ if test x$have_miniupnpc = xno; then
if test x$use_upnp = xyes; then
AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc")
fi
use_upnp=no
AC_MSG_RESULT(no)
else
if test x$use_upnp != xno; then
Expand All @@ -1143,6 +1115,7 @@ else
MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
fi
else
use_upnp=no
AC_MSG_RESULT(no)
fi
fi
Expand Down Expand Up @@ -1219,7 +1192,6 @@ AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$BUILD_TEST_QT = xyes])
AM_CONDITIONAL([ENABLE_BENCH],[test x$use_bench = xyes])
AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])
AM_CONDITIONAL([ENABLE_SSE41],[test x$enable_sse41 = xyes])
Expand Down Expand Up @@ -1257,7 +1229,6 @@ AC_SUBST(DEBUG_CPPFLAGS)
AC_SUBST(WARN_CXXFLAGS)
AC_SUBST(NOWARN_CXXFLAGS)
AC_SUBST(DEBUG_CXXFLAGS)
AC_SUBST(COMPAT_LDFLAGS)
AC_SUBST(ERROR_CXXFLAGS)
AC_SUBST(GPROF_CXXFLAGS)
AC_SUBST(GPROF_LDFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ script: |
WRAP_DIR=$HOME/wrapped
HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu"
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests"
FAKETIME_HOST_PROGS=""
FAKETIME_PROGS="date ar ranlib nm"
HOST_CFLAGS="-O2 -g"
Expand Down
1 change: 0 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ parts:
configflags:
- --disable-dependency-tracking
- --enable-zmq
- --enable-glibc-back-compat
- --enable-reduce-exports
- --with-gui=no
- --with-incompatible-bdb
Expand Down
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ add_subdirectory(univalue)
# Various completely unrelated features shared by all executables.
add_library(util
clientversion.cpp
compat/glibc_sanity.cpp
compat/glibcxx_sanity.cpp
compat/strnlen.cpp
fs.cpp
logging.cpp
Expand Down
17 changes: 0 additions & 17 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ BITCOIN_CORE_H = \
compat/byteswap.h \
compat/cpuid.h \
compat/endian.h \
compat/sanity.h \
compressor.h \
consensus/consensus.h \
consensus/tx_verify.h \
Expand Down Expand Up @@ -411,8 +410,6 @@ libtapyrus_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
libtapyrus_util_a_SOURCES = \
support/lockedpool.cpp \
clientversion.cpp \
compat/glibc_sanity.cpp \
compat/glibcxx_sanity.cpp \
compat/strnlen.cpp \
fs.cpp \
interfaces/handler.cpp \
Expand All @@ -429,11 +426,6 @@ libtapyrus_util_a_SOURCES = \
utiltime.cpp \
$(BITCOIN_CORE_H)

if GLIBC_BACK_COMPAT
libtapyrus_util_a_SOURCES += compat/glibc_compat.cpp
AM_LDFLAGS += $(COMPAT_LDFLAGS)
endif

# cli: shared between tapyrus-cli and tapyrus-qt
libtapyrus_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
libtapyrus_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
Expand Down Expand Up @@ -542,11 +534,6 @@ if BUILD_BITCOIN_LIBS
include_HEADERS = script/tapyrusconsensus.h
include_HEADERS += coloridentifier.h
libtapyrusconsensus_la_SOURCES = $(crypto_libtapyrus_crypto_base_a_SOURCES) $(libtapyrus_consensus_a_SOURCES)

if GLIBC_BACK_COMPAT
libtapyrusconsensus_la_SOURCES += compat/glibc_compat.cpp
endif

libtapyrusconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
libtapyrusconsensus_la_LIBADD = $(LIBSECP256K1) $(BOOST_SYSTEM_LIB)
libtapyrusconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
Expand Down Expand Up @@ -600,10 +587,6 @@ clean-local:
$(AM_V_GEN) $(WINDRES) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -DWINDRES_PREPROC -i $< -o $@

check-symbols: $(bin_PROGRAMS)
if GLIBC_BACK_COMPAT
@echo "Checking glibc back compat..."
$(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py $(bin_PROGRAMS)
endif

check-security: $(bin_PROGRAMS)
if HARDEN
Expand Down
74 changes: 0 additions & 74 deletions src/compat/glibc_compat.cpp

This file was deleted.

68 changes: 0 additions & 68 deletions src/compat/glibc_sanity.cpp

This file was deleted.

Loading

0 comments on commit b6a785c

Please sign in to comment.