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 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         getpagesizes.o          \
 904         getpeerucred.o          \
 905         inst_sync.o             \
 906         issetugid.o             \
 907         label.o                 \
 908         link.o                  \
 909         lockf.o                 \
 910         lwp.o                   \
 911         lwp_cond.o              \
 912         lwp_rwlock.o            \
 913         lwp_sigmask.o           \
 914         meminfosys.o            \
 915         mkdir.o                 \
 916         mknod.o                 \
 917         msgsys.o                \
 918         nfssys.o                \
 919         open.o                  \
 920         pgrpsys.o               \
 921         posix_sigwait.o         \
 922         ppriv.o                 \
 923         psetsys.o               \
 924         rctlsys.o               \
 925         readlink.o              \
 926         rename.o                \
 927         sbrk.o                  \
 928         semsys.o                \
 929         set_errno.o             \
 930         sharefs.o               \
 931         shmsys.o                \
 932         sidsys.o                \
 933         siginterrupt.o          \
 934         signal.o                \
 935         sigpending.o            \
 936         sigstack.o              \
 937         stat.o                  \
 938         symlink.o               \
 939         tasksys.o               \
 940         time.o                  \
 941         time_util.o             \
 942         ucontext.o              \
 943         unlink.o                \
 944         ustat.o                 \
 945         utimesys.o              \
 946         zone.o
 947 
 948 PORTREGEX=                      \
 949         glob.o                  \
 950         regcmp.o                \
 951         regex.o                 \
 952         wordexp.o
 953 
 954 MOSTOBJS=                       \
 955         $(STRETS)               \
 956         $(CRTOBJS)              \
 957         $(DYNOBJS)              \
 958         $(FPOBJS)               \
 959         $(FPASMOBJS)            \
 960         $(ATOMICOBJS)           \
 961         $(XATTROBJS)            \
 962         $(COMOBJS)              \
 963         $(DTRACEOBJS)           \
 964         $(GENOBJS)              \
 965         $(PORTFP)               \
 966         $(PORTGEN)              \
 967         $(PORTGEN64)            \
 968         $(PORTI18N)             \
 969         $(PORTI18N_COND)        \
 970         $(PORTLOCALE)           \
 971         $(PORTPRINT)            \
 972         $(PORTPRINT_C89)        \
 973         $(PORTPRINT_W)          \
 974         $(PORTREGEX)            \
 975         $(PORTSTDIO)            \
 976         $(PORTSTDIO64)          \
 977         $(PORTSTDIO_C89)        \
 978         $(PORTSTDIO_W)          \
 979         $(PORTSYS)              \
 980         $(PORTSYS64)            \
 981         $(AIOOBJS)              \
 982         $(RTOBJS)               \
 983         $(TPOOLOBJS)            \
 984         $(THREADSOBJS)          \
 985         $(THREADSMACHOBJS)      \
 986         $(THREADSASMOBJS)       \
 987         $(UNICODEOBJS)          \
 988         $(UNWINDMACHOBJS)       \
 989         $(UNWINDASMOBJS)        \
 990         $(COMSYSOBJS)           \
 991         $(SYSOBJS)              \
 992         $(COMSYSOBJS64)         \
 993         $(SYSOBJS64)            \
 994         $(VALUES)
 995 
 996 TRACEOBJS=                      \
 997         plockstat.o
 998 
 999 # NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
1000 # modules whose source is provided in the $(SRC)/lib/common directory.
1001 # This must be done because otherwise the Sun C compiler would insert
1002 # its own versions of these modules and those versions contain code
1003 # to call out to C++ initialization functions.  Such C++ initialization
1004 # functions can call back into libc before thread initialization is
1005 # complete and this leads to segmentation violations and other problems.
1006 # Since libc contains no C++ code, linking with the minimal crti.o and
1007 # crtn.o modules is safe and avoids the problems described above.
1008 OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1009 CRTSRCS= ../../common/i386
1010 
1011 LDPASS_OFF=     $(POUND_SIGN)
1012 
1013 # include common library definitions
1014 include ../../Makefile.lib
1015 
1016 # we need to override the default SONAME here because we might
1017 # be building a variant object (still libc.so.1, but different filename)
1018 SONAME = libc.so.1
1019 
1020 CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
1021 
1022 # This is necessary to avoid problems with calling _ex_unwind().
1023 # We probably don't want any inlining anyway.
1024 XINLINE = -xinline=
1025 CFLAGS += $(XINLINE)
1026 
1027 CERRWARN += -_gcc=-Wno-parentheses
1028 CERRWARN += -_gcc=-Wno-switch
1029 CERRWARN += -_gcc=-Wno-uninitialized
1030 CERRWARN += -_gcc=-Wno-unused-value
1031 CERRWARN += -_gcc=-Wno-unused-label
1032 CERRWARN += -_gcc=-Wno-unused-variable
1033 CERRWARN += -_gcc=-Wno-type-limits
1034 CERRWARN += -_gcc=-Wno-char-subscripts
1035 CERRWARN += -_gcc=-Wno-clobbered
1036 CERRWARN += -_gcc=-Wno-unused-function
1037 CERRWARN += -_gcc=-Wno-address
1038 
1039 # Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1040 # enables ASSERT() checking in the threads portion of the library.
1041 # This is automatically enabled for DEBUG builds, not for non-debug builds.
1042 THREAD_DEBUG =
1043 $(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1044 
1045 # Make string literals read-only to save memory.
1046 CFLAGS += $(XSTRCONST)
1047 
1048 ALTPICS= $(TRACEOBJS:%=pics/%)
1049 
1050 $(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) \
1051                 $(EXTPICS) $(LDLIBS)
1052 
1053 MAPFILES =      $(LIBCDIR)/port/mapfile-vers
1054 
1055 #
1056 # EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
1057 #
1058 CFLAGS +=       $(EXTN_CFLAGS)
1059 CPPFLAGS=       -D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
1060                 -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1061 ASFLAGS=        $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
1062 
1063 # As a favor to the dtrace syscall provider, libc still calls the
1064 # old syscall traps that have been obsoleted by the *at() interfaces.
1065 # Delete this to compile libc using only the new *at() system call traps
1066 CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1067 
1068 # Inform the run-time linker about libc specialized initialization
1069 RTLDINFO =      -z rtldinfo=tls_rtldinfo
1070 DYNFLAGS +=     $(RTLDINFO)
1071 
1072 # Force libc's internal references to be resolved immediately upon loading
1073 # in order to avoid critical region problems.  Since almost all libc symbols
1074 # are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1075 DYNFLAGS +=     -znow
1076 
1077 DYNFLAGS +=     -e __rtboot
1078 DYNFLAGS +=     $(EXTN_DYNFLAGS)
1079 
1080 # Inform the kernel about the initial DTrace area (in case
1081 # libc is being used as the interpreter / runtime linker).
1082 DTRACE_DATA =   -zdtrace=dtrace_data
1083 DYNFLAGS +=     $(DTRACE_DATA)
1084 
1085 # DTrace needs an executable data segment.
1086 MAPFILE.NED=
1087 
1088 BUILD.s=        $(AS) $(ASFLAGS) $< -o $@
1089 
1090 # Override this top level flag so the compiler builds in its native
1091 # C99 mode.  This has been enabled to support the complex arithmetic
1092 # added to libc.
1093 C99MODE=        $(C99_ENABLE)
1094 
1095 # libc method of building an archive
1096 # The "$(GREP) -v ' L '" part is necessary only until
1097 # lorder is fixed to ignore thread-local variables.
1098 BUILD.AR= $(RM) $@ ; \
1099         $(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1100 
1101 # extra files for the clean target
1102 CLEANFILES=                     \
1103         $(LIBCDIR)/port/gen/errlst.c    \
1104         $(LIBCDIR)/port/gen/new_list.c  \
1105         assym.h                 \
1106         genassym                \
1107         crt/_rtld.s             \
1108         crt/_rtbootld.s         \
1109         pics/_rtbootld.o        \
1110         pics/crti.o             \
1111         pics/crtn.o             \
1112         $(ALTPICS)
1113 
1114 CLOBBERFILES += $(LIB_PIC)
1115 
1116 # list of C source for lint
1117 SRCS=                                                   \
1118         $(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)      \
1119         $(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)        \
1120         $(COMOBJS:%.o=$(SRC)/common/util/%.c)           \
1121         $(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)      \
1122         $(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)                    \
1123         $(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)                  \
1124         $(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)                \
1125         $(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)            \
1126         $(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)              \
1127         $(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)              \
1128         $(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)              \
1129         $(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)                  \
1130         $(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)                  \
1131         $(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)                    \
1132         $(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)              \
1133         $(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)          \
1134         $(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)   \
1135         $(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)    \
1136         $(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)        \
1137         $(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)                 \
1138         $(LIBCBASE)/gen/ecvt.c                          \
1139         $(LIBCBASE)/gen/makectxt.c                      \
1140         $(LIBCBASE)/gen/siginfolst.c                    \
1141         $(LIBCBASE)/gen/siglongjmp.c                    \
1142         $(LIBCBASE)/gen/strcmp.c                        \
1143         $(LIBCBASE)/gen/sync_instruction_memory.c       \
1144         $(LIBCBASE)/sys/ptrace.c                        \
1145         $(LIBCBASE)/sys/uadmin.c
1146 
1147 # conditional assignments
1148 $(DYNLIB) := CRTI = crti.o
1149 $(DYNLIB) := CRTN = crtn.o
1150 
1151 # Files which need the threads .il inline template
1152 TIL=                            \
1153         aio.o                   \
1154         alloc.o                 \
1155         assfail.o               \
1156         atexit.o                \
1157         atfork.o                \
1158         cancel.o                \
1159         door_calls.o            \
1160         err.o                   \
1161         errno.o                 \
1162         lwp.o                   \
1163         ma.o                    \
1164         machdep.o               \
1165         posix_aio.o             \
1166         pthr_attr.o             \
1167         pthr_barrier.o          \
1168         pthr_cond.o             \
1169         pthr_mutex.o            \
1170         pthr_rwlock.o           \
1171         pthread.o               \
1172         rand.o                  \
1173         rwlock.o                \
1174         scalls.o                \
1175         sched.o                 \
1176         sema.o                  \
1177         sigaction.o             \
1178         sigev_thread.o          \
1179         spawn.o                 \
1180         stack.o                 \
1181         synch.o                 \
1182         tdb_agent.o             \
1183         thr.o                   \
1184         thread_interface.o      \
1185         thread_pool.o           \
1186         tls.o                   \
1187         tsd.o                   \
1188         tmem.o                  \
1189         unwind.o
1190 
1191 THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1192 $(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1193 
1194 # pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1195 
1196 # large-file-aware components that should be built large
1197 
1198 $(COMSYSOBJS64:%=pics/%) := \
1199         CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1200 
1201 $(SYSOBJS64:%=pics/%) := \
1202         CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1203 
1204 $(PORTGEN64:%=pics/%) := \
1205         CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1206 
1207 $(PORTSTDIO64:%=pics/%) := \
1208         CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1209 
1210 $(PORTSYS64:%=pics/%) := \
1211         CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1212 
1213 $(PORTSTDIO_W:%=pics/%) := \
1214         CPPFLAGS += -D_WIDE
1215 
1216 $(PORTPRINT_W:%=pics/%) := \
1217         CPPFLAGS += -D_WIDE
1218 
1219 $(PORTPRINT_C89:%=pics/%) := \
1220         CPPFLAGS += -D_C89_INTMAX32
1221 
1222 $(PORTSTDIO_C89:%=pics/%) := \
1223         CPPFLAGS += -D_C89_INTMAX32
1224 
1225 $(PORTI18N_COND:%=pics/%) := \
1226         CPPFLAGS += -D_WCS_LONGLONG
1227 
1228 .KEEP_STATE:
1229 
1230 all: $(LIBS) $(LIB_PIC)
1231 
1232 lint    :=      CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1233 lint    :=      CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1234 lint    :=      LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1235 
1236 lint:
1237         @echo $(LINT.c) ...
1238         @$(LINT.c) $(SRCS) $(LDLIBS)
1239 
1240 $(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1241 $(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1242 $(LINTLIB):= LINTFLAGS=-nvx
1243 
1244 # object files that depend on inline template
1245 $(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1246 # pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1247 
1248 # include common libc targets
1249 include $(LIBCDIR)/Makefile.targ
1250 
1251 # We need to strip out all CTF and DOF data from the static library
1252 $(LIB_PIC) := DIR = pics
1253 $(LIB_PIC): pics $$(PICS)
1254         $(BUILD.AR)
1255         $(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1256         $(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1257         $(AR) -ts $@ > /dev/null
1258         $(POST_PROCESS_A)
1259 
1260 $(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1261         $(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
1262             $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1263         $(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1264         $(RM) $(LIBCBASE)/crt/_rtld.s
1265 
1266 # partially built from C source
1267 pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1268         $(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1269         $(CTFCONVERT_O)
1270 
1271 ASSYMDEP_OBJS=                  \
1272         _lwp_mutex_unlock.o     \
1273         _stack_grow.o           \
1274         getcontext.o            \
1275         setjmp.o                \
1276         tls_get_addr.o          \
1277         vforkx.o
1278 
1279 $(ASSYMDEP_OBJS:%=pics/%)       :=      CPPFLAGS += -I.
1280 
1281 $(ASSYMDEP_OBJS:%=pics/%): assym.h
1282 
1283 # assym.h build rules
1284 
1285 GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1286 
1287 genassym: $(GENASSYM_C)
1288         $(NATIVECC) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc  \
1289                 -D__EXTENSIONS__ $(CPPFLAGS.native) -o $@ $(GENASSYM_C)
1290 
1291 OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1292 
1293 assym.h: $(OFFSETS) genassym
1294         $(OFFSETS_CREATE) <$(OFFSETS) >$@
1295         ./genassym >>$@
1296 
1297 # derived C source and related explicit dependencies
1298 $(LIBCDIR)/port/gen/errlst.c + \
1299 $(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1300         cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1301 
1302 pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1303 
1304 pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c