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