Hi Michael,
I have not checked whether our DLLs are better/faster/larger in USS or
MVS as we have built using "cc" in USS for a number of years now as we
use gmake and the build is very similar to all other Unix/Linux machines
we build on. We compile and then link and our code works when called
from MVS or from USS. Here is a sample output from our make. This DLL
also only has one entry point which then resolves all others back to the
caller within a structure of pointers. We make COPT (g  -DYYDEBUG   
-Iincludes/ -Llibraries/) common to both compiles and links.

cc -c -g  -DYYDEBUG    -Iincludes/ -Llibraries/
-Wc,"CSECT(dllprog_init),EXECOPS,EXPORTALL,DLL(CBA)" dllprog.c
cc -Wl,dll -g  -DYYDEBUG    -Iincludes/ -Llibraries/ -o dllprog.so
dllprog.o -llib1 -llib2

Through trial and error I also define the following environment variable:
declare -x _CC_INCDIRS="/usr/include /usr/local/include"
declare -x _CC_LIBDIRS="/usr/lib /usr/local/lib"
declare -x _CXX_CXXSUFFIX="cpp"
declare -x _CXX_INCDIRS="/usr/include /usr/local/include"
declare -x _CXX_LIBDIRS="/usr/lib /usr/local/lib"
declare -x _C89_INCLIBS="//'DSN910.SDSNC.H'"
declare -x
_C89_LSYSLIB="CEE.SCEELKEX:CEE.SCEELKED:SYS1.CSSLIB:DSN910.SDSNLOAD"
declare -x STEPLIB="CBC.SCCNCMP:DSN910.DB9G.SDSNEXIT:DSN910.SDSNLOAD"


HTH

regards
Patrick

http://www.codemagus.com
Patrick Hayward,   Code Magus Limited   (England reg. no. 4024745)

On 04/15/10 16:00, Michael Knigge wrote:
> All,
>
> today I came accross a somehow strange (at least for me) problem....
>
>
> Usually I build my DLLs (written in C and C++) in the MVS-World of
> z/OS. But now I want to build the same DLL under USS (because I can do
> this all remote using SSH).
>
> When I try to compile and link my DLL (it's just one C-Source file) in
> one command, the DLL get's build, but somehow doesn't work (can't be
> loaded and/or the enty-points are not found). Furthermore the DLL is
> much larger as if it is build under MVS.
>
> like this:
>
> c89 -Wc,"MY,OPTIONS" -Wl,"MY_OTHER_OPTIONS" -o libfoo.so foo.c
>
>
>
> If I compile the module with the "-c" switch (--> don't link) and then
> link the module to a DLL in a second step, the Linker tells me that
> CEESTART can't be resolved....
>
> c89 -c -Wc,"MY,OPTIONS" foo.c
> c89 -Wl,"MY_OTHER_OPTIONS" -o libfoo.so foo.o
>
> It seems so me that (for some reason) the linker dosn't know where to
> look for the LE-Runtimes - but the file
>
>    /usr/lpp/cbclib/xlc/etc/usr/lpp/cbclib/xlc/
>
> looks ok so far....
>
>
>
> Would be great if anyone has an idea....
>
>
> Thank you,
> Michael
>
>
>
>
>
> P.S.: Just to be complete, here are my compiler and linker options:
>
>
> Compiler:
>
>
> DLL(CBA)
> ILP32
> TUNE(0)
> ARCH(0)
> FLOAT(IEEE)
> LANGLVL(EXTENDED)
> TARGET(LE)
> NOOPT
> LONGNAME
> SOURCE
> ROSTRING
> OBJECT
> PLIST(HOST)
> NOOE
> NOSTRICT_INDUC
> NOWSIZEOF
> NOSEQUENCE
> NOMARGINS
> NOINLINE
> NOLIST
> NOOFFSET
> NOCOMPACT
> NOCOMPRESS
> NOIGNERRNO
> NOINITAUTO
> EXECOPS
> DEFINE(_OS390)
> DEFINE(_OE_SOCKETS)
> DEFINE(_OPEN_THREADS)
> DEFINE(_LARGE_FILES)
> DEFINE(_POSIX_SOURCE)
> DEFINE(_ISOC99_SOURCE)
> DEFINE(_UNIX03_SOURCE)
> DEFINE(_XOPEN_SOURCE_EXTENDED=1)
> DEFINE(_XOPEN_SOURCE=500)
> DEFINE(NEEDSIEEE754)
> DEFINE(NEEDSLONGLONG)
>
>
> Linker:
>
> AMODE=31
> RMODE=ANY
> CASE=MIXED
> DYNAM=DLL
> REUS=RENT
> UPCASE=NO
> LIST
> MAP
> XREF
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: GET IBM-MAIN INFO
> Search the archives at http://bama.ua.edu/archives/ibm-main.html
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to