Skip to content

Commit

Permalink
[#23] Rename all occurrences of libgtmshr.so/libgtmutil.so to libyott…
Browse files Browse the repository at this point in the history
…adb.so/libyottadbutil.so

Also for backward compatibility purposes
  a) install libgtmshr.so as a soft link to libyottadb.so
  b) Install libgtmutil.so as a soft link to libyottadbutil.so
  • Loading branch information
nars1 committed Jan 28, 2018
1 parent ddbf9cd commit 99d6296
Show file tree
Hide file tree
Showing 50 changed files with 254 additions and 248 deletions.
62 changes: 31 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,27 +197,27 @@ endmacro()

# Assign sources to executables.
set_source_list(gtm_threadgbl_deftypes gtm_threadgbl_deftypes)
set_source_list(dbcertify dbcertify dlopen_libgtmshr)
set_source_list(dse dse dlopen_libgtmshr)
set_source_list(ftok ftok dlopen_libgtmshr)
set_source_list(dbcertify dbcertify dlopen_libyottadb)
set_source_list(dse dse dlopen_libyottadb)
set_source_list(ftok ftok dlopen_libyottadb)
set_source_list(geteuid geteuid)
set_source_list(gtcm_gnp_server gtcm_gnp_server dlopen_libgtmshr)
set_source_list(gtcm_gnp_server gtcm_gnp_server dlopen_libyottadb)
set_source_list(gtcm_pkdisp gtcm_pkdisp omi_extstr)
set_source_list(gtcm_play gtcm_play dlopen_libgtmshr)
set_source_list(gtcm_server gtcm_server dlopen_libgtmshr)
set_source_list(gtcm_shmclean gtcm_shmclean dlopen_libgtmshr)
set_source_list(gtcm_play gtcm_play dlopen_libyottadb)
set_source_list(gtcm_server gtcm_server dlopen_libyottadb)
set_source_list(gtcm_shmclean gtcm_shmclean dlopen_libyottadb)
set_source_list(gtmsecshr gtmsecshr_wrapper)
set_source_list(gtmsecshr_real gtmsecshr)
set_source_list(libgtmcrypt gtmcrypt_ref gtmcrypt_pk_ref gtmcrypt_dbk_ref gtmcrypt_sym_ref gtmcrypt_util)
set_source_list(libgtmtls gtm_tls_impl gtmcrypt_util)
set_source_list(libgtmshr gtm_main mupip_main mupip_cmd dse_main dse_cmd lke_main lke_cmd)
set_source_list(libgtmshr gtcm_play_main omi_srvc_xct omi_extstr)
set_source_list(libgtmshr gtcm_server_main gtcm_gnp_server_main gtcm_gnp_clitab gtcm_shmclean_main)
set_source_list(libgtmshr dbcertify_main dbcertify_cmd ftok_main)
set_source_list(lke lke dlopen_libgtmshr)
set_source_list(libyottadb gtm_main mupip_main mupip_cmd dse_main dse_cmd lke_main lke_cmd)
set_source_list(libyottadb gtcm_play_main omi_srvc_xct omi_extstr)
set_source_list(libyottadb gtcm_server_main gtcm_gnp_server_main gtcm_gnp_clitab gtcm_shmclean_main)
set_source_list(libyottadb dbcertify_main dbcertify_cmd ftok_main)
set_source_list(lke lke dlopen_libyottadb)
set_source_list(maskpass maskpass gtmcrypt_util)
set_source_list(mumps gtm dlopen_libgtmshr)
set_source_list(mupip mupip dlopen_libgtmshr)
set_source_list(mumps gtm dlopen_libyottadb)
set_source_list(mupip mupip dlopen_libyottadb)
set_source_list(semstat2 semstat2)

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -358,17 +358,17 @@ add_custom_command(
add_custom_target(gen_gtm_threadgbl_deftypes
DEPENDS ${YDB_BINARY_DIR}/${gtmthreadgblasmhdr} ${YDB_BINARY_DIR}/${gtmthreadgblasmfile})

foreach(exp exe shr)
set(out gtm${exp}_symbols.export)
set(in ${YDB_SOURCE_DIR}/sr_unix/gtm${exp}_symbols.exp)
foreach(exp ydbexe yottadb)
set(out ${exp}_symbols.export)
set(in ${YDB_SOURCE_DIR}/sr_unix/${exp}_symbols.exp)
add_custom_command(
OUTPUT ${out}
DEPENDS ${in} gen_gtm_threadgbl_deftypes
COMMAND tcsh -f ${YDB_SOURCE_DIR}/sr_linux/genexport.csh ${in} ${out}
)
endforeach()

add_custom_target(gen_export DEPENDS gtmexe_symbols.export gtmshr_symbols.export)
add_custom_target(gen_export DEPENDS ydbexe_symbols.export yottadb_symbols.export)

foreach(lib
mumps
Expand All @@ -389,9 +389,9 @@ endif()
function(add_executable target)
_add_executable(${target} ${ARGN})
set_target_properties(${target} PROPERTIES LINK_FLAGS "-Wl,-Map=${target}.map")
# Since all utilities now dlopen() libgtmshr.so at startup, add a dependency to not build the utilities
# until libgtmshr.so was built. And that in turn relies on threadgbl_deftypes being built so add that too.
add_dependencies(${target} libgtmshr gen_gtm_threadgbl_deftypes)
# Since all utilities now dlopen() libyottadb.so at startup, add a dependency to not build the utilities
# until libyottadb.so was built. And that in turn relies on threadgbl_deftypes being built so add that too.
add_dependencies(${target} libyottadb gen_gtm_threadgbl_deftypes)
# And add system libraries as a target library for all utilities (e.g. dlopen() etc.).
target_link_libraries(${target} ${libsyslibs})
endfunction()
Expand All @@ -413,7 +413,7 @@ set_target_properties(gtmsecshr_real PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${YDB_BINARY_DIR}/gtmsecshrdir
)
target_link_libraries(gtmsecshr_real libmumps) # needed for static linking since this is a setuid executable
# and does not do a dlopen of libgtmshr.so
# and does not do a dlopen of libyottadb.so

add_executable(mupip ${mupip_SOURCES})
list(APPEND with_export mupip)
Expand All @@ -439,15 +439,15 @@ add_executable(semstat2 ${semstat2_SOURCES})

add_executable(ftok ${ftok_SOURCES})

add_library(libgtmshr MODULE ${libgtmshr_SOURCES})
set_property(TARGET libgtmshr PROPERTY OUTPUT_NAME gtmshr)
target_link_libraries(libgtmshr libmumps)
set_target_properties(libgtmshr PROPERTIES
LINK_FLAGS "${libgtmshr_link} -Wl,-Map=libgtmshr.map"
LINK_DEPENDS "${libgtmshr_dep}"
add_library(libyottadb MODULE ${libyottadb_SOURCES})
set_property(TARGET libyottadb PROPERTY OUTPUT_NAME yottadb)
target_link_libraries(libyottadb libmumps)
set_target_properties(libyottadb PROPERTIES
LINK_FLAGS "${libyottadb_link} -Wl,-Map=libyottadb.map"
LINK_DEPENDS "${libyottadb_dep}"
)
add_dependencies(libgtmshr gen_export)
add_dependencies(mumps libgtmshr)
add_dependencies(libyottadb gen_export)
add_dependencies(mumps libyottadb)

# Iterate over the list of GPG related libraries
foreach(gpglib gpg-error gpgme gcrypt config)
Expand Down Expand Up @@ -579,7 +579,7 @@ install(TARGETS
ftok
gtmsecshr
mupip
libgtmshr
libyottadb
DESTINATION ${YDB_INSTALL_DIR}
)
install(TARGETS gtmsecshr_real DESTINATION ${YDB_INSTALL_DIR}/gtmsecshrdir)
Expand Down
6 changes: 3 additions & 3 deletions sr_linux/genexport.csh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# #
# Copyright 2001, 2010 Fidelity Information Services, Inc #
# #
# Copyright (c) 2017 YottaDB LLC. and/or its subsidiaries. #
# Copyright (c) 2017-2018 YottaDB LLC. and/or its subsidiaries. #
# All rights reserved. #
# #
# This source code contains the intellectual property #
Expand All @@ -15,10 +15,10 @@
############################################################################################
#
# genexport.csh - to generate the linker script *.export to export
# all call-in related symbols from libgtmshr.so
# all call-in related symbols from libyottadb.so
# Argument
# $1 - The pathname of a .exp file that list out all symbols to be exposed
# $2 - output verstion script file to be specified with ld --version-script.
# $2 - output version script file to be specified with ld --version-script.
#
# Example output:
# {
Expand Down
8 changes: 4 additions & 4 deletions sr_linux/gtm_env_sp.csh
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ if ( $?gtm_version_change == "1" ) then

# -M generate link map onto standard output
setenv gt_ld_options_common "-Wl,-M"
setenv gt_ld_options_gtmshr "-Wl,-u,accumulate -Wl,-u,is_big_endian -Wl,-u,to_ulong"
setenv gt_ld_options_gtmshr "$gt_ld_options_gtmshr -Wl,-u,gtm_filename_to_id -Wl,--version-script,gtmshr_symbols.export"
setenv gt_ld_options_yottadb "-Wl,-u,accumulate -Wl,-u,is_big_endian -Wl,-u,to_ulong"
setenv gt_ld_options_yottadb "$gt_ld_options_yottadb -Wl,-u,gtm_filename_to_id -Wl,--version-script,yottadb_symbols.export"
setenv gt_ld_options_all_exe "-rdynamic -Wl,-u,gtm_filename_to_id -Wl,-u,gtm_zstatus"
setenv gt_ld_options_all_exe "$gt_ld_options_all_exe -Wl,--version-script,gtmexe_symbols.export"
setenv gt_ld_options_all_exe "$gt_ld_options_all_exe -Wl,--version-script,ydbexe_symbols.export"

# optimize for all 64bit platforms
#
Expand Down Expand Up @@ -288,7 +288,7 @@ if ( $?gtm_version_change == "1" ) then
# over-ride option.
if ( "x86_64" == $mach_type && "32" == $gt_build_type ) then
setenv gt_cc_options_common "$gt_cc_options_common -m32"
setenv gt_ld_options_gtmshr "$gt_ld_options_gtmshr -m32"
setenv gt_ld_options_yottadb "$gt_ld_options_yottadb -m32"
setenv gt_cc_shl_options "$gt_cc_shl_options -m32"
setenv gt_ld_shl_options "$gt_ld_shl_options -m32"
setenv gt_ld_options_common "$gt_ld_options_common -m32"
Expand Down
12 changes: 6 additions & 6 deletions sr_linux/platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ add_definitions(
)

# Linker
set(gtm_link "-Wl,-u,gtm_filename_to_id -Wl,-u,ydb_zstatus -Wl,--version-script,\"${YDB_BINARY_DIR}/gtmexe_symbols.export\"")
set(gtm_dep "${YDB_BINARY_DIR}/gtmexe_symbols.export")
set(gtm_link "-Wl,-u,gtm_filename_to_id -Wl,-u,ydb_zstatus -Wl,--version-script,\"${YDB_BINARY_DIR}/ydbexe_symbols.export\"")
set(gtm_dep "${YDB_BINARY_DIR}/ydbexe_symbols.export")

set(libgtmshr_link "-Wl,-u,ydb_ci -Wl,-u,gtm_filename_to_id -Wl,-u,gtm_is_main_thread")
set(libgtmshr_link "${libgtmshr_link} -Wl,-u,accumulate -Wl,-u,is_big_endian -Wl,-u,to_ulong")
set(libgtmshr_link "${libgtmshr_link} -Wl,--version-script,\"${YDB_BINARY_DIR}/gtmshr_symbols.export\"")
set(libgtmshr_dep "${YDB_BINARY_DIR}/gtmexe_symbols.export")
set(libyottadb_link "-Wl,-u,ydb_ci -Wl,-u,gtm_filename_to_id -Wl,-u,gtm_is_main_thread")
set(libyottadb_link "${libyottadb_link} -Wl,-u,accumulate -Wl,-u,is_big_endian -Wl,-u,to_ulong")
set(libyottadb_link "${libyottadb_link} -Wl,--version-script,\"${YDB_BINARY_DIR}/yottadb_symbols.export\"")
set(libyottadb_dep "${YDB_BINARY_DIR}/ydbexe_symbols.export")

if(${bits} EQUAL 32)
if("${arch}" MATCHES "armv[67]l")
Expand Down
4 changes: 2 additions & 2 deletions sr_port/common_startup_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (c) 2014-2017 Fidelity National Information *
* Services, Inc. and/or its subsidiaries. All rights reserved. *
* *
* Copyright (c) 2017 YottaDB LLC. and/or its subsidiaries. *
* Copyright (c) 2017-2018 YottaDB LLC. and/or its subsidiaries.*
* All rights reserved. *
* *
* This source code contains the intellectual property *
Expand Down Expand Up @@ -52,7 +52,7 @@ void common_startup_init(enum gtmImageTypes img_type, CLI_ENTRY *image_cmd_ary)
SETUP_THREADGBL_ACCESS;
if (image_type)
{ /* An image is already loaded. This is possible if a C function that did call-ins
* (and hence has access to the symbols that libgtmshr.so exposes) invokes "dlopen_libgtmshr"
* (and hence has access to the symbols that libyottadb.so exposes) invokes "dlopen_libyottadb"
* more than once for different image types. Do not allow multiple images to be loaded.
*/
rts_error_csa(CSA_ARG(NULL) VARLSTCNT(6) ERR_MIXIMAGE, 4, GTMIMAGENAMETXT(img_type), GTMIMAGENAMETXT(image_type));
Expand Down
4 changes: 2 additions & 2 deletions sr_port/dbcertify.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************
* *
* Copyright (c) 2017 YottaDB LLC. and/or its subsidiaries. *
* Copyright (c) 2017-2018 YottaDB LLC. and/or its subsidiaries.*
* All rights reserved. *
* *
* This source code contains the intellectual property *
Expand All @@ -16,5 +16,5 @@

int main(int argc, char **argv, char **envp)
{
return dlopen_libgtmshr(argc, argv, envp, "dbcertify_main");
return dlopen_libyottadb(argc, argv, envp, "dbcertify_main");
}
42 changes: 4 additions & 38 deletions sr_port/gtm_file_stat.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/****************************************************************
* *
* Copyright 2001, 2002 Sanchez Computer Associates, Inc. *
* Copyright 2001, 2002 Sanchez Computer Associates, Inc. *
* *
* Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries. *
* All rights reserved. *
* *
* This source code contains the intellectual property *
* of its copyright holder(s), and is made available *
Expand All @@ -18,43 +21,6 @@
#define FILE_READONLY 2
#define FILE_STAT_ERROR 4

/* Copy the filename from "src" to "dest" using the following rules.
* (i) removing the version information
* (ii) doing compression of contiguous directory delimiters (']' or '>' followed by '<' or '[').
* (iii) transform every '<' to a '[' and every '>' to a ']'
* e.g.
* src = user:[library.]<v990.pro>gtmshr.exe;23
* dst = user:[library.v990.pro]gtmshr.exe
*
* Note that without (iii) we would have got the following mixed notation for "dst" which is incorrect
* as the '[' is balanced by a '>' (at the end of ".pro>") instead of a corresponding ']'.
*
* e.g. src = user:[library.]<v990.pro>gtmshr.exe;23
* dst = user:[library.v990.pro>gtmshr.exe */
#ifdef VMS
#define fncpy_nover(src, src_len, dest, dest_len) \
{ \
unsigned char *sptr, *dptr; \
for (sptr = (unsigned char *)src, dptr = dest; sptr < (src + src_len) && (';' != *sptr); ) \
{ \
if (('>' == *sptr || ']' == *sptr) && ('<' == *(sptr + 1) || '[' == *(sptr + 1))) \
sptr += 2; \
else if ('<' == *sptr) \
{ \
*dptr++ = '['; \
sptr++; \
} else if ('>' == *sptr) \
{ \
*dptr++ = ']'; \
sptr++; \
} else \
*dptr++ = *sptr++; \
} \
dest_len = dptr - (unsigned char *)(dest); \
*(dptr) = 0; \
}
#endif

int gtm_file_stat(mstr *file, mstr *def, mstr *ret, boolean_t check_prv, uint4 *status);

#endif /* GTM_FILE_STAT_INCLUDED */
7 changes: 5 additions & 2 deletions sr_port/gtm_limits.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/****************************************************************
* *
* Copyright 2002, 2014 Fidelity Information Services, Inc *
* Copyright 2002, 2014 Fidelity Information Services, Inc *
* *
* Copyright (c) 2018 YottaDB LLC. and/or its subsidiaries. *
* All rights reserved. *
* *
* This source code contains the intellectual property *
* of its copyright holder(s), and is made available *
Expand Down Expand Up @@ -41,7 +44,7 @@
/* Now define our version which includes space for a terminating NULL byte */
#define GTM_PATH_MAX PATH_MAX + 1
/* The maximum path to the GT.M distribution is complicated by the paths underneath $gtm_dist.
* At the top level, there is libgtmshr.{so,sl,dll} which is roughly 12 characters plus 1 for the
* At the top level, there is libyottadb.so which is roughly 12 characters plus 1 for the
* slash. The path length of gtmsecshrdir/gtmsecshr doesn't come into play because
* $gtm_dist/gtmsecshr will change directory to $gtm_dist/gtmsecshrdir (13 characters including the
* leading slash) and then exec gtmsecshr, avoiding the maximum path issue. Going to "UTF-8" mode adds
Expand Down
6 changes: 3 additions & 3 deletions sr_port/mdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ void suspend(int sig);
mval *push_mval(mval *arg1);
void mval_lex(mval *v, mstr *output);

int dlopen_libgtmshr(int argc, char **argv, char **envp, char *main_func);
int dlopen_libyottadb(int argc, char **argv, char **envp, char *main_func);
int gtm_main(int argc, char **argv, char **envp);
int mupip_main(int argc, char **argv, char **envp);
int dse_main(int argc, char **argv, char **envp);
Expand Down Expand Up @@ -1913,10 +1913,10 @@ enum
#endif

#ifdef DEBUG
/* Define macros that are helpful in verifying that functions in libgtmshr.so are only invoked
/* Define macros that are helpful in verifying that functions in libyottadb.so are only invoked
* by the executables/utilities we expect and not by anything else. For example, libgnpclient.list
* used to have a list of modules that this library includes and was linked only by mumps and lke.
* Now libgnpclient.list is nixed (as part of changes that made all utilities use libgtmshr.so
* Now libgnpclient.list is nixed (as part of changes that made all utilities use libyottadb.so
* and reduce their sizes) but we now have an ASSERT_IS_LIBGNPCLIENT check at function entry in all
* functions that were part of modules in that listing file. Same with the other asserts defined below.
*/
Expand Down
4 changes: 2 additions & 2 deletions sr_port/merrors.msg
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
! usages should be reflected with the new value.
! ERR_GTMDISTUNDEF 150377714 (reported in gtm.c if $gtm_dist is not defined)
! ERR_DISTPATHMAX 150377682 (reported in gtm.c if $gtm_dist buffer is insufficient)
! ERR_DLLNOOPEN 150379250 (reported in gtm.c if libgtmshr cannot be opened)
! ERR_DLLNORTN 150379258 (reported in gtm.c if gtm_main is not found in libgtmshr)
! ERR_DLLNOOPEN 150379250 (reported in gtm.c if libyottadb cannot be opened)
! ERR_DLLNORTN 150379258 (reported in gtm.c if gtm_main is not found in libyottadb)
! ERR_OPCOMMISSED 150381275 (sent via $SNDOPR in util_output.c if prior errors)
!
! The following items must be followed by a tab (because they are parsed by tools/library/doc_tools/routines/diffm.m)
Expand Down
2 changes: 1 addition & 1 deletion sr_port/merrors_ansi.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************
* *
* Copyright (c) 2001-2018 Fidelity National Information *
* Copyright (c) 2001-2018 Fidelity National Information *
* Services, Inc. and/or its subsidiaries. All rights reserved. *
* *
* Copyright (c) 2017-2018 YottaDB LLC. and/or its subsidiaries.*
Expand Down
2 changes: 1 addition & 1 deletion sr_port/merrors_ctl.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************
* *
* Copyright (c) 2001-2018 Fidelity National Information *
* Copyright (c) 2001-2018 Fidelity National Information *
* Services, Inc. and/or its subsidiaries. All rights reserved. *
* *
* Copyright (c) 2017-2018 YottaDB LLC. and/or its subsidiaries.*
Expand Down
12 changes: 6 additions & 6 deletions sr_port/mumps.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -18403,7 +18403,7 @@
invocation.

libyottadb.h also includes definitions for the following entry points
exported from libgtmshr:
exported from libyottadb:

void gtm_hiber_start(ydb_uint_t mssleep);
void gtm_hiber_start_wait_any(ydb_uint_t mssleep)
Expand Down Expand Up @@ -18934,7 +18934,7 @@
To facilitate Call-Ins to M routines, the YottaDB distribution directory
($gtm_dist) contains the following files:

1. libgtmshr.so - A shared library that implements the YottaDB run-time
1. libyottadb.so - A shared library that implements the YottaDB run-time
system, including the Call-In API. If Call-Ins are used from a
standalone C/C++ program, this library needs to be explicitly linked
into the program.
Expand All @@ -18945,7 +18945,7 @@
platforms.

2. mumps - The YottaDB startup program that dynamically links with
libgtmshr.so.
libyottadb.so.
3. gtmxc_types.h - A C-header file containing the declarations of Call-In
API.

Expand Down Expand Up @@ -19014,7 +19014,7 @@
that require more than 18 digits as strings.

libyottadb.h also includes definitions for the following entry points
exported from libgtmshr:
exported from libyottadb:

void gtm_hiber_start(ydb_uint_t mssleep);
void gtm_hiber_start_wait_any(ydb_uint_t mssleep)
Expand Down Expand Up @@ -19280,10 +19280,10 @@
be used instead of the native types (int, float, char, etc).

To use call-ins from a standalone C program, it is necessary that the YottaDB
runtime library (libgtmshr.so) is explicitly linked into the program. If
runtime library (libyottadb.so) is explicitly linked into the program. If
call-ins are used from an External Call function (which in turn was called
from YottaDB through the existing external call mechanism), the External Call
library does not need to be linked explicitly with libgtmshr.so since YottaDB
library does not need to be linked explicitly with libyottadb.so since YottaDB
would have already loaded it.

3 Nested_Call-Ins
Expand Down
Loading

0 comments on commit 99d6296

Please sign in to comment.