Support for GCI application on Ubuntu 18.04 required some changes in the way GemStone shared libraries are built. The shared libraries now contain weak symbols, and the linker flags for linking a GCI application have changed.
Otherwise, this change should have no impact on customer application.
Previously, the FFI parsing of external C library headers could fail with unexpected token errors, depending on definitions within the header file and its include files. Now, before the FFI performs parsing, the native C preprocessor is automatically run on the header file.
On Linux and AIX, cpp must be available, and on Darwin, clang must be available, in order for FFI to parse C header files.
Note that the C preprocessor on AIX only supports ANSI-compliant C; C++ style comments using // are not accepted by the preprocessor.
A side effect of this change is that comments in the header files are no longer preserved in the output from FFI processing. Inclusion of C comments had been somewhat unreliable since associating the declaration with the comment depended on the convention of the comment preceding the declaration and applying only to a single function, which was not always the case.
GciLibrary instance methods are generated using the FFI, and as a result of the preprocessing changes, these methods longer include the comment.
Refer to the GemBuilder for C manual, or the text in $GEMSTONE/include/gci.hf, for function details.
The CHeader class >> path: method previously required a full path to the C header file that you intended to parse. Header files that are included by the specified file are also parsed, and these libraries were found by searching on specific system search path directories.
This did not allow you to use specific versions of include files other than the installed versions. For example, when parsing a header file that includes the OpenSSL headers, parsing would find the installed system versions of OpenSSL, rather than the intended development version.
Now, path specification is more flexible. You may pass only the name of the file to path:, in which case it searches on the system path for both that file and included files.
You can also specify the library search path for a given header file name or path, using the following methods:
CHeader class >> path: filePathString searchPath: searchPathString
CHeader class >> path: filePathString searchPaths: anArrayOfPathStrings
These methods use the specified search path or paths to find the specified file filePathString, and any files referenced by #include directives from that file. If the header files are not found, it will look in the system search paths; the given search paths are searched before the system include directories.
A new method, CPreprocessor >> allSearchPaths, returns the full set of search paths for an instance of CPreprocessor.
In earlier versions, FFI methods hard-coded some class names, making subclassing difficult. Species methods have been added to allow subclasses to override behavior. Added methods include:
CPreprocessor >> cPreprocessorTokenSpecies
CPreprocessor >> cDeclarationSpecies
CHeader >> cByteArraySpecies
CHeader >> cDeclarationSpecies
CHeader class >> cPreprocessorSpecies
CDeclaration >> cCalloutSpecies
CDeclaration >> cDeclarationSpecies
CDeclaration >> cPreprocessorSpecies
The following method have been added by the code changes.
CDeclaration >> byteSizeRounded
CPreprocessor >> insertSearchPath:
CPreprocessor >> searchForInclude:excluding:
CPreprocessorToken >> defineParameters:expansionTokens:
CPreprocessorToken >> expandArguments:
The following methods have been removed by code changes:
CPreprocessor >> concatenate:definition:arguments:
CPreprocessor >> createStringLiteralFrom:
CPreprocessor >> createStringLiteralsIn:from:
CPreprocessorToken >> defineParameters
CPreprocessorToken >> defineParameters:string:
CPreprocessorToken >> defineString
CPreprocessorToken >> isVarargsToken
CPreprocessor class >> clearDefaultDefinitions
CPreprocessor class >> defaultDefinitions
In the libgcilnk library, but not in the libgcirpc library, a SIGTERM handler is not chained to a previously installed handler. (#47862)
The implementation was configured to malloc 2163 bytes, which did not allow for the round-up to 32-bit word boundaries, and should have been 2168. (#47304)
Red Hat 6.x: GNU gdb 7.2-92.el6
Ubuntu Linux 16.04: GNU gdb 7.11.1
g++ -fmessage-length=0 -fcheck-new -O3 -ggdb -m64 -pipe
-D_REENTRANT -D_GNU_SOURCE -pthread -fPIC -fno-strict-aliasing
-fno-exceptions -I$GEMSTONE/include -x c++ -c userCode.c
-o userCode.o
The following warn flags are recommended for compilation:
-Wformat -Wtrigraphs -Wcomment -Wtrigraphs
-Wno-aggregate-return -Wswitch -Wshadow -Wunused-value
-Wunused-variable -Wunused-label -Wno-unused-function
-Wchar-subscripts -Wmissing-braces -Wmissing-declarations
-Wmultichar -Wparentheses -Wsign-compare -Wsign-promo
-Wwrite-strings -Wreturn-type -Wuninitialized
CC -xO4 -m64 -xarch=generic -Kpic -mt -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -I$GEMSTONE/include
-features=no%except -c userCode.c -o userCode.o
xlC_r -O3 -qstrict -qalias=noansi -q64 -+ -qpic
-qthreaded -qarch=pwr6 -qtune=balanced -D_LARGEFILE64_SOURCE
-DFLG_AIX_VERSION=version -D_REENTRANT -D_THREAD_SAFE
-qminimaltoc -qlist=offset -qmaxmem=-1 -qsuppress=1500-010:1500
-029:1540-1103:1540-2907:1540-0804:1540-1281:1540-1090 -qnoeh
-I$GEMSTONE/include -c userCode.c -o userCode.o
Depending on your version of AIX, you need to include -DFLG_AIX_VERSION=61, -DFLG_AIX_VERSION=71, or -DFLG_AIX_VERSION=72.
Also note that there is no space in the -qsuppress arguments that are continued on the following line.
g++ -fmessage-length=0 -O3 -ggdb -m64 -pipe -fPIC
-fno-strict-aliasing -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE
-D_REENTRANT -D_GNU_SOURCE -I$GEMSTONE/include -x c++
-c userCode.c -o userCode.o
The following warn flags are recommended for compilation:
-Wno-format -Wtrigraphs -Wcomment -Wsystem-headers -Wtrigraphs
-Wno-aggregate-return -Wswitch -Wshadow -Wunused-value
-Wunused-variable -Wunused-label -Wno-unused-function
-Wchar-subscripts -Wno-conversion -Wmissing-braces -Wmultichar
-Wparentheses -Wsign-compare -Wsign-promo -Wwrite-strings
-Wreturn-type -Wno-nullability-completeness
-Wno-expansion-to-defined
cl /W3 /Zi /MD /O2 /Oy- -DNDEBUG /TP /nologo /D_LP64 /D_AMD64_
/D_CONSOLE /D_DLL /DWIN32_LEAN_AND_MEAN
/D_CRT_SECURE_NO_WARNINGS /EHsc
/DNATIVE /I 'VisualStudioInstallPath\atlmfc\include'
/I 'VisualStudioInstallPath\VC\include'
/I 'C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Include'
/I '%GEMSTONE%\include' -c userCode.c -FouserCode.obj
link /LIBPATH:"VisualStudioInstallPath\VC\lib\amd64"
/LIBPATH:"C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Lib\x64" -RELEASE
/OPT:REF /INCREMENTAL:NO /MAP /nologo /MANIFEST
/MANIFESTFILE:userAppl.exe.manifest
/MANIFESTUAC:"level='asInvoker'" userCode.obj
%GEMSTONE%\lib\gcirpc.lib ws2_32.lib netapi32.lib advapi32.lib
comdlg32.lib user32.lib gdi32.lib kernel32.lib winspool.lib
Secur32.lib /out:userAppl.exe