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