Print this page
4843 add --as-needed and --no-as-needed to ld


 443                             0) {
 444                                 optarg = (char *)MSG_ORIG(MSG_ARG_RESCAN_START);
 445                                 return (c);
 446                         }
 447                         break;
 448                 case ')':
 449                         /*
 450                          * Translate -) to -z rescan-end
 451                          */
 452                         if ((c = str2chr(lml, ndx, argc, argv,
 453                             arg, 'z', MSG_ORIG(MSG_ARG_T_CPAR), 0, NULL)) !=
 454                             0) {
 455                                 optarg = (char *)MSG_ORIG(MSG_ARG_RESCAN_END);
 456                                 return (c);
 457                         }
 458                         break;
 459                 case '-':
 460                         switch (*(arg + 1)) {
 461                         case 'a':
 462                                 /*










 463                                  * Translate --allow-multiple-definition to
 464                                  * -zmuldefs
 465                                  */
 466                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
 467                                     MSG_ORIG(MSG_ARG_T_MULDEFS), 0, NULL)) !=
 468                                     0) {
 469                                         optarg =
 470                                             (char *)MSG_ORIG(MSG_ARG_MULDEFS);
 471                                         return (c);
 472 
 473                                 /*
 474                                  * Translate --auxiliary <optarg> to
 475                                  * -f <optarg>
 476                                  */
 477                                 } else if ((c = str2chr(lml, argc, ndx, argv,
 478                                     arg, 'f', MSG_ORIG(MSG_ARG_T_AUXFLTR),
 479                                     MSG_ARG_T_AUXFLTR_SIZE, NULL)) != 0) {
 480                                         return (c);
 481                                 }
 482                                 break;
 483                         case 'd':
 484                                 /*
 485                                  * Translate --dynamic-linker <optarg> to
 486                                  * -I <optarg>
 487                                  */
 488                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'I',
 489                                     MSG_ORIG(MSG_ARG_T_INTERP),
 490                                     MSG_ARG_T_INTERP_SIZE, NULL)) != 0) {
 491                                         return (c);
 492                                 }
 493                                 break;
 494                         case 'e':
 495                                 /* Translate --entry <optarg> to -e <optarg> */
 496                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'e',
 497                                     MSG_ORIG(MSG_ARG_T_ENTRY),


 541                                 /*
 542                                  * Translate --library <optarg> to -l <optarg>
 543                                  */
 544                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'l',
 545                                     MSG_ORIG(MSG_ARG_T_LIBRARY),
 546                                     MSG_ARG_T_LIBRARY_SIZE, NULL)) != 0) {
 547                                         return (c);
 548 
 549                                 /*
 550                                  * Translate --library-path <optarg> to
 551                                  * -L <optarg>
 552                                  */
 553                                 } else if ((c = str2chr(lml, ndx, argc, argv,
 554                                     arg, 'L', MSG_ORIG(MSG_ARG_T_LIBPATH),
 555                                     MSG_ARG_T_LIBPATH_SIZE, NULL)) != 0) {
 556                                         return (c);
 557                                 }
 558                                 break;
 559                         case 'n':
 560                                 /*










 561                                  * Translate --no-fatal-warnings to
 562                                  * -z nofatal-warnings.
 563                                  */
 564                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
 565                                     MSG_ORIG(MSG_ARG_T_NOFATWARN),
 566                                     0, NULL)) != 0) {
 567                                         optarg = (char *)
 568                                             MSG_ORIG(MSG_ARG_NOFATWARN);
 569                                         return (c);
 570                                 }
 571 
 572                                 /* Translate --no-undefined to -zdefs */
 573                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
 574                                     MSG_ORIG(MSG_ARG_T_NOUNDEF), 0, NULL)) !=
 575                                     0) {
 576                                         optarg = (char *)MSG_ORIG(MSG_ARG_DEFS);
 577                                         return (c);
 578 
 579                                 /*
 580                                  * Translate --no-whole-archive to




 443                             0) {
 444                                 optarg = (char *)MSG_ORIG(MSG_ARG_RESCAN_START);
 445                                 return (c);
 446                         }
 447                         break;
 448                 case ')':
 449                         /*
 450                          * Translate -) to -z rescan-end
 451                          */
 452                         if ((c = str2chr(lml, ndx, argc, argv,
 453                             arg, 'z', MSG_ORIG(MSG_ARG_T_CPAR), 0, NULL)) !=
 454                             0) {
 455                                 optarg = (char *)MSG_ORIG(MSG_ARG_RESCAN_END);
 456                                 return (c);
 457                         }
 458                         break;
 459                 case '-':
 460                         switch (*(arg + 1)) {
 461                         case 'a':
 462                                 /*
 463                                  * Translate --as-needed to -zignore
 464                                  */
 465                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
 466                                     MSG_ORIG(MSG_ARG_T_ASNEEDED), 0, NULL)) !=
 467                                     0) {
 468                                         optarg =
 469                                             (char *)MSG_ORIG(MSG_ARG_IGNORE);
 470                                         return (c);
 471                                 }
 472                                 /*
 473                                  * Translate --allow-multiple-definition to
 474                                  * -zmuldefs
 475                                  */
 476                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
 477                                     MSG_ORIG(MSG_ARG_T_MULDEFS), 0, NULL)) !=
 478                                     0) {
 479                                         optarg =
 480                                             (char *)MSG_ORIG(MSG_ARG_MULDEFS);
 481                                         return (c);
 482                                 }
 483                                 /*
 484                                  * Translate --auxiliary <optarg> to
 485                                  * -f <optarg>
 486                                  */
 487                                 if ((c = str2chr(lml, argc, ndx, argv,
 488                                     arg, 'f', MSG_ORIG(MSG_ARG_T_AUXFLTR),
 489                                     MSG_ARG_T_AUXFLTR_SIZE, NULL)) != 0) {
 490                                         return (c);
 491                                 }
 492                                 break;
 493                         case 'd':
 494                                 /*
 495                                  * Translate --dynamic-linker <optarg> to
 496                                  * -I <optarg>
 497                                  */
 498                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'I',
 499                                     MSG_ORIG(MSG_ARG_T_INTERP),
 500                                     MSG_ARG_T_INTERP_SIZE, NULL)) != 0) {
 501                                         return (c);
 502                                 }
 503                                 break;
 504                         case 'e':
 505                                 /* Translate --entry <optarg> to -e <optarg> */
 506                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'e',
 507                                     MSG_ORIG(MSG_ARG_T_ENTRY),


 551                                 /*
 552                                  * Translate --library <optarg> to -l <optarg>
 553                                  */
 554                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'l',
 555                                     MSG_ORIG(MSG_ARG_T_LIBRARY),
 556                                     MSG_ARG_T_LIBRARY_SIZE, NULL)) != 0) {
 557                                         return (c);
 558 
 559                                 /*
 560                                  * Translate --library-path <optarg> to
 561                                  * -L <optarg>
 562                                  */
 563                                 } else if ((c = str2chr(lml, ndx, argc, argv,
 564                                     arg, 'L', MSG_ORIG(MSG_ARG_T_LIBPATH),
 565                                     MSG_ARG_T_LIBPATH_SIZE, NULL)) != 0) {
 566                                         return (c);
 567                                 }
 568                                 break;
 569                         case 'n':
 570                                 /*
 571                                  * Translate --no-as-needed to -zrecord
 572                                  */
 573                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
 574                                     MSG_ORIG(MSG_ARG_T_NOASNEEDED), 0, NULL)) !=
 575                                     0) {
 576                                         optarg =
 577                                             (char *)MSG_ORIG(MSG_ARG_RECORD);
 578                                         return (c);
 579                                 }
 580                                 /*
 581                                  * Translate --no-fatal-warnings to
 582                                  * -z nofatal-warnings.
 583                                  */
 584                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
 585                                     MSG_ORIG(MSG_ARG_T_NOFATWARN),
 586                                     0, NULL)) != 0) {
 587                                         optarg = (char *)
 588                                             MSG_ORIG(MSG_ARG_NOFATWARN);
 589                                         return (c);
 590                                 }
 591 
 592                                 /* Translate --no-undefined to -zdefs */
 593                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
 594                                     MSG_ORIG(MSG_ARG_T_NOUNDEF), 0, NULL)) !=
 595                                     0) {
 596                                         optarg = (char *)MSG_ORIG(MSG_ARG_DEFS);
 597                                         return (c);
 598 
 599                                 /*
 600                                  * Translate --no-whole-archive to