home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sun / admin / 9749 < prev    next >
Encoding:
Internet Message Format  |  1992-12-28  |  7.1 KB

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!mcsun!sunic!sics.se!eua.ericsson.se!erix.ericsson.se!per
  2. From: per@erix.ericsson.se (Per Hedeland)
  3. Newsgroups: comp.sys.sun.admin
  4. Subject: Re: : Re FIX for slow rebinding of NIS
  5. Message-ID: <1992Dec28.144904.11625@eua.ericsson.se>
  6. Date: 28 Dec 92 14:49:04 GMT
  7. References: <1992Dec23.203057.17657@netnews.whoi.edu>
  8. Sender: news@eua.ericsson.se
  9. Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
  10. Lines: 191
  11. Nntp-Posting-Host: super.eua.ericsson.se
  12. Nntp-Posting-User: per
  13.  
  14. In article <1992Dec23.203057.17657@netnews.whoi.edu> eklein@whsun1.wh.whoi.edu (Edgar Kleindinst) writes:
  15. >The only problem I've found is when I compile a program using 
  16. >either gnu or cc I get this error
  17. >
  18. >ld: Undefined symbol
  19. >   __mbstowcs_xccs
  20. >   __mbtowc_xccs
  21. >   __wcstombs_xccs
  22. >   __wctomb_xccs
  23.  
  24. Sigh... I don't suppose Sun will ever get the /usr/lib/shlib.etc/README
  25. file up-to-date - it certainly isn't as of 4.1.3. Below is a
  26. customized-for-DNS version of it by Greg Earle, via Hal Stern - I
  27. think... Check out item #3 (I think it said xccs_multibyte rather than
  28. xccs.multibyte originally, an understandable typo).
  29.  
  30. --Per Hedeland
  31.  
  32.  
  33. README------------------------------------------------------------------------
  34.     This is a procedure you can use to substitute or add 
  35. a module in your shared libc library. 
  36.  
  37. Note! If you are interested in a System V libc, please substitute
  38.     libcs5_pic.a for libc_pic.a in step 3, and
  39.     libcs5.so.x.y.z for libc.so.x.y.z in step 14.
  40.  
  41. -------------------------------------------------------------------------
  42.  
  43. 1. Become super user
  44.     % su
  45.  
  46. 2. Make a temporary directory
  47.     % mkdir tmp
  48.  
  49. 3. Change to the "tmp" directory just made, extract the pic .o from 
  50.    libc_pic.a and rm the file __.SYMDEF. The reason you need to do 
  51.    the 2 "mv" commands is because "ar" truncated filenames over 
  52.    16 characters.
  53.     % cd tmp
  54.     % ar x ../libc_pic.a
  55.     % rm __.SYMDEF
  56.     % mv rpc_dtablesize. rpc_dtablesize.o
  57.     % mv rpc_commondata. rpc_commondata.o
  58.     % mv xccs.multibyte. xccs.multibyte.o
  59.  
  60.    Note: this last mv command is not present in the original version of the
  61.    README file that comes in /usr/lib/shlib.etc/README.  If this step is
  62.    omitted, you will produce a shared libc.so that does not contain the
  63.    xccs.multibyte.o module.  This module contains versions of the library
  64.    functions "mbtowc", "wctomb", "mbstowcs" and "wcstombs" (see mblen(3) for
  65.    more info on these multi-byte character functions), which operate on the
  66.    Xerox XCCS codeset standard.  Specifically, the missing functions will be
  67.  
  68.     _mbtowc_xccs(pwc, s, n)
  69.     _wctomb_xccs(s, pwc)
  70.     _mbstowcs_xccs(pwc, s, n)
  71.     _wcstombs_xccs(s, pwc, n)
  72.  
  73.    These are called by the corresponding "mbtowc", "wctomb", "mbstowcs" and
  74.    "wcstombs" functions if the codeset is XCCS (other codesets include EUC,
  75.    ISO 2022, and a default).  In short, if you use any Internationalization
  76.    features and need to handle multi-byte character sets, do not forget this
  77.    step.
  78.  
  79. 4. If you are doing this to specifically create a libc.so that contains
  80.    the DNS resolver routines for doing hostname/hostaddr lookups via the
  81.    Domain Name Service (and not NIS/YP), do these additional steps.  If not,
  82.    please skip down to step 10.
  83.  
  84. 5. Extract the contents of /usr/lib/libresolv.a into the tmp directory:
  85.     % ar x /usr/lib/libresolv.a
  86.     % rm __.SYMDEF
  87.  
  88.    The libresolv.a contains object modules that are position
  89.    independant, so they can be added to the libc_pic modules without fear.
  90.  
  91.    NOTE: You may wish to install Sun patch 100465-01 *first* before taking
  92.    this step, as it provides a newer patched version of /usr/lib/libresolv.a.
  93.    This fixes a serious bug that causes DNS nameserver lookups to fail if the
  94.    first name server query yields ECONNREFUSED (Connection refused), even if
  95.    the other nameservers specified in /etc/resolv.conf are both up & working:
  96.  
  97. Patch i.d.    Bug i.d's    SunOS    Description
  98. ----------    ---------    -----    -----------
  99. 100465-01    1076977
  100.             4.1 4.1 4.1.2 DNS res_send() fails if first nameserver
  101.             in /etc/resolv.conf returns ECONNREFUSED
  102.  
  103. 6. Remove the old routine to do the hostname/addr resolution:
  104.     % rm gethostent.o
  105.  
  106. 7. Remove the libresolv module that contains `strncasecmp' (which is now
  107.    in the main C library, so it is redundant):
  108.     % rm strcasecmp.o
  109.  
  110. 8. As also mentioned below (in step 11), edit the file `lorder-sparc' in the ..
  111.    directory.  Remove the reference to `gethostent.o' and add the
  112.    references to the resolver library routines by applying this patch:
  113.  
  114.     % cd ..
  115.     % diff -rc2 lorder-sparc.orig lorder-sparc
  116.     *** lorder-sparc.orig   Thu Feb  8 05:27:46 1990
  117.     --- lorder-sparc    Mon Apr  9 12:58:59 1990
  118.     ***************
  119.     *** 150,154 ****
  120.       getwd.o
  121.       getnetgrent.o
  122.     ! gethostent.o
  123.       ypxdr.o
  124.       ttyname.o
  125.     --- 150,161 ----
  126.       getwd.o
  127.       getnetgrent.o
  128.     ! gethostnamadr.o
  129.     ! sethostent.o
  130.     ! res_query.o
  131.     ! res_mkquery.o
  132.     ! res_send.o
  133.     ! res_debug.o
  134.     ! res_comp.o
  135.     ! res_init.o
  136.       ypxdr.o
  137.       ttyname.o
  138.  
  139. 9. If you are running under SunOS 4.1.2, you will want to add the entry
  140.    "mblib.o" to the very end of the "lorder-sparc" file.  If you aren't running
  141.    SunOS 4.1.2, you may now skip down to step 13.
  142.  
  143.    Also, you will need to patch the Makefile, as follows:
  144.  
  145.     *** Makefile.orig    Wed Oct 23 10:13:00 1991
  146.     --- Makefile    Mon Feb 24 18:38:08 1992
  147.     ***************
  148.     *** 9,13 ****
  149.       
  150.       libc.so:
  151.     !     ld -assert pure-text `${OBJSORT} lorder-sparc tmp`
  152.           /bin/ls /usr/lib/libc.so.* > TMP_FILE
  153.           mv a.out libc.so.`cat TMP_FILE | awk -f ${AWKFILE}`
  154.     --- 9,13 ----
  155.       
  156.       libc.so:
  157.     !     ld -assert pure-text `${OBJSORT} lorder-sparc tmp` -ldl
  158.           /bin/ls /usr/lib/libc.so.* > TMP_FILE
  159.           mv a.out libc.so.`cat TMP_FILE | awk -f ${AWKFILE}`
  160.     ***************
  161.     *** 15,19 ****
  162.       
  163.       libcs5.so:
  164.     !     ld -assert pure-text `${OBJSORT} lorder-sparc tmp`
  165.           /bin/ls /usr/5lib/libc.so.* > TMP_FILE
  166.           mv a.out libc.so.`cat TMP_FILE | awk -f ${AWKFILE}`
  167.     --- 15,19 ----
  168.       
  169.       libcs5.so:
  170.     !     ld -assert pure-text `${OBJSORT} lorder-sparc tmp` -ldl
  171.           /bin/ls /usr/5lib/libc.so.* > TMP_FILE
  172.           mv a.out libc.so.`cat TMP_FILE | awk -f ${AWKFILE}`
  173.  
  174. 10. Replace or add the .o that you wanted by doing a copy. Please
  175.     note here that you are advised to create your object with
  176.     the following compiler option, i.e "cc -c -pic yourprogram.c" to make
  177.     it shareable.
  178.     % cp your.o .
  179.  
  180. 11. If you add a new module then you need to do this step.
  181.     You need to edit the file "lorder-sparc" and add the name of the file
  182.     you have copied from step 4 at the end of this file. 
  183.     % vi ../lorder-sparc
  184.  
  185. 12.     % cd ..
  186.  
  187. 13.     % make libc.so
  188.  
  189. 14. Now you should have some libc.so.x.y.z built in the current directory.
  190.     It is recommended that you tested out this library at this point 
  191.     before installing it. You can do so by setting the environment
  192.     LD_LIBRARY_PATH  to the current directory for example:
  193.        % setenv LD_LIBRARY_PATH `pwd`
  194.     % your_favorite_test_cmd
  195.     Once you are satisfied that the new library worked, you can proceed
  196.     to install it with the following commands:
  197.     % cp libc.so.x.y.z /usr/lib
  198.     % ldconfig
  199.     % unsetenv LD_LIBRARY_PATH
  200.  
  201. 15. You are now running with the new library.  You can verify this by
  202.     doing a trace command of, let's say, "date".
  203.     % trace date
  204.     The output should informed you that the new library is being used.
  205.