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