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