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