ZOSOpenTools / gettextport

Apache License 2.0
0 stars 1 forks source link

gettext doesn't build clean #1

Closed ZOSOpenTools closed 2 years ago

ZOSOpenTools commented 2 years ago

Build doesn't complete. After running build.sh, you will see a failure. To dig into the link error,

cd gettext-0.21/gettext-tools/src
/bin/bash ../libtool  --tag=CC   --mode=link xlclang   -qascii    -o msgmerge msgmerge-msgmerge.o msgmerge-msgl-fsearch.o msgmerge-lang-table.o msgmerge-plural-count.o libgettextsrc.la

This should give you:

/bin/bash ../libtool  --tag=CC   --mode=link xlclang   -qascii    -o msgmerge msgmerge-msgmerge.o msgmerg>
libtool: link: xlclang -qascii -o msgmerge msgmerge-msgmerge.o msgmerge-msgl-fsearch.o msgmerge-lang-table.o msgmerge-plural-count.o  ./.libs/libgettextsrc.a /fultonm/dev/gettextport/gettext-0.21/gettext-tools/gnulib-lib/.libs/libgettextlib.a /fultonm/dev/gettextport/gettext-0.21/libtextstyle/lib/.libs/libtextstyle.a -lcurses /fultonm/dev/gettextport/gettext-0.21/gettext-tools/intl/.libs/libintl.a -lc
 IEW2459W 9206 INCLUDED MEMBER glthread_once_multithreaded FAILED TO RESOLVE    
          REFERENCE.                                                            
 IEW2497W 9229 THE SYMBOL glthread_once_multithreaded WAS EXPECTED TO BE        
          RESOLVED BY INCLUDING MEMBER lock.o FROM THE LIBRARY DEFINED BY       
          DDNAME /0000007                                                       
 IEW2456E 9207 SYMBOL glthread_once_multithreaded UNRESOLVED.  MEMBER COULD NOT 
          BE INCLUDED FROM THE DESIGNATED CALL LIBRARY.                         
FSUM3065 The LINKEDIT step ended with return code 8.
MikeFultonDev commented 2 years ago

Passing -Wl,map to libtool, we can see:

 /0000007  /fultonm/dev/gettextport/gettext-0.21/libtextstyle/lib/.libs/libtextstyle.a

Doing an 'nm' of the archive, we get:

lock.o:
          0 U @@PT3MD
          0 U @@PT3MI
          0 U @@PT3ML
          0 U @@PT3MU
          0 U @@PT3O
          0 U @@PT3TS
          0 U @@PT3XI
          0 U @@PT3XS
          0 d B_IDRL
          0 U CELQSG03
          0 U CELQSTRT
          0 d C_@@QPPA2
          0 d C_CODE64
          0 d C_COPTIONS
          0 d C_WSA64
          0 T glthread_once_multithreaded
          0 T glthread_once_singlethreaded
          0 T glthread_recursive_lock_destroy_multithreaded
          0 T glthread_recursive_lock_init_multithreaded
          0 T glthread_recursive_lock_lock_multithreaded
          0 T glthread_recursive_lock_unlock_multithreaded
          0 T lock#C
          0 d lock#C
          0 D lock#S
          0 d private
MikeFultonDev commented 2 years ago

From [Barry Lichtenstein]
Checking out the error message via: (https://www.ibm.com/docs/en/zos/2.5.0?topic=iew2999-iew2497w) a possible area of problem could be in the CSECT name... In addition to the LIST, Barry (below) mentions LIST=ALL and MSGLEVEL=0 should be used to get details

So in addition to MSGLEVEL=0 you need LIST=ALL (due to a lot of back & forth over the years on certain messages that to most of z/OS were not helpful)... Using MSGLEVEL=0,LIST=ALL, on the 2nd instance of the CSECT you'll see something like this.

 IEW2308I 1112 SECTION this_is_a_long_name HAS BEEN MERGED.    <<<<<
 IEW2308I 1112 SECTION world HAS BEEN MERGED.
 IEW2308I 1112 SECTION CEEMAIN HAS BEEN MERGED.
 IEW2413I 5691 SECTION CEESTART FROM DATASET *NOT_AVAILABLE* IS A DUPLICATE AND
          HAS NOT BEEN ADDED.
 IEW2413I 5691 SECTION this_is_a_long_name FROM DATASET *NOT_AVAILABLE* IS A
          DUPLICATE AND HAS NOT BEEN ADDED.                    <<<<<
MikeFultonDev commented 2 years ago

fixed by changing build to use -qnocsect