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