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         cfmakeraw.o             \
 366         cfree.o                 \
 367         cfsetspeed.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         memset_s.o              \
 471         mkdev.o                 \
 472         mkdtemp.o               \
 473         mkfifo.o                \
 474         mkstemp.o               \
 475         mktemp.o                \
 476         mlock.o                 \
 477         mlockall.o              \
 478         mon.o                   \
 479         msync.o                 \
 480         munlock.o               \
 481         munlockall.o            \
 482         ndbm.o                  \
 483         nftw.o                  \
 484         nlspath_checks.o        \
 485         nsparse.o               \
 486         nss_common.o            \
 487         nss_dbdefs.o            \
 488         nss_deffinder.o         \
 489         opendir.o               \
 490         opt_data.o              \
 491         perror.o                \
 492         pfmt.o                  \
 493         pfmt_data.o             \
 494         pfmt_print.o            \
 495         pipe.o                  \
 496         plock.o                 \
 497         poll.o                  \
 498         posix_fadvise.o         \
 499         posix_fallocate.o       \
 500         posix_madvise.o         \
 501         posix_memalign.o        \
 502         priocntl.o              \
 503         priv_str_xlate.o        \
 504         privlib.o               \
 505         psecflags.o             \
 506         psiginfo.o              \
 507         psignal.o               \
 508         pt.o                    \
 509         putpwent.o              \
 510         putspent.o              \
 511         raise.o                 \
 512         rand.o                  \
 513         random.o                \
 514         rctlops.o               \
 515         readdir.o               \
 516         readdir_r.o             \
 517         reallocarray.o          \
 518         reallocf.o              \
 519         recallocarray.o         \
 520         realpath.o              \
 521         reboot.o                \
 522         regexpr.o               \
 523         remove.o                \
 524         rewinddir.o             \
 525         rindex.o                \
 526         scandir.o               \
 527         seekdir.o               \
 528         select.o                \
 529         set_constraint_handler_s.o \
 530         setlabel.o              \
 531         setpriority.o           \
 532         settimeofday.o          \
 533         sh_locks.o              \
 534         sigflag.o               \
 535         siglist.o               \
 536         sigsend.o               \
 537         sigsetops.o             \
 538         ssignal.o               \
 539         stack.o                 \
 540         stpcpy.o                \
 541         stpncpy.o               \
 542         str2sig.o               \
 543         strcase_charmap.o       \
 544         strcat.o                \
 545         strchr.o                \
 546         strchrnul.o             \
 547         strcspn.o               \
 548         strdup.o                \
 549         strerror.o              \
 550         strlcat.o               \
 551         strlcpy.o               \
 552         strncat.o               \
 553         strndup.o               \
 554         strpbrk.o               \
 555         strrchr.o               \
 556         strsep.o                \
 557         strsignal.o             \
 558         strspn.o                \
 559         strstr.o                \
 560         strtod.o                \
 561         strtoimax.o             \
 562         strtok.o                \
 563         strtok_r.o              \
 564         strtonum.o              \
 565         strtoumax.o             \
 566         swab.o                  \
 567         swapctl.o               \
 568         sysconf.o               \
 569         syslog.o                \
 570         tcdrain.o               \
 571         tcflow.o                \
 572         tcflush.o               \
 573         tcgetattr.o             \
 574         tcgetpgrp.o             \
 575         tcgetsid.o              \
 576         tcsendbreak.o           \
 577         tcsetattr.o             \
 578         tcsetpgrp.o             \
 579         tell.o                  \
 580         telldir.o               \
 581         tfind.o                 \
 582         time_data.o             \
 583         time_gdata.o            \
 584         timespec_get.o          \
 585         tls_data.o              \
 586         truncate.o              \
 587         tsdalloc.o              \
 588         tsearch.o               \
 589         ttyname.o               \
 590         ttyslot.o               \
 591         ualarm.o                \
 592         ucred.o                 \
 593         valloc.o                \
 594         vlfmt.o                 \
 595         vpfmt.o                 \
 596         waitpid.o               \
 597         walkstack.o             \
 598         wdata.o                 \
 599         xgetwidth.o             \
 600         xpg4.o                  \
 601         xpg6.o
 602 
 603 PORTINET=                       \
 604         inet_lnaof.o            \
 605         inet_makeaddr.o         \
 606         inet_network.o          \
 607         inet_ntoa.o             \
 608         inet_ntop.o             \
 609         inet_pton.o
 610 
 611 PORTPRINT_W=                    \
 612         doprnt_w.o
 613 
 614 PORTPRINT=                      \
 615         asprintf.o              \
 616         doprnt.o                \
 617         fprintf.o               \
 618         printf.o                \
 619         snprintf.o              \
 620         sprintf.o               \
 621         vfprintf.o              \
 622         vprintf.o               \
 623         vsnprintf.o             \
 624         vsprintf.o              \
 625         vwprintf.o              \
 626         wprintf.o
 627 
 628 # Preserved solely to ease maintenance of 32-bit and 64-bit library builds
 629 # This macro should ALWAYS be empty; native APIs are already 'large file'.
 630 PORTSTDIO64=
 631 
 632 PORTSTDIO_W=                    \
 633         doscan_w.o
 634 
 635 PORTSTDIO=                      \
 636         __extensions.o          \
 637         _endopen.o              \
 638         _filbuf.o               \
 639         _findbuf.o              \
 640         _flsbuf.o               \
 641         _wrtchk.o               \
 642         clearerr.o              \
 643         ctermid.o               \
 644         ctermid_r.o             \
 645         cuserid.o               \
 646         data.o                  \
 647         doscan.o                \
 648         fdopen.o                \
 649         feof.o                  \
 650         ferror.o                \
 651         fgetc.o                 \
 652         fgets.o                 \
 653         fileno.o                \
 654         flockf.o                \
 655         flush.o                 \
 656         fopen.o                 \
 657         fpos.o                  \
 658         fputc.o                 \
 659         fputs.o                 \
 660         fread.o                 \
 661         fseek.o                 \
 662         fseeko.o                \
 663         ftell.o                 \
 664         ftello.o                \
 665         fwrite.o                \
 666         getc.o                  \
 667         getchar.o               \
 668         getline.o               \
 669         getpass.o               \
 670         gets.o                  \
 671         getw.o                  \
 672         mse.o                   \
 673         popen.o                 \
 674         putc.o                  \
 675         putchar.o               \
 676         puts.o                  \
 677         putw.o                  \
 678         rewind.o                \
 679         scanf.o                 \
 680         setbuf.o                \
 681         setbuffer.o             \
 682         setvbuf.o               \
 683         system.o                \
 684         tempnam.o               \
 685         tmpfile.o               \
 686         tmpnam_r.o              \
 687         ungetc.o                \
 688         vscanf.o                \
 689         vwscanf.o               \
 690         wscanf.o
 691 
 692 PORTI18N=                       \
 693         getwchar.o              \
 694         putwchar.o              \
 695         putws.o                 \
 696         strtows.o               \
 697         wcsnlen.o               \
 698         wcsstr.o                \
 699         wcstoimax.o             \
 700         wcstol.o                \
 701         wcstoul.o               \
 702         wcswcs.o                \
 703         wmemchr.o               \
 704         wmemcmp.o               \
 705         wmemcpy.o               \
 706         wmemmove.o              \
 707         wmemset.o               \
 708         wscat.o                 \
 709         wschr.o                 \
 710         wscmp.o                 \
 711         wscpy.o                 \
 712         wscspn.o                \
 713         wsdup.o                 \
 714         wslen.o                 \
 715         wsncat.o                \
 716         wsncmp.o                \
 717         wsncpy.o                \
 718         wspbrk.o                \
 719         wsprintf.o              \
 720         wsrchr.o                \
 721         wsscanf.o               \
 722         wsspn.o                 \
 723         wstod.o                 \
 724         wstok.o                 \
 725         wstol.o                 \
 726         wstoll.o                \
 727         wsxfrm.o                \
 728         gettext.o               \
 729         gettext_gnu.o           \
 730         gettext_real.o          \
 731         gettext_util.o          \
 732         plural_parser.o         \
 733         wdresolve.o             \
 734         _ctype.o                \
 735         isascii.o               \
 736         toascii.o
 737 
 738 PORTI18N_COND=                  \
 739         wcstol_longlong.o       \
 740         wcstoul_longlong.o
 741 
 742 PORTLOCALE=                     \
 743         big5.o                  \
 744         btowc.o                 \
 745         collate.o               \
 746         collcmp.o               \
 747         euc.o                   \
 748         fnmatch.o               \
 749         fgetwc.o                \
 750         fgetws.o                \
 751         fix_grouping.o          \
 752         fputwc.o                \
 753         fputws.o                \
 754         fwide.o                 \
 755         gb18030.o               \
 756         gb2312.o                \
 757         gbk.o                   \
 758         getdate.o               \
 759         isdigit.o               \
 760         iswctype.o              \
 761         ldpart.o                \
 762         lmessages.o             \
 763         lnumeric.o              \
 764         lmonetary.o             \
 765         localeconv.o            \
 766         localeimpl.o            \
 767         mbftowc.o               \
 768         mblen.o                 \
 769         mbrlen.o                \
 770         mbrtowc.o               \
 771         mbsinit.o               \
 772         mbsnrtowcs.o            \
 773         mbsrtowcs.o             \
 774         mbstowcs.o              \
 775         mbtowc.o                \
 776         mskanji.o               \
 777         nextwctype.o            \
 778         nl_langinfo.o           \
 779         none.o                  \
 780         rune.o                  \
 781         runetype.o              \
 782         setlocale.o             \
 783         setrunelocale.o         \
 784         strcasecmp.o            \
 785         strcasestr.o            \
 786         strcoll.o               \
 787         strfmon.o               \
 788         strftime.o              \
 789         strncasecmp.o           \
 790         strptime.o              \
 791         strxfrm.o               \
 792         table.o                 \
 793         timelocal.o             \
 794         tolower.o               \
 795         towlower.o              \
 796         ungetwc.o               \
 797         utf8.o                  \
 798         wcrtomb.o               \
 799         wcscasecmp.o            \
 800         wcscoll.o               \
 801         wcsftime.o              \
 802         wcsnrtombs.o            \
 803         wcsrtombs.o             \
 804         wcswidth.o              \
 805         wcstombs.o              \
 806         wcsxfrm.o               \
 807         wctob.o                 \
 808         wctomb.o                \
 809         wctrans.o               \
 810         wctype.o                \
 811         wcwidth.o               \
 812         wscol.o
 813 
 814 AIOOBJS=                        \
 815         aio.o                   \
 816         aio_alloc.o             \
 817         posix_aio.o
 818 
 819 RTOBJS=                         \
 820         clock_timer.o           \
 821         mqueue.o                \
 822         pos4obj.o               \
 823         sched.o                 \
 824         sem.o                   \
 825         shm.o                   \
 826         sigev_thread.o
 827 
 828 SECFLAGSOBJS=                   \
 829         secflags.o
 830 
 831 TPOOLOBJS=                      \
 832         thread_pool.o
 833 
 834 THREADSOBJS=                    \
 835         alloc.o                 \
 836         assfail.o               \
 837         c11_thr.o               \
 838         cancel.o                \
 839         door_calls.o            \
 840         tmem.o                  \
 841         pthr_attr.o             \
 842         pthr_barrier.o          \
 843         pthr_cond.o             \
 844         pthr_mutex.o            \
 845         pthr_rwlock.o           \
 846         pthread.o               \
 847         rwlock.o                \
 848         scalls.o                \
 849         sema.o                  \
 850         sigaction.o             \
 851         spawn.o                 \
 852         synch.o                 \
 853         tdb_agent.o             \
 854         thr.o                   \
 855         thread_interface.o      \
 856         tls.o                   \
 857         tsd.o
 858 
 859 THREADSMACHOBJS=                \
 860         machdep.o
 861 
 862 THREADSASMOBJS=                 \
 863         asm_subr.o
 864 
 865 UNICODEOBJS=                    \
 866         u8_textprep.o           \
 867         uconv.o
 868 
 869 UNWINDMACHOBJS=                 \
 870         call_frame_inst.o       \
 871         eh_frame.o              \
 872         thrp_unwind.o           \
 873         unwind.o
 874 
 875 pics/unwind.o:= COPTFLAG64 =
 876 
 877 UNWINDASMOBJS=                  \
 878         unwind_frame.o
 879 
 880 # Preserved solely to ease maintenance of 32-bit and 64-bit library builds
 881 # This macro should ALWAYS be empty; native APIs are already 'large file'.
 882 PORTSYS64=
 883 
 884 PORTSYS=                        \
 885         _autofssys.o            \
 886         access.o                \
 887         acctctl.o               \
 888         bsd_signal.o            \
 889         chmod.o                 \
 890         chown.o                 \
 891         corectl.o               \
 892         epoll.o                 \
 893         exacctsys.o             \
 894         execl.o                 \
 895         execle.o                \
 896         execv.o                 \
 897         eventfd.o               \
 898         fcntl.o                 \
 899         getpagesizes.o          \
 900         getpeerucred.o          \
 901         inst_sync.o             \
 902         issetugid.o             \
 903         label.o                 \
 904         link.o                  \
 905         lockf.o                 \
 906         lwp.o                   \
 907         lwp_cond.o              \
 908         lwp_rwlock.o            \
 909         lwp_sigmask.o           \
 910         meminfosys.o            \
 911         mkdir.o                 \
 912         mknod.o                 \
 913         msgsys.o                \
 914         nfssys.o                \
 915         open.o                  \
 916         pgrpsys.o               \
 917         posix_sigwait.o         \
 918         ppriv.o                 \
 919         psetsys.o               \
 920         rctlsys.o               \
 921         readlink.o              \
 922         rename.o                \
 923         sbrk.o                  \
 924         semsys.o                \
 925         set_errno.o             \
 926         sharefs.o               \
 927         shmsys.o                \
 928         sidsys.o                \
 929         siginterrupt.o          \
 930         signal.o                \
 931         signalfd.o              \
 932         sigpending.o            \
 933         sigstack.o              \
 934         stat.o                  \
 935         symlink.o               \
 936         tasksys.o               \
 937         time.o                  \
 938         time_util.o             \
 939         timerfd.o               \
 940         ucontext.o              \
 941         unlink.o                \
 942         ustat.o                 \
 943         utimesys.o              \
 944         zone.o
 945 
 946 PORTREGEX=                      \
 947         glob.o                  \
 948         regcmp.o                \
 949         regcomp.o               \
 950         regerror.o              \
 951         regex.o                 \
 952         regexec.o               \
 953         regfree.o               \
 954         wordexp.o
 955 
 956 VALUES=                         \
 957         values-Xa.o
 958 
 959 MOSTOBJS=                       \
 960         $(STRETS)               \
 961         $(CRTOBJS)              \
 962         $(DYNOBJS)              \
 963         $(FPOBJS)               \
 964         $(I386FPOBJS)           \
 965         $(FPASMOBJS)            \
 966         $(ATOMICOBJS)           \
 967         $(CHACHAOBJS)           \
 968         $(XATTROBJS)            \
 969         $(COMOBJS)              \
 970         $(GENOBJS)              \
 971         $(PORTFP)               \
 972         $(PORTGEN)              \
 973         $(PORTGEN64)            \
 974         $(PORTI18N)             \
 975         $(PORTI18N_COND)        \
 976         $(PORTINET)             \
 977         $(PORTLOCALE)           \
 978         $(PORTPRINT)            \
 979         $(PORTPRINT_W)          \
 980         $(PORTREGEX)            \
 981         $(PORTSTDIO)            \
 982         $(PORTSTDIO64)          \
 983         $(PORTSTDIO_W)          \
 984         $(PORTSYS)              \
 985         $(PORTSYS64)            \
 986         $(AIOOBJS)              \
 987         $(RTOBJS)               \
 988         $(SECFLAGSOBJS)         \
 989         $(TPOOLOBJS)            \
 990         $(THREADSOBJS)          \
 991         $(THREADSMACHOBJS)      \
 992         $(THREADSASMOBJS)       \
 993         $(UNICODEOBJS)          \
 994         $(UNWINDMACHOBJS)       \
 995         $(UNWINDASMOBJS)        \
 996         $(COMSYSOBJS)           \
 997         $(SYSOBJS)              \
 998         $(COMSYSOBJS64)         \
 999         $(SYSOBJS64)            \
1000         $(VALUES)
1001 
1002 TRACEOBJS=                      \
1003         plockstat.o
1004 
1005 # NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o
1006 # modules whose source is provided in the $(SRC)/lib/crt directory.
1007 # This must be done because otherwise the Sun C compiler would insert
1008 # its own versions of these modules and those versions contain code
1009 # to call out to C++ initialization functions.  Such C++ initialization
1010 # functions can call back into libc before thread initialization is
1011 # complete and this leads to segmentation violations and other problems.
1012 # Since libc contains no C++ code, linking with the minimal crti.o and
1013 # crtn.o modules is safe and avoids the problems described above.
1014 OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1015 CRTSRCS= ../../crt/amd64
1016 
1017 # include common library definitions
1018 include ../../Makefile.lib
1019 include ../../Makefile.lib.64
1020 
1021 CFLAGS64 += $(CTF_FLAGS)
1022 
1023 # This is necessary to avoid problems with calling _ex_unwind().
1024 # We probably don't want any inlining anyway.
1025 CFLAGS64 += -xinline=
1026 
1027 CERRWARN += -_gcc=-Wno-parentheses
1028 CERRWARN += -_gcc=-Wno-switch
1029 CERRWARN += $(CNOWARN_UNINIT)
1030 CERRWARN += -_gcc=-Wno-unused-value
1031 CERRWARN += -_gcc=-Wno-unused-label
1032 CERRWARN += -_gcc=-Wno-unused-variable
1033 CERRWARN += -_gcc=-Wno-type-limits
1034 CERRWARN += -_gcc=-Wno-char-subscripts
1035 CERRWARN += -_gcc=-Wno-clobbered
1036 CERRWARN += -_gcc=-Wno-unused-function
1037 CERRWARN += -_gcc=-Wno-address
1038 
1039 $(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
1040 
1041 # not linted
1042 SMATCH=off
1043 
1044 # Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1045 # enables ASSERT() checking in the threads portion of the library.
1046 # This is automatically enabled for DEBUG builds, not for non-debug builds.
1047 THREAD_DEBUG =
1048 $(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1049 
1050 # Make string literals read-only to save memory
1051 CFLAGS64 += $(XSTRCONST)
1052 
1053 ALTPICS= $(TRACEOBJS:%=pics/%)
1054 
1055 $(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1056 
1057 MAPFILES =      $(LIBCDIR)/port/mapfile-vers
1058 
1059 CPPFLAGS=       -D_REENTRANT -D$(MACH64) -D__$(MACH64) $(THREAD_DEBUG) \
1060                 -I. -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1061 ASFLAGS=        $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
1062                 $(amd64_AS_XARCH)
1063 
1064 # As a favor to the dtrace syscall provider, libc still calls the
1065 # old syscall traps that have been obsoleted by the *at() interfaces.
1066 # Delete this to compile libc using only the new *at() system call traps
1067 CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1068 
1069 # proc64_id.o is built with defines in $(SRC)/uts/intel/sys/x86_archext.h
1070 pics/proc64_id.o        := CFLAGS64 += -I$(SRC)/uts/intel
1071 
1072 # Inform the run-time linker about libc specialized initialization
1073 RTLDINFO =      -z rtldinfo=tls_rtldinfo
1074 DYNFLAGS +=     $(RTLDINFO)
1075 
1076 # Force libc's internal references to be resolved immediately upon loading
1077 # in order to avoid critical region problems.  Since almost all libc symbols
1078 # are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1079 DYNFLAGS +=     -znow
1080 
1081 BUILD.s=        $(AS) $(ASFLAGS) $< -o $@
1082 
1083 # Override this top level flag so the compiler builds in its native
1084 # C99 mode.  This has been enabled to support the complex arithmetic
1085 # added to libc.
1086 CSTD=   $(CSTD_GNU99)
1087 
1088 # libc method of building an archive
1089 # The "$(GREP) -v ' L '" part is necessary only until
1090 # lorder is fixed to ignore thread-local variables.
1091 BUILD.AR= $(RM) $@ ; \
1092         $(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1093 
1094 # extra files for the clean target
1095 CLEANFILES +=                   \
1096         $(LIBCDIR)/port/gen/errlst.c    \
1097         $(LIBCDIR)/port/gen/new_list.c  \
1098         assym.h                 \
1099         genassym                \
1100         crt/_rtld.s             \
1101         pics/crti.o             \
1102         pics/crtn.o             \
1103         $(ALTPICS)
1104 
1105 CLOBBERFILES += $(LIB_PIC)
1106 
1107 # conditional assignments
1108 # $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1109 $(DYNLIB) := CRTI = crti.o
1110 $(DYNLIB) := CRTN = crtn.o
1111 
1112 # Files which need the threads .il inline template
1113 TIL=                            \
1114         aio.o                   \
1115         alloc.o                 \
1116         assfail.o               \
1117         atexit.o                \
1118         atfork.o                \
1119         cancel.o                \
1120         door_calls.o            \
1121         err.o                   \
1122         errno.o                 \
1123         lwp.o                   \
1124         ma.o                    \
1125         machdep.o               \
1126         posix_aio.o             \
1127         pthr_attr.o             \
1128         pthr_barrier.o          \
1129         pthr_cond.o             \
1130         pthr_mutex.o            \
1131         pthr_rwlock.o           \
1132         pthread.o               \
1133         rand.o                  \
1134         rwlock.o                \
1135         scalls.o                \
1136         sched.o                 \
1137         sema.o                  \
1138         sigaction.o             \
1139         sigev_thread.o          \
1140         spawn.o                 \
1141         stack.o                 \
1142         synch.o                 \
1143         tdb_agent.o             \
1144         thr.o                   \
1145         thread_interface.o      \
1146         thread_pool.o           \
1147         thrp_unwind.o           \
1148         tls.o                   \
1149         tmem.o                  \
1150         tsd.o
1151 
1152 $(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1153 
1154 # pics/mul64.o := CFLAGS64 += crt/mul64.il
1155 
1156 # large-file-aware components that should be built large
1157 
1158 #$(COMSYSOBJS64:%=pics/%) := \
1159 #       CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1160 
1161 #$(SYSOBJS64:%=pics/%) := \
1162 #       CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1163 
1164 #$(PORTGEN64:%=pics/%) := \
1165 #       CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1166 
1167 #$(PORTSTDIO64:%=pics/%) := \
1168 #       CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1169 
1170 #$(PORTSYS64:%=pics/%) := \
1171 #       CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1172 
1173 $(PORTSTDIO_W:%=pics/%) := \
1174         CPPFLAGS += -D_WIDE
1175 
1176 $(PORTPRINT_W:%=pics/%) := \
1177         CPPFLAGS += -D_WIDE
1178 
1179 $(PORTPRINT_C89:%=pics/%) := \
1180         CPPFLAGS += -D_C89_INTMAX32
1181 
1182 $(PORTSTDIO_C89:%=pics/%) := \
1183         CPPFLAGS += -D_C89_INTMAX32
1184 
1185 $(PORTI18N_COND:%=pics/%) := \
1186         CPPFLAGS += -D_WCS_LONGLONG
1187 
1188 pics/arc4random.o :=    CPPFLAGS += -I$(SRC)/common/crypto/chacha
1189 
1190 pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
1191 
1192 .KEEP_STATE:
1193 
1194 all: $(LIBS) $(LIB_PIC)
1195 
1196 # object files that depend on inline template
1197 $(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1198 # pics/mul64.o: crt/mul64.il
1199 
1200 # include common libc targets
1201 include ../Makefile.targ
1202 
1203 # We need to strip out all CTF data from the static library
1204 $(LIB_PIC) := DIR = pics
1205 $(LIB_PIC): pics $$(PICS)
1206         $(BUILD.AR)
1207         $(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1208         $(AR) -ts $@ > /dev/null
1209         $(POST_PROCESS_A)
1210 
1211 ASSYMDEP_OBJS=                  \
1212         _lwp_mutex_unlock.o     \
1213         _stack_grow.o           \
1214         asm_subr.o              \
1215         getcontext.o            \
1216         setjmp.o                \
1217         tls_get_addr.o          \
1218         vforkx.o
1219 
1220 $(ASSYMDEP_OBJS:%=pics/%): assym.h
1221 
1222 # assym.h build rules
1223 
1224 GENASSYM_C = genassym.c
1225 
1226 genassym: $(GENASSYM_C)
1227         $(NATIVECC) $(NATIVE_CFLAGS) -Iinc -I$(LIBCDIR)/inc $(CPPFLAGS.native) \
1228                 -o $@ $(GENASSYM_C)
1229 
1230 OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1231 
1232 assym.h: $(OFFSETS) genassym
1233         $(OFFSETS_CREATE) <$(OFFSETS) >$@
1234         ./genassym >>$@
1235 
1236 # derived C source and related explicit dependencies
1237 $(LIBCDIR)/port/gen/errlst.c + \
1238 $(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1239         cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1240 
1241 pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1242 
1243 pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c