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