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