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