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