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