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