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