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