В Вт., 06/10/2015 в 18:45 -0600, Karl Williamson пишет:
> I'm working on continuing to port perl5 to z/OS.  One test that is
> failing is beyond my knowledge level.  The Dynaloader module has a
> function dl_findfile() which looks for libraries in the path.  It is
> expecting to find libc at least, but is finding nothing.
>
> This test does not work on several platforms, even some Unix-like ones,
> and my guess is it doesn't work on z/OS either.  But I am hoping someone
> can give me more information.
>
> One of the comments in the perl source says:
>      # On OS/390, libc.a doesn't really hold anything at all,
>
> And that makes me think that looking for it (and perhaps any Unix-y
> library) is futile.

Hi Karl,

In z/OS there are system libraries and user libraries.

All functions of the system libraries  described here
(http://www
-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/keyword.htm?lang=en)

For call a function system library is necessary in the source file (*.c) to 
include the header file.

Example: for call function 'alloca()' in source file writing "#include 
<stdlib.h>" and that is
enough

source file main.c:
 1 #include <stdlib.h>
 2 #include <stdio.h>
 3 int main(int argc,char * argv[])
 4 {
 5   char *p = (char *) alloca (2 * sizeof (char));
 6   p[0] = 'a';
 7   p[1] = 0;
 8   printf(":> %s\n",p);
 9   return 0;
10 }

successful build        c99 -g -qlanglvl=extended -qxplink -c main.c
 c99 -qxplink  -o
alloca main.o

source file main.c
 1 /*#include <stdlib.h>*/
 2 #include <stdio.h>
 3 int main(int argc,char * argv[])
 4 {
 5   char *p = (char *) alloca (2 * sizeof (char));
 6   p[0] = 'a';
 7   p[1] = 0;
 8   printf(":> %s\n",p);
 9   return 0;
10 }

failure build
 c99 -g -qlanglvl=extended -qxplink -c main.c
 c99 -qxplink  -o alloca main.o
   IEW2456E 9207 SYMBOL alloca UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM 
THE
          DESIGNATED CALL LIBRARY.
   FSUM3065 The LINKEDIT step ended with return code 8.
   make: *** [alloca] Error 3

Function system libraries are located in the datasets (MVS z/OS) and find them 
to HFS (file syztem USS z/OS) unnecessary.


Now for the user libraries

You can create static libraries '*.a' using 'ar' command, and dynamic '*.so' 
using the command 'c99' c option '-Wl,dll'

 In perl with older versions there are still variable 'shrpldflags' in file 
Makefile.SH it is correct. Variable 'lddlflags'  and 'ccdlflags' in 
hints/os390.sh incorrect.
 Need to fix all of the variable for the compilation and linking for command 
'Configure -usedl'
 and place them in a single file, that there was no warning.

Now for the module 'ext/Dynaloader/dllload.xs' it created for z/OS
there used functions 'dllload()' 'dllfree()' etc.
With version V1R6 are available  POSIX functions 'dlopen()' 'dlclose()' etc.


--
Regards,

Yaroslav Kuzmin
Developer C/C++ ,z/OS , Linux
3 Zhukovskiy Street · Miass, Chelyabinsk region 456318 · Russia
Tel:  +7.922.2.38.33.38
Email: ykuz...@rocketsoftware.com
Web: www.rocketsoftware.com
================================
Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ 
+1 800.966.3270 ■ +1 781.577.4321
Unsubscribe From Commercial Email – unsubscr...@rocketsoftware.com
Manage Your Subscription Preferences - 
http://info.rocketsoftware.com/GlobalSubscriptionManagementEmailFooter_SubscriptionCenter.html
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy
================================

This communication and any attachments may contain confidential information of 
Rocket Software, Inc. All unauthorized use, disclosure or distribution is 
prohibited. If you are not the intended recipient, please notify Rocket 
Software immediately and destroy all copies of this communication. Thank you.

Reply via email to