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