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