1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License (the "License").
   6 # You may not use this file except in compliance with the License.
   7 #
   8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9 # or http://www.opensolaris.org/os/licensing.
  10 # See the License for the specific language governing permissions
  11 # and limitations under the License.
  12 #
  13 # When distributing Covered Code, include this CDDL HEADER in each
  14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15 # If applicable, add the following below this CDDL HEADER, with the
  16 # fields enclosed by brackets "[]" replaced with your own identifying
  17 # information: Portions Copyright [yyyy] [name of copyright owner]
  18 #
  19 # CDDL HEADER END
  20 #
  21 #
  22 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  23 # Copyright (c) 2013, Joyent, Inc.  All rights reserved.
  24 # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
  25 #
  26 # Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  27 # Use is subject to license terms.
  28 #
  29 
  30 LIBCDIR=        $(SRC)/lib/libc
  31 LIB_PIC=        libc_pic.a
  32 VERS=           .1
  33 CPP=            /usr/lib/cpp
  34 TARGET_ARCH=    i386
  35 
  36 VALUES=         values-Xa.o
  37 
  38 # objects are grouped by source directory
  39 
  40 # local objects
  41 STRETS=
  42 
  43 CRTOBJS=                        \
  44         cerror.o                \
  45         cerror64.o
  46 
  47 DYNOBJS=                        \
  48         _rtbootld.o
  49 
  50 FPOBJS=                         \
  51         _D_cplx_div.o           \
  52         _D_cplx_div_ix.o        \
  53         _D_cplx_div_rx.o        \
  54         _D_cplx_lr_div.o        \
  55         _D_cplx_lr_div_ix.o     \
  56         _D_cplx_lr_div_rx.o     \
  57         _D_cplx_mul.o           \
  58         _F_cplx_div.o           \
  59         _F_cplx_div_ix.o        \
  60         _F_cplx_div_rx.o        \
  61         _F_cplx_lr_div.o        \
  62         _F_cplx_lr_div_ix.o     \
  63         _F_cplx_lr_div_rx.o     \
  64         _F_cplx_mul.o           \
  65         _X_cplx_div.o           \
  66         _X_cplx_div_ix.o        \
  67         _X_cplx_div_rx.o        \
  68         _X_cplx_lr_div.o        \
  69         _X_cplx_lr_div_ix.o     \
  70         _X_cplx_lr_div_rx.o     \
  71         _X_cplx_mul.o           \
  72         _base_il.o              \
  73         fpgetmask.o             \
  74         fpgetround.o            \
  75         fpgetsticky.o           \
  76         fpsetmask.o             \
  77         fpsetround.o            \
  78         fpsetsticky.o           \
  79         fpstart.o
  80 
  81 FPASMOBJS=                      \
  82         __xgetRD.o              \
  83         _xtoll.o                \
  84         _xtoull.o               \
  85         fpcw.o
  86 
  87 ATOMICOBJS=                     \
  88         atomic.o
  89 
  90 XATTROBJS=                      \
  91         xattr_common.o
  92 
  93 COMOBJS=                        \
  94         bcmp.o                  \
  95         bcopy.o                 \
  96         bsearch.o               \
  97         bzero.o                 \
  98         qsort.o                 \
  99         strtol.o                \
 100         strtoul.o               \
 101         strtoll.o               \
 102         strtoull.o
 103 
 104 DTRACEOBJS=                     \
 105         dtrace_data.o
 106 
 107 GENOBJS=                        \
 108         _div64.o                \
 109         _divdi3.o               \
 110         _getsp.o                \
 111         _mul64.o                \
 112         abs.o                   \
 113         alloca.o                \
 114         byteorder.o             \
 115         byteorder64.o           \
 116         cuexit.o                \
 117         ecvt.o                  \
 118         errlst.o                \
 119         i386_data.o             \
 120         ladd.o                  \
 121         ldivide.o               \
 122         lmul.o                  \
 123         lock.o                  \
 124         lshiftl.o               \
 125         lsign.o                 \
 126         lsub.o                  \
 127         makectxt.o              \
 128         memccpy.o               \
 129         memchr.o                \
 130         memcmp.o                \
 131         memcpy.o                \
 132         memset.o                \
 133         new_list.o              \
 134         setjmp.o                \
 135         siginfolst.o            \
 136         siglongjmp.o            \
 137         strcat.o                \
 138         strchr.o                \
 139         strcmp.o                \
 140         strcpy.o                \
 141         strlen.o                \
 142         strncat.o               \
 143         strncmp.o               \
 144         strncpy.o               \
 145         strnlen.o               \
 146         strrchr.o               \
 147         sync_instruction_memory.o
 148 
 149 # sysobjs that contain large-file interfaces
 150 COMSYSOBJS64=                   \
 151         fstatvfs64.o            \
 152         getdents64.o            \
 153         getrlimit64.o           \
 154         lseek64.o               \
 155         mmap64.o                \
 156         pread64.o               \
 157         pwrite64.o              \
 158         setrlimit64.o           \
 159         statvfs64.o
 160 
 161 SYSOBJS64=
 162 
 163 COMSYSOBJS=                     \
 164         __clock_timer.o         \
 165         __getloadavg.o          \
 166         __rusagesys.o           \
 167         __signotify.o           \
 168         __sigrt.o               \
 169         __time.o                \
 170         _lgrp_home_fast.o       \
 171         _lgrpsys.o              \
 172         _nfssys.o               \
 173         _portfs.o               \
 174         _pset.o                 \
 175         _rpcsys.o               \
 176         _sigaction.o            \
 177         _so_accept.o            \
 178         _so_bind.o              \
 179         _so_connect.o           \
 180         _so_getpeername.o       \
 181         _so_getsockname.o       \
 182         _so_getsockopt.o        \
 183         _so_listen.o            \
 184         _so_recv.o              \
 185         _so_recvfrom.o          \
 186         _so_recvmsg.o           \
 187         _so_send.o              \
 188         _so_sendmsg.o           \
 189         _so_sendto.o            \
 190         _so_setsockopt.o        \
 191         _so_shutdown.o          \
 192         _so_socket.o            \
 193         _so_socketpair.o        \
 194         _sockconfig.o           \
 195         acct.o                  \
 196         acl.o                   \
 197         adjtime.o               \
 198         alarm.o                 \
 199         brk.o                   \
 200         chdir.o                 \
 201         chroot.o                \
 202         cladm.o                 \
 203         close.o                 \
 204         execve.o                \
 205         exit.o                  \
 206         facl.o                  \
 207         fchdir.o                \
 208         fchroot.o               \
 209         fdsync.o                \
 210         fpathconf.o             \
 211         fstatfs.o               \
 212         fstatvfs.o              \
 213         getcpuid.o              \
 214         getdents.o              \
 215         getegid.o               \
 216         geteuid.o               \
 217         getgid.o                \
 218         getgroups.o             \
 219         gethrtime.o             \
 220         getitimer.o             \
 221         getmsg.o                \
 222         getpid.o                \
 223         getpmsg.o               \
 224         getppid.o               \
 225         getrlimit.o             \
 226         getuid.o                \
 227         gtty.o                  \
 228         install_utrap.o         \
 229         ioctl.o                 \
 230         kaio.o                  \
 231         kill.o                  \
 232         llseek.o                \
 233         lseek.o                 \
 234         mmapobjsys.o            \
 235         memcntl.o               \
 236         mincore.o               \
 237         mmap.o                  \
 238         modctl.o                \
 239         mount.o                 \
 240         mprotect.o              \
 241         munmap.o                \
 242         nice.o                  \
 243         ntp_adjtime.o           \
 244         ntp_gettime.o           \
 245         p_online.o              \
 246         pathconf.o              \
 247         pause.o                 \
 248         pcsample.o              \
 249         pipe2.o                 \
 250         pollsys.o               \
 251         pread.o                 \
 252         priocntlset.o           \
 253         processor_bind.o        \
 254         processor_info.o        \
 255         profil.o                \
 256         putmsg.o                \
 257         putpmsg.o               \
 258         pwrite.o                \
 259         read.o                  \
 260         readv.o                 \
 261         resolvepath.o           \
 262         seteguid.o              \
 263         setgid.o                \
 264         setgroups.o             \
 265         setitimer.o             \
 266         setreid.o               \
 267         setrlimit.o             \
 268         setuid.o                \
 269         sigaltstk.o             \
 270         sigprocmsk.o            \
 271         sigsendset.o            \
 272         sigsuspend.o            \
 273         statfs.o                \
 274         statvfs.o               \
 275         stty.o                  \
 276         sync.o                  \
 277         sysconfig.o             \
 278         sysfs.o                 \
 279         sysinfo.o               \
 280         syslwp.o                \
 281         times.o                 \
 282         ulimit.o                \
 283         umask.o                 \
 284         umount2.o               \
 285         utssys.o                \
 286         uucopy.o                \
 287         vhangup.o               \
 288         waitid.o                \
 289         write.o                 \
 290         writev.o                \
 291         yield.o
 292 
 293 SYSOBJS=                        \
 294         __clock_gettime.o       \
 295         __getcontext.o          \
 296         __uadmin.o              \
 297         _lwp_mutex_unlock.o     \
 298         _stack_grow.o           \
 299         door.o                  \
 300         forkx.o                 \
 301         forkallx.o              \
 302         getcontext.o            \
 303         gettimeofday.o          \
 304         lwp_private.o           \
 305         nuname.o                \
 306         ptrace.o                \
 307         syscall.o               \
 308         sysi86.o                \
 309         tls_get_addr.o          \
 310         uadmin.o                \
 311         umount.o                \
 312         uname.o                 \
 313         vforkx.o                \
 314         xstat.o
 315 
 316 # objects under $(LIBCDIR)/port which contain transitional large file interfaces
 317 PORTGEN64=                      \
 318         _xftw64.o               \
 319         attropen64.o            \
 320         ftw64.o                 \
 321         mkstemp64.o             \
 322         nftw64.o                \
 323         tell64.o                \
 324         truncate64.o
 325 
 326 # objects from source under $(LIBCDIR)/port
 327 PORTFP=                         \
 328         __flt_decim.o           \
 329         __flt_rounds.o          \
 330         __tbl_10_b.o            \
 331         __tbl_10_h.o            \
 332         __tbl_10_s.o            \
 333         __tbl_2_b.o             \
 334         __tbl_2_h.o             \
 335         __tbl_2_s.o             \
 336         __tbl_fdq.o             \
 337         __tbl_tens.o            \
 338         __x_power.o             \
 339         _base_sup.o             \
 340         aconvert.o              \
 341         decimal_bin.o           \
 342         double_decim.o          \
 343         econvert.o              \
 344         fconvert.o              \
 345         file_decim.o            \
 346         finite.o                \
 347         fp_data.o               \
 348         func_decim.o            \
 349         gconvert.o              \
 350         hex_bin.o               \
 351         ieee_globals.o          \
 352         pack_float.o            \
 353         sigfpe.o                \
 354         string_decim.o
 355 
 356 PORTGEN=                        \
 357         _env_data.o             \
 358         _xftw.o                 \
 359         a64l.o                  \
 360         abort.o                 \
 361         addsev.o                \
 362         ascii_strcasecmp.o      \
 363         ascii_strncasecmp.o     \
 364         assert.o                \
 365         atof.o                  \
 366         atoi.o                  \
 367         atol.o                  \
 368         atoll.o                 \
 369         attrat.o                \
 370         attropen.o              \
 371         atexit.o                \
 372         atfork.o                \
 373         basename.o              \
 374         calloc.o                \
 375         catgets.o               \
 376         catopen.o               \
 377         cfgetispeed.o           \
 378         cfgetospeed.o           \
 379         cfree.o                 \
 380         cfsetispeed.o           \
 381         cfsetospeed.o           \
 382         cftime.o                \
 383         clock.o                 \
 384         closedir.o              \
 385         closefrom.o             \
 386         confstr.o               \
 387         crypt.o                 \
 388         csetlen.o               \
 389         ctime.o                 \
 390         ctime_r.o               \
 391         daemon.o                \
 392         deflt.o                 \
 393         directio.o              \
 394         dirname.o               \
 395         div.o                   \
 396         drand48.o               \
 397         dup.o                   \
 398         env_data.o              \
 399         err.o                   \
 400         errno.o                 \
 401         euclen.o                \
 402         event_port.o            \
 403         execvp.o                \
 404         fattach.o               \
 405         fdetach.o               \
 406         fdopendir.o             \
 407         ffs.o                   \
 408         fls.o                   \
 409         fmtmsg.o                \
 410         ftime.o                 \
 411         ftok.o                  \
 412         ftw.o                   \
 413         gcvt.o                  \
 414         getauxv.o               \
 415         getcwd.o                \
 416         getdate_err.o           \
 417         getdtblsize.o           \
 418         getenv.o                \
 419         getexecname.o           \
 420         getgrnam.o              \
 421         getgrnam_r.o            \
 422         gethostid.o             \
 423         gethostname.o           \
 424         gethz.o                 \
 425         getisax.o               \
 426         getloadavg.o            \
 427         getlogin.o              \
 428         getmntent.o             \
 429         getnetgrent.o           \
 430         get_nprocs.o            \
 431         getopt.o                \
 432         getopt_long.o           \
 433         getpagesize.o           \
 434         getpw.o                 \
 435         getpwnam.o              \
 436         getpwnam_r.o            \
 437         getrusage.o             \
 438         getspent.o              \
 439         getspent_r.o            \
 440         getsubopt.o             \
 441         gettxt.o                \
 442         getusershell.o          \
 443         getut.o                 \
 444         getutx.o                \
 445         getvfsent.o             \
 446         getwd.o                 \
 447         getwidth.o              \
 448         getxby_door.o           \
 449         gtxt.o                  \
 450         hsearch.o               \
 451         iconv.o                 \
 452         imaxabs.o               \
 453         imaxdiv.o               \
 454         index.o                 \
 455         initgroups.o            \
 456         insque.o                \
 457         isaexec.o               \
 458         isastream.o             \
 459         isatty.o                \
 460         killpg.o                \
 461         klpdlib.o               \
 462         l64a.o                  \
 463         lckpwdf.o               \
 464         lconstants.o            \
 465         lexp10.o                \
 466         lfind.o                 \
 467         lfmt.o                  \
 468         lfmt_log.o              \
 469         llabs.o                 \
 470         lldiv.o                 \
 471         llog10.o                \
 472         lltostr.o               \
 473         localtime.o             \
 474         lsearch.o               \
 475         madvise.o               \
 476         malloc.o                \
 477         memalign.o              \
 478         memmem.o                \
 479         mkdev.o                 \
 480         mkdtemp.o               \
 481         mkfifo.o                \
 482         mkstemp.o               \
 483         mktemp.o                \
 484         mlock.o                 \
 485         mlockall.o              \
 486         mon.o                   \
 487         msync.o                 \
 488         munlock.o               \
 489         munlockall.o            \
 490         ndbm.o                  \
 491         nftw.o                  \
 492         nlspath_checks.o        \
 493         nsparse.o               \
 494         nss_common.o            \
 495         nss_dbdefs.o            \
 496         nss_deffinder.o         \
 497         opendir.o               \
 498         opt_data.o              \
 499         perror.o                \
 500         pfmt.o                  \
 501         pfmt_data.o             \
 502         pfmt_print.o            \
 503         pipe.o                  \
 504         plock.o                 \
 505         poll.o                  \
 506         posix_fadvise.o         \
 507         posix_fallocate.o       \
 508         posix_madvise.o         \
 509         posix_memalign.o        \
 510         priocntl.o              \
 511         privlib.o               \
 512         priv_str_xlate.o        \
 513         psiginfo.o              \
 514         psignal.o               \
 515         pt.o                    \
 516         putpwent.o              \
 517         putspent.o              \
 518         raise.o                 \
 519         rand.o                  \
 520         random.o                \
 521         rctlops.o               \
 522         readdir.o               \
 523         readdir_r.o             \
 524         realpath.o              \
 525         reboot.o                \
 526         regexpr.o               \
 527         remove.o                \
 528         rewinddir.o             \
 529         rindex.o                \
 530         scandir.o               \
 531         seekdir.o               \
 532         select.o                \
 533         select_large_fdset.o    \
 534         setlabel.o              \
 535         setpriority.o           \
 536         settimeofday.o          \
 537         sh_locks.o              \
 538         sigflag.o               \
 539         siglist.o               \
 540         sigsend.o               \
 541         sigsetops.o             \
 542         ssignal.o               \
 543         stack.o                 \
 544         stpcpy.o                \
 545         stpncpy.o               \
 546         str2sig.o               \
 547         strcase_charmap.o       \
 548         strchrnul.o             \
 549         strcspn.o               \
 550         strdup.o                \
 551         strerror.o              \
 552         strlcat.o               \
 553         strlcpy.o               \
 554         strndup.o               \
 555         strpbrk.o               \
 556         strsep.o                \
 557         strsignal.o             \
 558         strspn.o                \
 559         strstr.o                \
 560         strtod.o                \
 561         strtoimax.o             \
 562         strtok.o                \
 563         strtok_r.o              \
 564         strtoumax.o             \
 565         swab.o                  \
 566         swapctl.o               \
 567         sysconf.o               \
 568         syslog.o                \
 569         tcdrain.o               \
 570         tcflow.o                \
 571         tcflush.o               \
 572         tcgetattr.o             \
 573         tcgetpgrp.o             \
 574         tcgetsid.o              \
 575         tcsendbreak.o           \
 576         tcsetattr.o             \
 577         tcsetpgrp.o             \
 578         tell.o                  \
 579         telldir.o               \
 580         tfind.o                 \
 581         time_data.o             \
 582         time_gdata.o            \
 583         tls_data.o              \
 584         truncate.o              \
 585         tsdalloc.o              \
 586         tsearch.o               \
 587         ttyname.o               \
 588         ttyslot.o               \
 589         ualarm.o                \
 590         ucred.o                 \
 591         valloc.o                \
 592         vlfmt.o                 \
 593         vpfmt.o                 \
 594         waitpid.o               \
 595         walkstack.o             \
 596         wdata.o                 \
 597         xgetwidth.o             \
 598         xpg4.o                  \
 599         xpg6.o
 600 
 601 PORTPRINT_W=                    \
 602         doprnt_w.o
 603 
 604 PORTPRINT=                      \
 605         asprintf.o              \
 606         doprnt.o                \
 607         fprintf.o               \
 608         printf.o                \
 609         snprintf.o              \
 610         sprintf.o               \
 611         vfprintf.o              \
 612         vprintf.o               \
 613         vsnprintf.o             \
 614         vsprintf.o              \
 615         vwprintf.o              \
 616         wprintf.o
 617 
 618 # c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
 619 PORTPRINT_C89=                  \
 620         vfprintf_c89.o          \
 621         vprintf_c89.o           \
 622         vsnprintf_c89.o         \
 623         vsprintf_c89.o          \
 624         vwprintf_c89.o
 625 
 626 PORTSTDIO_C89=                  \
 627         vscanf_c89.o            \
 628         vwscanf_c89.o           \
 629 
 630 # portable stdio objects that contain large file interfaces.
 631 # Note: fopen64 is a special case, as we build it small.
 632 PORTSTDIO64=                    \
 633         fopen64.o               \
 634         fpos64.o
 635 
 636 PORTSTDIO_W=                    \
 637         doscan_w.o
 638 
 639 PORTSTDIO=                      \
 640         __extensions.o          \
 641         _endopen.o              \
 642         _filbuf.o               \
 643         _findbuf.o              \
 644         _flsbuf.o               \
 645         _wrtchk.o               \
 646         clearerr.o              \
 647         ctermid.o               \
 648         ctermid_r.o             \
 649         cuserid.o               \
 650         data.o                  \
 651         doscan.o                \
 652         fdopen.o                \
 653         feof.o                  \
 654         ferror.o                \
 655         fgetc.o                 \
 656         fgets.o                 \
 657         fileno.o                \
 658         flockf.o                \
 659         flush.o                 \
 660         fopen.o                 \
 661         fpos.o                  \
 662         fputc.o                 \
 663         fputs.o                 \
 664         fread.o                 \
 665         fseek.o                 \
 666         fseeko.o                \
 667         ftell.o                 \
 668         ftello.o                \
 669         fwrite.o                \
 670         getc.o                  \
 671         getchar.o               \
 672         getline.o               \
 673         getpass.o               \
 674         gets.o                  \
 675         getw.o                  \
 676         mse.o                   \
 677         popen.o                 \
 678         putc.o                  \
 679         putchar.o               \
 680         puts.o                  \
 681         putw.o                  \
 682         rewind.o                \
 683         scanf.o                 \
 684         setbuf.o                \
 685         setbuffer.o             \
 686         setvbuf.o               \
 687         system.o                \
 688         tempnam.o               \
 689         tmpfile.o               \
 690         tmpnam_r.o              \
 691         ungetc.o                \
 692         vscanf.o                \
 693         vwscanf.o               \
 694         wscanf.o
 695 
 696 PORTI18N=                       \
 697         getwchar.o              \
 698         putwchar.o              \
 699         putws.o                 \
 700         strcasecmp.o            \
 701         strcasestr.o            \
 702         strncasecmp.o           \
 703         strtows.o               \
 704         wcsnlen.o               \
 705         wcsstr.o                \
 706         wcstoimax.o             \
 707         wcstol.o                \
 708         wcstoul.o               \
 709         wcswcs.o                \
 710         wmemchr.o               \
 711         wmemcmp.o               \
 712         wmemcpy.o               \
 713         wmemmove.o              \
 714         wmemset.o               \
 715         wscasecmp.o             \
 716         wscat.o                 \
 717         wschr.o                 \
 718         wscmp.o                 \
 719         wscpy.o                 \
 720         wscspn.o                \
 721         wsdup.o                 \
 722         wslen.o                 \
 723         wsncasecmp.o            \
 724         wsncat.o                \
 725         wsncmp.o                \
 726         wsncpy.o                \
 727         wspbrk.o                \
 728         wsprintf.o              \
 729         wsrchr.o                \
 730         wsscanf.o               \
 731         wsspn.o                 \
 732         wstod.o                 \
 733         wstok.o                 \
 734         wstol.o                 \
 735         wstoll.o                \
 736         wsxfrm.o                \
 737         gettext.o               \
 738         gettext_gnu.o           \
 739         gettext_real.o          \
 740         gettext_util.o          \
 741         isdigit.o               \
 742         plural_parser.o         \
 743         wdresolve.o             \
 744         _ctype.o                \
 745         isascii.o               \
 746         toascii.o
 747 
 748 PORTI18N_COND=                  \
 749         wcstol_longlong.o       \
 750         wcstoul_longlong.o
 751 
 752 PORTLOCALE=                     \
 753         big5.o                  \
 754         btowc.o                 \
 755         collate.o               \
 756         collcmp.o               \
 757         euc.o                   \
 758         fnmatch.o               \
 759         fgetwc.o                \
 760         fgetws.o                \
 761         fix_grouping.o          \
 762         fputwc.o                \
 763         fputws.o                \
 764         fwide.o                 \
 765         gb18030.o               \
 766         gb2312.o                \
 767         gbk.o                   \
 768         getdate.o               \
 769         iswctype.o              \
 770         ldpart.o                \
 771         lmessages.o             \
 772         lnumeric.o              \
 773         lmonetary.o             \
 774         localeconv.o            \
 775         mbftowc.o               \
 776         mblen.o                 \
 777         mbrlen.o                \
 778         mbrtowc.o               \
 779         mbsinit.o               \
 780         mbsnrtowcs.o            \
 781         mbsrtowcs.o             \
 782         mbstowcs.o              \
 783         mbtowc.o                \
 784         mskanji.o               \
 785         nextwctype.o            \
 786         nl_langinfo.o           \
 787         none.o                  \
 788         regcomp.o               \
 789         regfree.o               \
 790         regerror.o              \
 791         regexec.o               \
 792         rune.o                  \
 793         runetype.o              \
 794         setlocale.o             \
 795         setrunelocale.o         \
 796         strcoll.o               \
 797         strfmon.o               \
 798         strftime.o              \
 799         strptime.o              \
 800         strxfrm.o               \
 801         table.o                 \
 802         timelocal.o             \
 803         tolower.o               \
 804         towlower.o              \
 805         ungetwc.o               \
 806         utf8.o                  \
 807         wcrtomb.o               \
 808         wcscoll.o               \
 809         wcsftime.o              \
 810         wcsnrtombs.o            \
 811         wcsrtombs.o             \
 812         wcswidth.o              \
 813         wcstombs.o              \
 814         wcsxfrm.o               \
 815         wctob.o                 \
 816         wctomb.o                \
 817         wctrans.o               \
 818         wctype.o                \
 819         wcwidth.o               \
 820         wscol.o
 821 
 822 AIOOBJS=                        \
 823         aio.o                   \
 824         aio_alloc.o             \
 825         posix_aio.o
 826 
 827 RTOBJS=                         \
 828         clock_timer.o           \
 829         mqueue.o                \
 830         pos4obj.o               \
 831         sched.o                 \
 832         sem.o                   \
 833         shm.o                   \
 834         sigev_thread.o
 835 
 836 TPOOLOBJS=                      \
 837         thread_pool.o
 838 
 839 THREADSOBJS=                    \
 840         alloc.o                 \
 841         assfail.o               \
 842         cancel.o                \
 843         door_calls.o            \
 844         tmem.o                  \
 845         pthr_attr.o             \
 846         pthr_barrier.o          \
 847         pthr_cond.o             \
 848         pthr_mutex.o            \
 849         pthr_rwlock.o           \
 850         pthread.o               \
 851         rwlock.o                \
 852         scalls.o                \
 853         sema.o                  \
 854         sigaction.o             \
 855         spawn.o                 \
 856         synch.o                 \
 857         tdb_agent.o             \
 858         thr.o                   \
 859         thread_interface.o      \
 860         tls.o                   \
 861         tsd.o
 862 
 863 THREADSMACHOBJS=                \
 864         machdep.o
 865 
 866 THREADSASMOBJS=                 \
 867         asm_subr.o
 868 
 869 UNICODEOBJS=                    \
 870         u8_textprep.o           \
 871         uconv.o
 872 
 873 UNWINDMACHOBJS=                 \
 874         unwind.o
 875 
 876 UNWINDASMOBJS=                  \
 877         unwind_frame.o
 878 
 879 # objects that implement the transitional large file API
 880 PORTSYS64=                      \
 881         lockf64.o               \
 882         stat64.o
 883 
 884 PORTSYS=                        \
 885         _autofssys.o            \
 886         access.o                \
 887         acctctl.o               \
 888         bsd_signal.o            \
 889         chmod.o                 \
 890         chown.o                 \
 891         corectl.o               \
 892         exacctsys.o             \
 893         execl.o                 \
 894         execle.o                \
 895         execv.o                 \
 896         fcntl.o                 \
 897         getpagesizes.o          \
 898         getpeerucred.o          \
 899         inst_sync.o             \
 900         issetugid.o             \
 901         label.o                 \
 902         link.o                  \
 903         lockf.o                 \
 904         lwp.o                   \
 905         lwp_cond.o              \
 906         lwp_rwlock.o            \
 907         lwp_sigmask.o           \
 908         meminfosys.o            \
 909         mkdir.o                 \
 910         mknod.o                 \
 911         msgsys.o                \
 912         nfssys.o                \
 913         open.o                  \
 914         pgrpsys.o               \
 915         posix_sigwait.o         \
 916         ppriv.o                 \
 917         psetsys.o               \
 918         rctlsys.o               \
 919         readlink.o              \
 920         rename.o                \
 921         sbrk.o                  \
 922         semsys.o                \
 923         set_errno.o             \
 924         sharefs.o               \
 925         shmsys.o                \
 926         sidsys.o                \
 927         siginterrupt.o          \
 928         signal.o                \
 929         sigpending.o            \
 930         sigstack.o              \
 931         stat.o                  \
 932         symlink.o               \
 933         tasksys.o               \
 934         time.o                  \
 935         time_util.o             \
 936         ucontext.o              \
 937         unlink.o                \
 938         ustat.o                 \
 939         utimesys.o              \
 940         zone.o
 941 
 942 PORTREGEX=                      \
 943         glob.o                  \
 944         regcmp.o                \
 945         regex.o                 \
 946         wordexp.o
 947 
 948 MOSTOBJS=                       \
 949         $(STRETS)               \
 950         $(CRTOBJS)              \
 951         $(DYNOBJS)              \
 952         $(FPOBJS)               \
 953         $(FPASMOBJS)            \
 954         $(ATOMICOBJS)           \
 955         $(XATTROBJS)            \
 956         $(COMOBJS)              \
 957         $(DTRACEOBJS)           \
 958         $(GENOBJS)              \
 959         $(PORTFP)               \
 960         $(PORTGEN)              \
 961         $(PORTGEN64)            \
 962         $(PORTI18N)             \
 963         $(PORTI18N_COND)        \
 964         $(PORTLOCALE)           \
 965         $(PORTPRINT)            \
 966         $(PORTPRINT_C89)        \
 967         $(PORTPRINT_W)          \
 968         $(PORTREGEX)            \
 969         $(PORTSTDIO)            \
 970         $(PORTSTDIO64)          \
 971         $(PORTSTDIO_C89)        \
 972         $(PORTSTDIO_W)          \
 973         $(PORTSYS)              \
 974         $(PORTSYS64)            \
 975         $(AIOOBJS)              \
 976         $(RTOBJS)               \
 977         $(TPOOLOBJS)            \
 978         $(THREADSOBJS)          \
 979         $(THREADSMACHOBJS)      \
 980         $(THREADSASMOBJS)       \
 981         $(UNICODEOBJS)          \
 982         $(UNWINDMACHOBJS)       \
 983         $(UNWINDASMOBJS)        \
 984         $(COMSYSOBJS)           \
 985         $(SYSOBJS)              \
 986         $(COMSYSOBJS64)         \
 987         $(SYSOBJS64)            \
 988         $(VALUES)
 989 
 990 TRACEOBJS=                      \
 991         plockstat.o
 992 
 993 # NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
 994 # modules whose source is provided in the $(SRC)/lib/common directory.
 995 # This must be done because otherwise the Sun C compiler would insert
 996 # its own versions of these modules and those versions contain code
 997 # to call out to C++ initialization functions.  Such C++ initialization
 998 # functions can call back into libc before thread initialization is
 999 # complete and this leads to segmentation violations and other problems.
1000 # Since libc contains no C++ code, linking with the minimal crti.o and
1001 # crtn.o modules is safe and avoids the problems described above.
1002 OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1003 CRTSRCS= ../../common/i386
1004 
1005 LDPASS_OFF=     $(POUND_SIGN)
1006 
1007 # include common library definitions
1008 include ../../Makefile.lib
1009 
1010 # we need to override the default SONAME here because we might
1011 # be building a variant object (still libc.so.1, but different filename)
1012 SONAME = libc.so.1
1013 
1014 CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
1015 
1016 # This is necessary to avoid problems with calling _ex_unwind().
1017 # We probably don't want any inlining anyway.
1018 XINLINE = -xinline=
1019 CFLAGS += $(XINLINE)
1020 
1021 CERRWARN += -_gcc=-Wno-parentheses
1022 CERRWARN += -_gcc=-Wno-switch
1023 CERRWARN += -_gcc=-Wno-uninitialized
1024 CERRWARN += -_gcc=-Wno-unused-value
1025 CERRWARN += -_gcc=-Wno-unused-label
1026 CERRWARN += -_gcc=-Wno-unused-variable
1027 CERRWARN += -_gcc=-Wno-type-limits
1028 CERRWARN += -_gcc=-Wno-char-subscripts
1029 CERRWARN += -_gcc=-Wno-clobbered
1030 CERRWARN += -_gcc=-Wno-unused-function
1031 CERRWARN += -_gcc=-Wno-address
1032 
1033 # Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1034 # enables ASSERT() checking in the threads portion of the library.
1035 # This is automatically enabled for DEBUG builds, not for non-debug builds.
1036 THREAD_DEBUG =
1037 $(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1038 
1039 # Make string literals read-only to save memory.
1040 CFLAGS += $(XSTRCONST)
1041 
1042 ALTPICS= $(TRACEOBJS:%=pics/%)
1043 
1044 $(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) \
1045                 $(EXTPICS) $(LDLIBS)
1046 
1047 MAPFILES =      $(LIBCDIR)/port/mapfile-vers
1048 
1049 #
1050 # EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
1051 #
1052 CFLAGS +=       $(EXTN_CFLAGS)
1053 CPPFLAGS=       -D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
1054                 -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1055 ASFLAGS=        $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
1056 
1057 # As a favor to the dtrace syscall provider, libc still calls the
1058 # old syscall traps that have been obsoleted by the *at() interfaces.
1059 # Delete this to compile libc using only the new *at() system call traps
1060 CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1061 
1062 # Inform the run-time linker about libc specialized initialization
1063 RTLDINFO =      -z rtldinfo=tls_rtldinfo
1064 DYNFLAGS +=     $(RTLDINFO)
1065 
1066 # Force libc's internal references to be resolved immediately upon loading
1067 # in order to avoid critical region problems.  Since almost all libc symbols
1068 # are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1069 DYNFLAGS +=     -znow
1070 
1071 DYNFLAGS +=     -e __rtboot
1072 DYNFLAGS +=     $(EXTN_DYNFLAGS)
1073 
1074 # Inform the kernel about the initial DTrace area (in case
1075 # libc is being used as the interpreter / runtime linker).
1076 DTRACE_DATA =   -zdtrace=dtrace_data
1077 DYNFLAGS +=     $(DTRACE_DATA)
1078 
1079 # DTrace needs an executable data segment.
1080 MAPFILE.NED=
1081 
1082 BUILD.s=        $(AS) $(ASFLAGS) $< -o $@
1083 
1084 # Override this top level flag so the compiler builds in its native
1085 # C99 mode.  This has been enabled to support the complex arithmetic
1086 # added to libc.
1087 C99MODE=        $(C99_ENABLE)
1088 
1089 # libc method of building an archive
1090 # The "$(GREP) -v ' L '" part is necessary only until
1091 # lorder is fixed to ignore thread-local variables.
1092 BUILD.AR= $(RM) $@ ; \
1093         $(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1094 
1095 # extra files for the clean target
1096 CLEANFILES=                     \
1097         $(LIBCDIR)/port/gen/errlst.c    \
1098         $(LIBCDIR)/port/gen/new_list.c  \
1099         assym.h                 \
1100         genassym                \
1101         crt/_rtld.s             \
1102         crt/_rtbootld.s         \
1103         pics/_rtbootld.o        \
1104         pics/crti.o             \
1105         pics/crtn.o             \
1106         $(ALTPICS)
1107 
1108 CLOBBERFILES += $(LIB_PIC)
1109 
1110 # list of C source for lint
1111 SRCS=                                                   \
1112         $(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)      \
1113         $(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)        \
1114         $(COMOBJS:%.o=$(SRC)/common/util/%.c)           \
1115         $(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)      \
1116         $(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)                    \
1117         $(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)                  \
1118         $(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)                \
1119         $(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)            \
1120         $(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)              \
1121         $(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)              \
1122         $(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)              \
1123         $(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)                  \
1124         $(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)                  \
1125         $(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)                    \
1126         $(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)              \
1127         $(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)          \
1128         $(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)   \
1129         $(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)    \
1130         $(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)        \
1131         $(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)                 \
1132         $(LIBCBASE)/gen/ecvt.c                          \
1133         $(LIBCBASE)/gen/makectxt.c                      \
1134         $(LIBCBASE)/gen/siginfolst.c                    \
1135         $(LIBCBASE)/gen/siglongjmp.c                    \
1136         $(LIBCBASE)/gen/strcmp.c                        \
1137         $(LIBCBASE)/gen/sync_instruction_memory.c       \
1138         $(LIBCBASE)/sys/ptrace.c                        \
1139         $(LIBCBASE)/sys/uadmin.c
1140 
1141 # conditional assignments
1142 $(DYNLIB) := CRTI = crti.o
1143 $(DYNLIB) := CRTN = crtn.o
1144 
1145 # Files which need the threads .il inline template
1146 TIL=                            \
1147         aio.o                   \
1148         alloc.o                 \
1149         assfail.o               \
1150         atexit.o                \
1151         atfork.o                \
1152         cancel.o                \
1153         door_calls.o            \
1154         err.o                   \
1155         errno.o                 \
1156         lwp.o                   \
1157         ma.o                    \
1158         machdep.o               \
1159         posix_aio.o             \
1160         pthr_attr.o             \
1161         pthr_barrier.o          \
1162         pthr_cond.o             \
1163         pthr_mutex.o            \
1164         pthr_rwlock.o           \
1165         pthread.o               \
1166         rand.o                  \
1167         rwlock.o                \
1168         scalls.o                \
1169         sched.o                 \
1170         sema.o                  \
1171         sigaction.o             \
1172         sigev_thread.o          \
1173         spawn.o                 \
1174         stack.o                 \
1175         synch.o                 \
1176         tdb_agent.o             \
1177         thr.o                   \
1178         thread_interface.o      \
1179         thread_pool.o           \
1180         tls.o                   \
1181         tsd.o                   \
1182         tmem.o                  \
1183         unwind.o
1184 
1185 THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1186 $(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1187 
1188 # pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1189 
1190 # large-file-aware components that should be built large
1191 
1192 $(COMSYSOBJS64:%=pics/%) := \
1193         CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1194 
1195 $(SYSOBJS64:%=pics/%) := \
1196         CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1197 
1198 $(PORTGEN64:%=pics/%) := \
1199         CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1200 
1201 $(PORTSTDIO64:%=pics/%) := \
1202         CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1203 
1204 $(PORTSYS64:%=pics/%) := \
1205         CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1206 
1207 $(PORTSTDIO_W:%=pics/%) := \
1208         CPPFLAGS += -D_WIDE
1209 
1210 $(PORTPRINT_W:%=pics/%) := \
1211         CPPFLAGS += -D_WIDE
1212 
1213 $(PORTPRINT_C89:%=pics/%) := \
1214         CPPFLAGS += -D_C89_INTMAX32
1215 
1216 $(PORTSTDIO_C89:%=pics/%) := \
1217         CPPFLAGS += -D_C89_INTMAX32
1218 
1219 $(PORTI18N_COND:%=pics/%) := \
1220         CPPFLAGS += -D_WCS_LONGLONG
1221 
1222 .KEEP_STATE:
1223 
1224 all: $(LIBS) $(LIB_PIC)
1225 
1226 lint    :=      CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1227 lint    :=      CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1228 lint    :=      LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1229 
1230 lint:
1231         @echo $(LINT.c) ...
1232         @$(LINT.c) $(SRCS) $(LDLIBS)
1233 
1234 $(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1235 $(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1236 $(LINTLIB):= LINTFLAGS=-nvx
1237 
1238 # object files that depend on inline template
1239 $(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1240 # pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1241 
1242 # include common libc targets
1243 include $(LIBCDIR)/Makefile.targ
1244 
1245 # We need to strip out all CTF and DOF data from the static library
1246 $(LIB_PIC) := DIR = pics
1247 $(LIB_PIC): pics $$(PICS)
1248         $(BUILD.AR)
1249         $(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1250         $(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1251         $(AR) -ts $@ > /dev/null
1252         $(POST_PROCESS_A)
1253 
1254 $(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1255         $(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
1256             $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1257         $(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1258         $(RM) $(LIBCBASE)/crt/_rtld.s
1259 
1260 # partially built from C source
1261 pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1262         $(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1263         $(CTFCONVERT_O)
1264 
1265 ASSYMDEP_OBJS=                  \
1266         _lwp_mutex_unlock.o     \
1267         _stack_grow.o           \
1268         getcontext.o            \
1269         setjmp.o                \
1270         tls_get_addr.o          \
1271         vforkx.o
1272 
1273 $(ASSYMDEP_OBJS:%=pics/%)       :=      CPPFLAGS += -I.
1274 
1275 $(ASSYMDEP_OBJS:%=pics/%): assym.h
1276 
1277 # assym.h build rules
1278 
1279 GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1280 
1281 genassym: $(GENASSYM_C)
1282         $(NATIVECC) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc  \
1283                 -D__EXTENSIONS__ $(CPPFLAGS.native) -o $@ $(GENASSYM_C)
1284 
1285 OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1286 
1287 assym.h: $(OFFSETS) genassym
1288         $(OFFSETS_CREATE) <$(OFFSETS) >$@
1289         ./genassym >>$@
1290 
1291 # derived C source and related explicit dependencies
1292 $(LIBCDIR)/port/gen/errlst.c + \
1293 $(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1294         cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1295 
1296 pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1297 
1298 pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c