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