enable-relocation compile

This commit is contained in:
wuyuechuan
2024-04-30 09:53:33 +08:00
committed by yaoxin
parent e1212c6170
commit 9334edb278
9 changed files with 49 additions and 5 deletions

View File

@ -31,6 +31,7 @@ function print_help()
-T|--tassl build with tassl
-pm|--product_mode this values of paramenter is opengauss or lite or finance, the default value is opengauss.
-nls|--enable_nls enable Native Language Support
--relocation generate gaussdb.map with relocation(GCC >=10.3).
"
}
@ -82,7 +83,11 @@ while [ $# -gt 0 ]; do
shift 1
;;
-nls|--enable_nls)
extra_config_opt="--config_opt --enable-nls=zh_CN "
extra_config_opt="$extra_config_opt --config_opt --enable-nls=zh_CN "
shift 1
;;
--relocation)
extra_config_opt="$extra_config_opt --config_opt --enable-relocation "
shift 1
;;
*)

View File

@ -109,7 +109,7 @@ while [ $# -gt 0 ]; do
echo "no extra configure options provided"
exit 1
fi
extra_cmake_opt=$2
extra_cmake_opt=" $2 $extra_cmake_opt "
shift 2
;;
--config_opt)
@ -117,7 +117,7 @@ while [ $# -gt 0 ]; do
echo "no extra configure options provided"
exit 1
fi
extra_config_opt=$2
extra_config_opt=" $2 $extra_config_opt "
shift 2
;;
-T|--tassl)

View File

@ -809,5 +809,6 @@ echo "[makemppdb] $(date +%y-%m-%d' '%T): remove ${BUILD_DIR}" >>"$LOG_FILE" 2>&
mkdir ${ROOT_DIR}/output
mv ${ROOT_DIR}/build/script/*.tar.gz ${ROOT_DIR}/output/
test -e ${ROOT_DIR}/build/script/gaussdb.map && mv ${ROOT_DIR}/build/script/gaussdb.map ${ROOT_DIR}/output/
echo "now, all packages has finished!"
exit 0

View File

@ -104,7 +104,7 @@ separate_symbol()
;;
esac
if [ -x "$x" ]; then
if [ "$x" != "install-sh" ]; then
if [ "$x" != "install-sh" ] && [ "$x" != "gaussdb.map" ]; then
objcopy --only-keep-debug "$x" "$INSTALL_DIR/${symbol_name}.symbol" > /dev/null 2>&1
objcopy --strip-all "$x" "$x"_release
rm "$x"
@ -191,3 +191,4 @@ cd $SYMBOLS_DIR/../
tar -zcf $PACKAGE_DIR/symbols.tar.gz symbols
chmod 755 $PACKAGE_DIR/symbols.tar.gz
cp $PACKAGE_DIR/symbols.tar.gz $DEPTH
mv "$BIN_DIR/gaussdb.map" $DEPTH

View File

@ -181,6 +181,12 @@ function make_package_upgrade_sql()
echo "Successfully packaged upgrade_sql files."
}
function move_gaussdb_map()
{
cd $SCRIPT_DIR
deploy_pkgs gaussdb.map
}
function make_package_libpq()
{
cd $SCRIPT_DIR
@ -236,5 +242,6 @@ function gaussdb_pkg()
make_package_libpq
make_package_tools
make_package_upgrade_sql
move_gaussdb_map
echo "End package opengauss."
}

16
configure vendored
View File

@ -754,6 +754,7 @@ enable_jemalloc_debug
enable_privategauss
enable_multiple_nodes
enable_lite_mode
enable_relocation
enable_finance_mode
enable_mot
enable_bbox
@ -842,6 +843,7 @@ enable_jemalloc_debug
enable_privategauss
enable_multiple_nodes
enable_lite_mode
enable_relocation
enable_finance_mode
enable_mot
enable_bbox
@ -3234,7 +3236,21 @@ $as_echo "$as_me: error: no argument expected for --enable-finance-mode option"
else
enable_finance_mode=no
fi
# Check whether --enable-relocation was given.
if test "$enable_relocation" = yes; then
major_version=$(echo "$gcc_version" | cut -d'.' -f1)
minor_version=$(echo "$gcc_version" | cut -d'.' -f2)
if (( major_version < 10 )) || (( major_version >= 10 && minor_version < 3 )); then
{ { $as_echo "$as_me:$LINENO: error: --enable-relocation is not supported where GCC compiler version is less than 10.3." >&5
$as_echo "$as_me: error: -enable-relocation is not supported where GCC compiler version is less than 10.3." >&2;}
{ (exit 1); exit 1; }; }
fi
enable_relocation=yes
else
enable_relocation=no
fi
if test "$enable_lite_nodes" = yes; then

View File

@ -174,6 +174,7 @@ enable_jemalloc_debug = @enable_jemalloc_debug@
enable_privategauss = @enable_privategauss@
enable_multiple_nodes = @enable_multiple_nodes@
enable_lite_mode = @enable_lite_mode@
enable_relocation = @enable_relocation@
enable_finance_mode = @enable_finance_mode@
enable_mot = @enable_mot@
enable_bbox = @enable_bbox@

View File

@ -396,6 +396,9 @@ if(NOT "${ENABLE_UT}" STREQUAL "ON")
add_executable(gaussdb ${gaussdb_objects})
target_link_options(gaussdb PRIVATE ${gaussdb_LINK_OPTIONS})
if("${ENABLE_RELOCATION}" STREQUAL "ON")
target_link_options(gaussdb PRIVATE ${gaussdb_LINK_OPTIONS} "LINKER:-q")
endif()
target_link_directories(gaussdb PRIVATE ${gaussdb_LINK_DIRS})
target_link_libraries(gaussdb PRIVATE ${gaussdb_LINK_LIBS})
add_dependencies(gaussdb ${gaussdb_DEPEND_LIST})
@ -409,7 +412,10 @@ if(NOT "${ENABLE_UT}" STREQUAL "ON")
endif()
install(TARGETS gaussdb RUNTIME DESTINATION bin)
if(NOT "${ENABLE_LITE_MODE}" STREQUAL "ON")
if("${ENABLE_RELOCATION}" STREQUAL "ON")
install(CODE "execute_process(COMMAND cp gaussdb gaussdb.map WORKING_DIRECTORY \$ENV\{DESTDIR\}${CMAKE_INSTALL_PREFIX}/bin)")
endif()
if(NOT "${ENABLE_LITE_MODE}" STREQUAL "ON")
install(CODE "execute_process(COMMAND ln -sf gaussdb gs_encrypt WORKING_DIRECTORY \$ENV\{DESTDIR\}${CMAKE_INSTALL_PREFIX}/bin)")
install(CODE "message(\"-- Created symlink: gs_encrypt -> gaussdb\")")
endif()

View File

@ -305,6 +305,9 @@ ifneq ($(PORTNAME), aix)
gaussdb: $(OBJS) |
$(CC) $(CXXFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(call expand_subsys,$^) $(LIBS) $(LLVMLIBS) $(HOTPATCH_ATOMIC_LDS) -o $@
ifeq ($(enable_relocation), yes)
$(CC) $(CXXFLAGS) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) $(call expand_subsys,$^) $(LIBS) $(LLVMLIBS) $(HOTPATCH_ATOMIC_LDS) -o $@.map -Wl,-q
endif
$(CRC_CHECK)
db: $(OBJS)
@ -705,6 +708,10 @@ endif
install-bin: gaussdb $(POSTGRES_IMP) installdirs libcgroup
$(INSTALL_PROGRAM) gaussdb$(X) '$(DESTDIR)$(bindir)/gaussdb$(X)'
$(INSTALL_PROGRAM) '$(LZ4_BIN_PATH)/lz4' '$(DESTDIR)$(bindir)/lz4'
ifeq ($(enable_relocation), yes)
$(INSTALL_PROGRAM) gaussdb$(X).map '$(DESTDIR)$(bindir)/gaussdb$(X).map'
endif
ifeq ($(enable_lite_mode), no)
@if test -d $(KERBEROS_BIN_PATH); then cp -rf $(KERBEROS_BIN_PATH)/klist $(DESTDIR)$(bindir)/; fi
@if test -d $(KERBEROS_BIN_PATH); then cp -rf $(KERBEROS_BIN_PATH)/kinit $(DESTDIR)$(bindir)/; fi