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