modul mro in z/OS
[email protected] (Yaroslav Kuzmin)
| Newsgroups | perl.mvs,perl.perl5.porters |
|---|---|
| Message-ID | <[email protected]> |
Ok, it is a feature of the compiler xlc, when compiling only the file name is used to identify (csectname) when linking.
So when in the project have the same file names and in them there is a cross-function calls. Linking error occurs.
we obtain two choices
1 Change file name.
2 Use the compiler option csect=<qualifier>
http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.cbcux01/csect.htm?lang=en
if put option xlc -qcsect=<qualifier> it adds to the primary name csectname qualifier : qualifier#csectname
if use #pragma csect ("newcsectname") xlc will rewrite csetname : newcsectname
a) for all project in file hints/os390.sh add option -qcsect=<name current dir>
b) only for file mro.c or ext/mro/mro.c add option -qcsect=<name current dir>
c) set pragma in file mro.c
for branch bleab attached file mro.c.patch
I tested on perl-v5.21.9-277-g952443b work
How much work with z/OC but many still do not know, such a large number of system settings :)
------------------------------------------------------------------------
Yaroslav Kuzmin
Developer C/C++ ,z/OS , Linux
3 Zhukovskiy Street ・ Miass, Chelyabinsk region 456318 ・ Russia
Tel: +7.922.2.38.33.38
Email: [email protected]
Web: www.rocketsoftware.com
________________________________
От: John Goodyear <[email protected]>
Отправлено: 12 марта 2015 г. 20:56
Кому: Yaroslav Kuzmin
Копия: Karl Williamson
Тема: Re: НА: НА: Smoke [ebcdic] v5.21.9-247-g8e2863d FAIL(X) os/390 23.00 (2817/)
I sent the testcase to a compiler contact. His response is below. I verified that it works.
The problem is a result of csect names being the same for two files with the same name but in two different directories. The problem is easily corrected by using a CSECT compiler option as in the following example:
EXEC=main2lib
OBJS=main.o
CXX=xlc
AR=ar
CFLAGS=-qxplink -qlanglvl=extc99:extc89 -I. -I..
CFLAGS += -qcsect=$(subst /,@,$(dir $(PWD)/$<))
LDFLAGS=-qxplink
LIBA=liba.a
LIBB=ext/liba.a
LIBS=$(LIBA) $(LIBB)
$(EXEC):$(OBJS) $(LIBS)
$(CXX) $(LDFLAGS) -o $@ $^
$(LIBA):liba.o
$(AR) cr $@ $^
$(LIBB):ext/liba.o
$(AR) cr $@ $^
%.o:%.c
$(CXX) $(CFLAGS) -c $^ -o $@
ext/liba.o:ext/liba.c
$(CXX) $(CFLAGS) -c $^ -o $@
.PHONY:clean
clean:
rm -f $(EXEC) $(OBJS) $(LIBS) liba.o ext/liba.o
Regards,
John Goodyear
zGrowth and System z Applied Technologies
Gaithersburg, MD
[email protected]
[Inactive hide details for Yaroslav Kuzmin ---03/12/2015 11:37:59 AM---Yes , renaming a file solves the problem. in the archive]Yaroslav Kuzmin ---03/12/2015 11:37:59 AM---Yes , renaming a file solves the problem. in the archive lib.tar.gz is this testcase problem xlc
From: Yaroslav Kuzmin <[email protected]>
To: John Goodyear/Gaithersburg/IBM@IBMUS
Cc: Karl Williamson <[email protected]>
Date: 03/12/2015 11:37 AM
Subject: НА: НА: Smoke [ebcdic] v5.21.9-247-g8e2863d FAIL(X) os/390 23.00 (2817/)
________________________________
Yes , renaming a file solves the problem.
in the archive lib.tar.gz is this testcase problem xlc
------------------------------------------------------------------------
Yaroslav Kuzmin
Developer C/C++ ,z/OS , Linux
3 Zhukovskiy Street ・ Miass, Chelyabinsk region 456318 ・ Russia
Tel: +7.922.2.38.33.38
Email: [email protected]
Web: www.rocketsoftware.com
________________________________
От: John Goodyear <[email protected]>
Отправлено: 12 марта 2015 г. 16:46
Кому: Yaroslav Kuzmin
Копия: Karl Williamson
Тема: Re: НА: Smoke [ebcdic] v5.21.9-247-g8e2863d FAIL(X) os/390 23.00 (2817/)
Yaroslav,
Good to hear you understand the problem better. Do you think renaming the file is a reasonable solution?
If not, then I think you would have to open a PMR against the compiler if you want to dig into why the symbols are getting hidden. If you hand them the Perl source and say build it, I don't know what their response would be. You would likely need to provide a simplified testcase to get the issue addressed in a reasonable amount of time.
Regards,
John Goodyear
zGrowth and System z Applied Technologies
Gaithersburg, MD
[email protected]
[Inactive hide details for Yaroslav Kuzmin ---03/12/2015 04:55:07 AM---The problem with the module mro solved. It is necessary t]Yaroslav Kuzmin ---03/12/2015 04:55:07 AM---The problem with the module mro solved. It is necessary that the file names do not match. example mr
From: Yaroslav Kuzmin <[email protected]>
To: Karl Williamson <[email protected]>, Perl5 Porters <[email protected]>, perl-mvs <[email protected]>
Date: 03/12/2015 04:55 AM
Subject: НА: Smoke [ebcdic] v5.21.9-247-g8e2863d FAIL(X) os/390 23.00 (2817/)
________________________________
The problem with the module mro solved. It is necessary that the file names do not match. example mro_t.c и ext/mro/mro.c
I tested on branch khw/ebcdic
Change the file name mro.c on mro_t.c made changes to files Makefile.SH Makefile.micro MANIFEST
change define EBCDIC on EBCDIC_T in files mro_t.c and ext/mro/mro.c
all work
То есть особенность компилятора xlc он не может обработать перекрестный вызов в функциях и совпадение имен файлов где находятся эти функции. По отдельности работает корректно .
------------------------------------------------------------------------
Yaroslav Kuzmin
Developer C/C++ ,z/OS , Linux
3 Zhukovskiy Street ・ Miass, Chelyabinsk region 456318 ・ Russia
Tel: +7.922.2.38.33.38
Email: [email protected]
Web: www.rocketsoftware.com
________________________________________
От: Yaroslav Kuzmin <[email protected]>
Отправлено: 11 марта 2015 г. 10:13
Кому: Karl Williamson; Perl5 Porters; perl-mvs
Тема: НА: Smoke [ebcdic] v5.21.9-247-g8e2863d FAIL(X) os/390 23.00 (2817/)
> But, there is one remaining large issue, which is the mro handling. We
> need to reconcile this before that goes into blead. What I recall my
> $work doing in this sort of situation 35 years ago was to mention the .o
> files that had cross references multiple times in the load line. I also
> asked someone I know who works at IBM if he knew anything about this,
> and potential workarounds. He wrote a program (attached) based on your
> description, and did not have the problems you have, using z/OS 2.1.
Ok , This example works correctly on z/OS
But testing in Perl
I changed #define EBCDIC on #define _EBCDIC_ in files mro.c и ext/mro/mro.xs
An error has occurred, see where there are libraries lib/auto/mro/mro.a и libperl.a
(00:50) RS12 : PDKUZM | ~/ussport/perl/perl-build :> xlc -o perl -qxplink -qdll perlmain.o libperl.a lib/auto/B/B.a lib/auto/Compress/Raw/Bzip2/Bzip2.a lib/auto/Compress/Raw/Zlib/Zlib.a lib/auto/Cwd/Cwd.a lib/auto/Data/Dumper/Dumper.a lib/auto/Devel/PPPort/PPPort.a lib/auto/Devel/Peek/Peek.a lib/auto/Digest/MD5/MD5.a lib/auto/Digest/SHA/SHA.a lib/auto/Encode/Encode.a lib/auto/Fcntl/Fcntl.a lib/auto/File/DosGlob/DosGlob.a lib/auto/File/Glob/Glob.a lib/auto/Filter/Util/Call/Call.a lib/auto/Hash/Util/Util.a lib/auto/Hash/Util/FieldHash/FieldHash.a lib/auto/I18N/Langinfo/Langinfo.a lib/auto/IO/IO.a lib/auto/IPC/SysV/SysV.a lib/auto/List/Util/Util.a lib/auto/MIME/Base64/Base64.a lib/auto/Math/BigInt/FastCalc/FastCalc.a lib/auto/NDBM_File/NDBM_File.a lib/auto/Opcode/Opcode.a lib/auto/POSIX/POSIX.a lib/auto/PerlIO/encoding/encoding.a lib/auto/PerlIO/mmap/mmap.a lib/auto/PerlIO/scalar/scalar.a lib/auto/PerlIO/via/via.a lib/auto/SDBM_File/SDBM_File.a lib/auto/Socket/Socket.a lib/auto/Storable/Storable.a lib/auto/Sys/Hostname/Hostname.a lib/auto/Sys/Syslog/Syslog.a lib/auto/Tie/Hash/NamedCapture/NamedCapture.a lib/auto/Time/HiRes/HiRes.a lib/auto/Time/Piece/Piece.a lib/auto/Unicode/Collate/Collate.a lib/auto/arybase/arybase.a lib/auto/attributes/attributes.a lib/auto/mro/mro.a lib/auto/re/re.a lib/auto/threads/threads.a lib/auto/threads/shared/shared.a lib/auto/Encode/Byte/Byte.a lib/auto/Encode/CN/CN.a lib/auto/Encode/EBCDIC/EBCDIC.a lib/auto/Encode/JP/JP.a lib/auto/Encode/KR/KR.a lib/auto/Encode/Symbol/Symbol.a lib/auto/Encode/TW/TW.a lib/auto/Encode/Unicode/Unicode.a `cat ext.libs` -lm -lc
IEW2459W 9206 INCLUDED MEMBER boot_mro FAILED TO RESOLVE REFERENCE.
IEW2497W 9229 THE SYMBOL boot_mro WAS EXPECTED TO BE RESOLVED BY INCLUDING
MEMBER mro.o FROM THE LIBRARY DEFINED BY DDNAME /000002B
IEW2456E 9207 SYMBOL boot_mro UNRESOLVED. MEMBER COULD NOT BE INCLUDED FROM
THE DESIGNATED CALL LIBRARY.
FSUM3065 The LINKEDIT step ended with return code 8.
Now swap the libraries lib/auto/mro/mro.a и libperl.a
(00:51) RS12 : PDKUZM | ~/ussport/perl/perl-build :> xlc -o perl -qxplink -qdll perlmain.o lib/auto/mro/mro.a libperl.a lib/auto/B/B.a lib/auto/Compress/Raw/Bzip2/Bzip2.a lib/auto/Compress/Raw/Zlib/Zlib.a lib/auto/Cwd/Cwd.a lib/auto/Data/Dumper/Dumper.a lib/auto/Devel/PPPort/PPPort.a lib/auto/Devel/Peek/Peek.a lib/auto/Digest/MD5/MD5.a lib/auto/Digest/SHA/SHA.a lib/auto/Encode/Encode.a lib/auto/Fcntl/Fcntl.a lib/auto/File/DosGlob/DosGlob.a lib/auto/File/Glob/Glob.a lib/auto/Filter/Util/Call/Call.a lib/auto/Hash/Util/Util.a lib/auto/Hash/Util/FieldHash/FieldHash.a lib/auto/I18N/Langinfo/Langinfo.a lib/auto/IO/IO.a lib/auto/IPC/SysV/SysV.a lib/auto/List/Util/Util.a lib/auto/MIME/Base64/Base64.a lib/auto/Math/BigInt/FastCalc/FastCalc.a lib/auto/NDBM_File/NDBM_File.a lib/auto/Opcode/Opcode.a lib/auto/POSIX/POSIX.a lib/auto/PerlIO/encoding/encoding.a lib/auto/PerlIO/mmap/mmap.a lib/auto/PerlIO/scalar/scalar.a lib/auto/PerlIO/via/via.a lib/auto/SDBM_File/SDBM_File.a lib/auto/Socket/Socket.a lib/auto/Storable/Storable.a lib/auto/Sys/Hostname/Hostname.a lib/auto/Sys/Syslog/Syslog.a lib/auto/Tie/Hash/NamedCapture/NamedCapture.a lib/auto/Time/HiRes/HiRes.a lib/auto/Time/Piece/Piece.a lib/auto/Unicode/Collate/Collate.a lib/auto/arybase/arybase.a lib/auto/attributes/attributes.a lib/auto/re/re.a lib/auto/threads/threads.a lib/auto/threads/shared/shared.a lib/auto/Encode/Byte/Byte.a lib/auto/Encode/CN/CN.a lib/auto/Encode/EBCDIC/EBCDIC.a lib/auto/Encode/JP/JP.a lib/auto/Encode/KR/KR.a lib/auto/Encode/Symbol/Symbol.a lib/auto/Encode/TW/TW.a lib/auto/Encode/Unicode/Unicode.a `cat ext.libs` -lm -lc
IEW2459W 9206 INCLUDED MEMBER Perl_mro_register FAILED TO RESOLVE REFERENCE.
IEW2497W 9229 THE SYMBOL Perl_mro_register WAS EXPECTED TO BE RESOLVED BY
INCLUDING MEMBER mro.o FROM THE LIBRARY DEFINED BY DDNAME /0000003
IEW2459W 9206 INCLUDED MEMBER Perl_mro_meta_init FAILED TO RESOLVE REFERENCE.
IEW2497W 9229 THE SYMBOL Perl_mro_meta_init WAS EXPECTED TO BE RESOLVED BY
INCLUDING MEMBER mro.o FROM THE LIBRARY DEFINED BY DDNAME /0000003
IEW2459W 9206 INCLUDED MEMBER Perl_mro_get_private_data FAILED TO RESOLVE
REFERENCE.
IEW2497W 9229 THE SYMBOL Perl_mro_get_private_data WAS EXPECTED TO BE RESOLVED
BY INCLUDING MEMBER mro.o FROM THE LIBRARY DEFINED BY DDNAME
/0000003
IEW2459W 9206 INCLUDED MEMBER Perl_mro_set_private_data FAILED TO RESOLVE
REFERENCE.
IEW2497W 9229 THE SYMBOL Perl_mro_set_private_data WAS EXPECTED TO BE RESOLVED
BY INCLUDING MEMBER mro.o FROM THE LIBRARY DEFINED BY DDNAME
/0000003
IEW2459W 9206 INCLUDED MEMBER Perl_mro_get_linear_isa FAILED TO RESOLVE
REFERENCE.
IEW2497W 9229 THE SYMBOL Perl_mro_get_linear_isa WAS EXPECTED TO BE RESOLVED BY
INCLUDING MEMBER mro.o FROM THE LIBRARY DEFINED BY DDNAME /0000003
IEW2459W 9206 INCLUDED MEMBER Perl_mro_method_changed_in FAILED TO RESOLVE
REFERENCE.
IEW2497W 9229 THE SYMBOL Perl_mro_method_changed_in WAS EXPECTED TO BE RESOLVED
BY INCLUDING MEMBER mro.o FROM THE LIBRARY DEFINED BY DDNAME
/0000003
IEW2459W 9206 INCLUDED MEMBER Perl_mro_package_moved FAILED TO RESOLVE
REFERENCE.
IEW2497W 9229 THE SYMBOL Perl_mro_package_moved WAS EXPECTED TO BE RESOLVED BY
INCLUDING MEMBER mro.o FROM THE LIBRARY DEFINED BY DDNAME /0000003
IEW2459W 9206 INCLUDED MEMBER Perl_mro_isa_changed_in FAILED TO RESOLVE
REFERENCE.
IEW2497W 9229 THE SYMBOL Perl_mro_isa_changed_in WAS EXPECTED TO BE RESOLVED BY
INCLUDING MEMBER mro.o FROM THE LIBRARY DEFINED BY DDNAME /0000003
IEW2459W 9206 INCLUDED MEMBER Perl_boot_core_mro FAILED TO RESOLVE REFERENCE.
IEW2497W 9229 THE SYMBOL Perl_boot_core_mro WAS EXPECTED TO BE RESOLVED BY
INCLUDING MEMBER mro.o FROM THE LIBRARY DEFINED BY DDNAME /0000003
IEW2456E 9207 SYMBOL Perl_mro_set_private_data UNRESOLVED. MEMBER COULD NOT BE
INCLUDED FROM THE DESIGNATED CALL LIBRARY.
IEW2456E 9207 SYMBOL Perl_mro_get_private_data UNRESOLVED. MEMBER COULD NOT BE
INCLUDED FROM THE DESIGNATED CALL LIBRARY.
IEW2456E 9207 SYMBOL Perl_mro_meta_init UNRESOLVED. MEMBER COULD NOT BE
INCLUDED FROM THE DESIGNATED CALL LIBRARY.
IEW2456E 9207 SYMBOL Perl_mro_register UNRESOLVED. MEMBER COULD NOT BE
INCLUDED FROM THE DESIGNATED CALL LIBRARY.
IEW2456E 9207 SYMBOL Perl_boot_core_mro UNRESOLVED. MEMBER COULD NOT BE
INCLUDED FROM THE DESIGNATED CALL LIBRARY.
IEW2456E 9207 SYMBOL Perl_mro_isa_changed_in UNRESOLVED. MEMBER COULD NOT BE
INCLUDED FROM THE DESIGNATED CALL LIBRARY.
IEW2456E 9207 SYMBOL Perl_mro_package_moved UNRESOLVED. MEMBER COULD NOT BE
INCLUDED FROM THE DESIGNATED CALL LIBRARY.
IEW2456E 9207 SYMBOL Perl_mro_method_changed_in UNRESOLVED. MEMBER COULD NOT
BE INCLUDED FROM THE DESIGNATED CALL LIBRARY.
IEW2456E 9207 SYMBOL Perl_mro_get_linear_isa UNRESOLVED. MEMBER COULD NOT BE
INCLUDED FROM THE DESIGNATED CALL LIBRARY.
FSUM3065 The LINKEDIT step ended with return code 8.
errors
IEW2456E http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2M8C1/SPTKK2456E
IEW2497W http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2M8C1/SPTOB12516
IEW2459W http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2M8C1/SPTKK2459W
FSUM3065 http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/BPXZA8C0/SPTOB63267
As that so :)
------------------------------------------------------------------------
Yaroslav Kuzmin
Developer C/C++ ,z/OS , Linux
3 Zhukovskiy Street ・ Miass, Chelyabinsk region 456318 ・ Russia
Tel: +7.922.2.38.33.38
Email: [email protected]
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 C [email protected]
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.
================================
Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ +1 800.966.3270 ■ +1 781.577.4321
Unsubscribe From Commercial Email C [email protected]
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.
================================
Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ +1 800.966.3270 ■ +1 781.577.4321
Unsubscribe From Commercial Email C [email protected]
Manage Your Subscription Preferences - http://info.rocketsoftware.com/GlobalSubscriptionManagementEmailFooter_SubscriptionCenter.html
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy
================================
================================
Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ +1 800.966.3270 ■ +1 781.577.4321
Unsubscribe From Commercial Email C [email protected]
Manage Your Subscription Preferences - http://info.rocketsoftware.com/GlobalSubscriptionManagementEmailFooter_SubscriptionCenter.html
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy
================================
graycol.gif
(image/gif, 105 B) - not displayed
mro.c.patch
(text/x-patch, 378 B)
diff --git a/mro.c b/mro.c index d501681..78f8e5f 100644 --- a/mro.c +++ b/mro.c @@ -22,6 +22,12 @@ These functions are related to the method resolution order of perl classes =cut */ +#ifdef EBCDIC +#pragma csect(CODE,"main#mro#C") +#pragma csect(STATIC,"main#mro#S") +#pragma csect(TEST,"main#mro#T") +#endif + #include "EXTERN.h" #define PERL_IN_MRO_C #include "perl.h"