From b25c6eba4453031766c419db886ec3e9a3c2c714 Mon Sep 17 00:00:00 2001 From: chendong76 <1209756284@qq.com> Date: Tue, 11 Jan 2022 09:44:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=89=E5=85=A8=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/script/separate_debug_information.sh | 12 ++++++++++-- src/bin/pg_basebackup/Makefile | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/build/script/separate_debug_information.sh b/build/script/separate_debug_information.sh index 3f4e74c44..609c8a2e2 100644 --- a/build/script/separate_debug_information.sh +++ b/build/script/separate_debug_information.sh @@ -109,7 +109,7 @@ separate_symbol() if [ -x "$x" ]; then if [ "$x" != "install-sh" ]; then objcopy --only-keep-debug "$x" "$INSTALL_DIR/${symbol_name}.symbol" > /dev/null 2>&1 - objcopy --strip-debug "$x" "$x"_release + objcopy --strip-all "$x" "$x"_release rm "$x" mv "$x"_release "$x" objcopy --add-gnu-debuglink="$INSTALL_DIR/${symbol_name}.symbol" "$x" @@ -127,7 +127,7 @@ separate_symbol() fi fi objcopy --only-keep-debug "$x" "$INSTALL_DIR/${symbol_name}.symbol" > /dev/null 2>&1 - objcopy --strip-debug "$x" "$x"_release + objcopy --strip-all "$x" "$x"_release rm "$x" mv "$x"_release "$x" objcopy --add-gnu-debuglink="$INSTALL_DIR/${symbol_name}.symbol" "$x" @@ -141,6 +141,14 @@ separate_symbol() objcopy --add-gnu-debuglink="$INSTALL_DIR/${symbol_name}.symbol" "$x" chmod 755 "$INSTALL_DIR/${symbol_name}.symbol" mv $INSTALL_DIR/${symbol_name}.symbol $CPTODEST + elif [[ "$x" =~ [0-9]$ ]]; then + objcopy --only-keep-debug "$x" "$INSTALL_DIR/${symbol_name}.symbol" > /dev/null 2>&1 + objcopy --strip-all "$x" "$x"_release + rm "$x" + mv "$x"_release "$x" + objcopy --add-gnu-debuglink="$INSTALL_DIR/${symbol_name}.symbol" "$x" + chmod 755 "$INSTALL_DIR/${symbol_name}.symbol" + mv $INSTALL_DIR/${symbol_name}.symbol $CPTODEST fi elif [ -d "$x" ];then separate_symbol "$x" diff --git a/src/bin/pg_basebackup/Makefile b/src/bin/pg_basebackup/Makefile index 3adf90f22..e216e53eb 100644 --- a/src/bin/pg_basebackup/Makefile +++ b/src/bin/pg_basebackup/Makefile @@ -20,7 +20,7 @@ include $(top_builddir)/src/Makefile.global override CPPFLAGS := -I$(libpq_srcdir) -I$(ZLIB_INCLUDE_PATH) $(CPPFLAGS) -DHAVE_LIBZ -fPIC -fPIE -DFRONTEND -I$(top_builddir)/src/bin/pg_rewind -I$(top_builddir)/src/bin/pg_ctl -I$(LZ4_INCLUDE_PATH) -LDFLAGS += -L$(LZ4_LIB_PATH) +LDFLAGS += -Wl,-z,relro,-z,now -L$(LZ4_LIB_PATH) LIBS += -lgssapi_krb5_gauss -lgssrpc_gauss -lkrb5_gauss -lkrb5support_gauss -lk5crypto_gauss -lcom_err_gauss -llz4 ifneq "$(MAKECMDGOALS)" "clean"