Print this page
5595 libzpool won't build with a studio primary

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/ctf/cvt/ctfmerge.c
          +++ new/usr/src/tools/ctf/cvt/ctfmerge.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   26  /*
  29   27   * Given several files containing CTF data, merge and uniquify that data into
  30   28   * a single CTF section in an output file.
  31   29   *
  32   30   * Merges can proceed independently.  As such, we perform the merges in parallel
  33   31   * using a worker thread model.  A given glob of CTF data (either all of the CTF
  34   32   * data from a single input file, or the result of one or more merges) can only
  35   33   * be involved in a single merge at any given time, so the process decreases in
  36   34   * parallelism, especially towards the end, as more and more files are
  37   35   * consolidated, finally resulting in a single merge of two large CTF graphs.
↓ open down ↓ 557 lines elided ↑ open up ↑
 595  593          if (outfile == NULL)
 596  594                  return;
 597  595  
 598  596          if (dounlink) {
 599  597                  fprintf(stderr, "Removing %s\n", outfile);
 600  598                  unlink(outfile);
 601  599          }
 602  600  }
 603  601  
 604  602  static void
 605      -copy_ctf_data(char *srcfile, char *destfile, int keep_stabs)
      603 +copy_ctf_data(char *srcfile, char *destfile)
 606  604  {
 607  605          tdata_t *srctd;
 608  606  
 609  607          if (read_ctf(&srcfile, 1, NULL, read_ctf_save_cb, &srctd, 1) == 0)
 610  608                  terminate("No CTF data found in source file %s\n", srcfile);
 611  609  
 612  610          tmpname = mktmpname(destfile, ".ctf");
 613      -        write_ctf(srctd, destfile, tmpname, CTF_COMPRESS | keep_stabs);
      611 +        write_ctf(srctd, destfile, tmpname, CTF_COMPRESS);
 614  612          if (rename(tmpname, destfile) != 0) {
 615  613                  terminate("Couldn't rename temp file %s to %s", tmpname,
 616  614                      destfile);
 617  615          }
 618  616          free(tmpname);
 619  617          tdata_free(srctd);
 620  618  }
 621  619  
 622  620  static void
 623  621  wq_init(workqueue_t *wq, int nfiles)
↓ open down ↓ 110 lines elided ↑ open up ↑
 734  732  int
 735  733  main(int argc, char **argv)
 736  734  {
 737  735          tdata_t *mstrtd, *savetd;
 738  736          char *uniqfile = NULL, *uniqlabel = NULL;
 739  737          char *withfile = NULL;
 740  738          char *label = NULL;
 741  739          char **ifiles, **tifiles;
 742  740          int verbose = 0, docopy = 0;
 743  741          int write_fuzzy_match = 0;
 744      -        int keep_stabs = 0;
 745  742          int require_ctf = 0;
 746  743          int nifiles, nielems;
 747  744          int c, i, idx, tidx, err;
 748  745  
 749  746          progname = basename(argv[0]);
 750  747  
 751  748          if (getenv("CTFMERGE_DEBUG_LEVEL"))
 752  749                  debug_level = atoi(getenv("CTFMERGE_DEBUG_LEVEL"));
 753  750  
 754  751          err = 0;
 755      -        while ((c = getopt(argc, argv, ":cd:D:fgl:L:o:tvw:s")) != EOF) {
      752 +        while ((c = getopt(argc, argv, ":cd:D:fl:L:o:tvw:s")) != EOF) {
 756  753                  switch (c) {
 757  754                  case 'c':
 758  755                          docopy = 1;
 759  756                          break;
 760  757                  case 'd':
 761  758                          /* Uniquify against `uniqfile' */
 762  759                          uniqfile = optarg;
 763  760                          break;
 764  761                  case 'D':
 765  762                          /* Uniquify against label `uniqlabel' in `uniqfile' */
 766  763                          uniqlabel = optarg;
 767  764                          break;
 768  765                  case 'f':
 769  766                          write_fuzzy_match = CTF_FUZZY_MATCH;
 770  767                          break;
 771      -                case 'g':
 772      -                        keep_stabs = CTF_KEEP_STABS;
 773      -                        break;
 774  768                  case 'l':
 775  769                          /* Label merged types with `label' */
 776  770                          label = optarg;
 777  771                          break;
 778  772                  case 'L':
 779  773                          /* Label merged types with getenv(`label`) */
 780  774                          if ((label = getenv(optarg)) == NULL)
 781  775                                  label = CTF_DEFAULT_LABEL;
 782  776                          break;
 783  777                  case 'o':
↓ open down ↓ 42 lines elided ↑ open up ↑
 826  820  
 827  821                  if (argc - optind == 0)
 828  822                          err++;
 829  823          }
 830  824  
 831  825          if (err) {
 832  826                  usage();
 833  827                  exit(2);
 834  828          }
 835  829  
 836      -        if (getenv("STRIPSTABS_KEEP_STABS") != NULL)
 837      -                keep_stabs = CTF_KEEP_STABS;
 838      -
 839  830          if (uniqfile && access(uniqfile, R_OK) != 0) {
 840  831                  warning("Uniquification file %s couldn't be opened and "
 841  832                      "will be ignored.\n", uniqfile);
 842  833                  uniqfile = NULL;
 843  834          }
 844  835          if (withfile && access(withfile, R_OK) != 0) {
 845  836                  warning("With file %s couldn't be opened and will be "
 846  837                      "ignored.\n", withfile);
 847  838                  withfile = NULL;
 848  839          }
 849  840          if (outfile && access(outfile, R_OK|W_OK) != 0)
 850  841                  terminate("Cannot open output file %s for r/w", outfile);
 851  842  
 852  843          /*
 853  844           * This is ugly, but we don't want to have to have a separate tool
 854  845           * (yet) just for copying an ELF section with our specific requirements,
 855  846           * so we shoe-horn a copier into ctfmerge.
 856  847           */
 857  848          if (docopy) {
 858      -                copy_ctf_data(argv[optind], argv[optind + 1], keep_stabs);
      849 +                copy_ctf_data(argv[optind], argv[optind + 1]);
 859  850  
 860  851                  exit(0);
 861  852          }
 862  853  
 863  854          set_terminate_cleanup(terminate_cleanup);
 864  855  
 865  856          /* Sort the input files and strip out duplicates */
 866  857          nifiles = argc - optind;
 867  858          ifiles = xmalloc(sizeof (char *) * nifiles);
 868  859          tifiles = xmalloc(sizeof (char *) * nifiles);
↓ open down ↓ 123 lines elided ↑ open up ↑
 992  983                   * output file.
 993  984                   */
 994  985                  tdata_label_free(mstrtd);
 995  986                  tdata_label_add(mstrtd, label, CTF_LABEL_LASTIDX);
 996  987  
 997  988                  savetd = mstrtd;
 998  989          }
 999  990  
1000  991          tmpname = mktmpname(outfile, ".ctf");
1001  992          write_ctf(savetd, outfile, tmpname,
1002      -            CTF_COMPRESS | write_fuzzy_match | dynsym | keep_stabs);
      993 +            CTF_COMPRESS | write_fuzzy_match | dynsym);
1003  994          if (rename(tmpname, outfile) != 0)
1004  995                  terminate("Couldn't rename output temp file %s", tmpname);
1005  996          free(tmpname);
1006  997  
1007  998          return (0);
1008  999  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX