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