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 2015 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         putmsg.o                \
 271         putpmsg.o               \
 272         pwrite.o                \
 273         pwritev.o               \
 274         read.o                  \
 275         readv.o                 \
 276         resolvepath.o           \
 277         seteguid.o              \
 278         setgid.o                \
 279         setgroups.o             \
 280         setitimer.o             \
 281         setreid.o               \
 282         setrlimit.o             \
 283         setuid.o                \
 284         sigaltstk.o             \
 285         sigprocmsk.o            \
 286         sigsendset.o            \
 287         sigsuspend.o            \
 288         statfs.o                \
 289         statvfs.o               \
 290         stty.o                  \
 291         sync.o                  \
 292         sysconfig.o             \
 293         sysfs.o                 \
 294         sysinfo.o               \
 295         syslwp.o                \
 296         times.o                 \
 297         ulimit.o                \
 298         umask.o                 \
 299         umount2.o               \
 300         utssys.o                \
 301         uucopy.o                \
 302         vhangup.o               \
 303         waitid.o                \
 304         write.o                 \
 305         writev.o                \
 306         yield.o
 307 
 308 SYSOBJS=                        \
 309         __clock_gettime.o       \
 310         __getcontext.o          \
 311         __uadmin.o              \
 312         _lwp_mutex_unlock.o     \
 313         _stack_grow.o           \
 314         door.o                  \
 315         forkx.o                 \
 316         forkallx.o              \
 317         gettimeofday.o          \
 318         sparc_utrap_install.o   \
 319         syscall.o               \
 320         tls_get_addr.o          \
 321         uadmin.o                \
 322         umount.o                \
 323         uname.o                 \
 324         vforkx.o
 325 
 326 # Preserved solely to ease maintenance of 32-bit and 64-bit library builds
 327 # This macro should ALWAYS be empty; native APIs are already 'large file'.
 328 PORTGEN64=
 329 
 330 # objects from source under $(LIBCDIR)/port
 331 PORTFP=                         \
 332         __flt_decim.o           \
 333         __flt_rounds.o          \
 334         __tbl_10_b.o            \
 335         __tbl_10_h.o            \
 336         __tbl_10_s.o            \
 337         __tbl_2_b.o             \
 338         __tbl_2_h.o             \
 339         __tbl_2_s.o             \
 340         __tbl_fdq.o             \
 341         __tbl_tens.o            \
 342         __x_power.o             \
 343         _base_sup.o             \
 344         aconvert.o              \
 345         decimal_bin.o           \
 346         double_decim.o          \
 347         econvert.o              \
 348         fconvert.o              \
 349         file_decim.o            \
 350         finite.o                \
 351         fp_data.o               \
 352         func_decim.o            \
 353         gconvert.o              \
 354         hex_bin.o               \
 355         ieee_globals.o          \
 356         pack_float.o            \
 357         sigfpe.o                \
 358         string_decim.o
 359 
 360 PORTGEN=                        \
 361         _env_data.o             \
 362         _xftw.o                 \
 363         a64l.o                  \
 364         abort.o                 \
 365         addsev.o                \
 366         ascii_strncasecmp.o     \
 367         assert.o                \
 368         attrat.o                \
 369         atof.o                  \
 370         atoi.o                  \
 371         atol.o                  \
 372         atoll.o                 \
 373         attropen.o              \
 374         atexit.o                \
 375         atfork.o                \
 376         basename.o              \
 377         calloc.o                \
 378         catgets.o               \
 379         catopen.o               \
 380         cfgetispeed.o           \
 381         cfgetospeed.o           \
 382         cfree.o                 \
 383         cfsetispeed.o           \
 384         cfsetospeed.o           \
 385         cftime.o                \
 386         clock.o                 \
 387         closedir.o              \
 388         closefrom.o             \
 389         confstr.o               \
 390         crypt.o                 \
 391         csetlen.o               \
 392         ctime.o                 \
 393         ctime_r.o               \
 394         daemon.o                \
 395         deflt.o                 \
 396         directio.o              \
 397         dirname.o               \
 398         div.o                   \
 399         drand48.o               \
 400         dup.o                   \
 401         env_data.o              \
 402         err.o                   \
 403         errno.o                 \
 404         euclen.o                \
 405         event_port.o            \
 406         execvp.o                \
 407         explicit_bzero.o        \
 408         fattach.o               \
 409         fdetach.o               \
 410         fdopendir.o             \
 411         ffs.o                   \
 412         fls.o                   \
 413         fmtmsg.o                \
 414         ftime.o                 \
 415         ftok.o                  \
 416         ftw.o                   \
 417         gcvt.o                  \
 418         getauxv.o               \
 419         getcwd.o                \
 420         getdate_err.o           \
 421         getdtblsize.o           \
 422         getentropy.o            \
 423         getenv.o                \
 424         getexecname.o           \
 425         getgrnam.o              \
 426         getgrnam_r.o            \
 427         gethostid.o             \
 428         gethostname.o           \
 429         gethz.o                 \
 430         getisax.o               \
 431         getloadavg.o            \
 432         getlogin.o              \
 433         getmntent.o             \
 434         getnetgrent.o           \
 435         get_nprocs.o            \
 436         getopt.o                \
 437         getopt_long.o           \
 438         getpagesize.o           \
 439         getpw.o                 \
 440         getpwnam.o              \
 441         getpwnam_r.o            \
 442         getrusage.o             \
 443         getspent.o              \
 444         getspent_r.o            \
 445         getsubopt.o             \
 446         gettxt.o                \
 447         getusershell.o          \
 448         getut.o                 \
 449         getutx.o                \
 450         getvfsent.o             \
 451         getwd.o                 \
 452         getwidth.o              \
 453         getxby_door.o           \
 454         gtxt.o                  \
 455         hsearch.o               \
 456         iconv.o                 \
 457         imaxabs.o               \
 458         imaxdiv.o               \
 459         index.o                 \
 460         initgroups.o            \
 461         insque.o                \
 462         isaexec.o               \
 463         isastream.o             \
 464         isatty.o                \
 465         killpg.o                \
 466         klpdlib.o               \
 467         l64a.o                  \
 468         lckpwdf.o               \
 469         lconstants.o            \
 470         ldivide.o               \
 471         lexp10.o                \
 472         lfind.o                 \
 473         lfmt.o                  \
 474         lfmt_log.o              \
 475         lldiv.o                 \
 476         llog10.o                \
 477         lltostr.o               \
 478         lmath.o                 \
 479         localtime.o             \
 480         lsearch.o               \
 481         madvise.o               \
 482         malloc.o                \
 483         memalign.o              \
 484         memmem.o                \
 485         mkdev.o                 \
 486         mkdtemp.o               \
 487         mkfifo.o                \
 488         mkstemp.o               \
 489         mktemp.o                \
 490         mlock.o                 \
 491         mlockall.o              \
 492         mon.o                   \
 493         msync.o                 \
 494         munlock.o               \
 495         munlockall.o            \
 496         ndbm.o                  \
 497         nftw.o                  \
 498         nlspath_checks.o        \
 499         nsparse.o               \
 500         nss_common.o            \
 501         nss_dbdefs.o            \
 502         nss_deffinder.o         \
 503         opendir.o               \
 504         opt_data.o              \
 505         perror.o                \
 506         pfmt.o                  \
 507         pfmt_data.o             \
 508         pfmt_print.o            \
 509         pipe.o                  \
 510         plock.o                 \
 511         poll.o                  \
 512         posix_fadvise.o         \
 513         posix_fallocate.o       \
 514         posix_madvise.o         \
 515         posix_memalign.o        \
 516         priocntl.o              \
 517         privlib.o               \
 518         priv_str_xlate.o        \
 519         psiginfo.o              \
 520         psignal.o               \
 521         pt.o                    \
 522         pty.o                   \
 523         putpwent.o              \
 524         putspent.o              \
 525         raise.o                 \
 526         rand.o                  \
 527         random.o                \
 528         rctlops.o               \
 529         readdir.o               \
 530         readdir_r.o             \
 531         realpath.o              \
 532         reboot.o                \
 533         regexpr.o               \
 534         remove.o                \
 535         rewinddir.o             \
 536         rindex.o                \
 537         scandir.o               \
 538         seekdir.o               \
 539         select.o                \
 540         setlabel.o              \
 541         setpriority.o           \
 542         settimeofday.o          \
 543         sh_locks.o              \
 544         sigflag.o               \
 545         siglist.o               \
 546         sigsend.o               \
 547         sigsetops.o             \
 548         ssignal.o               \
 549         stack.o                 \
 550         stpcpy.o                \
 551         stpncpy.o               \
 552         str2sig.o               \
 553         strcase_charmap.o       \
 554         strcat.o                \
 555         strchrnul.o             \
 556         strcspn.o               \
 557         strdup.o                \
 558         strerror.o              \
 559         strlcat.o               \
 560         strncat.o               \
 561         strndup.o               \
 562         strpbrk.o               \
 563         strrchr.o               \
 564         strsep.o                \
 565         strsignal.o             \
 566         strspn.o                \
 567         strstr.o                \
 568         strtod.o                \
 569         strtoimax.o             \
 570         strtok.o                \
 571         strtok_r.o              \
 572         strtoumax.o             \
 573         swab.o                  \
 574         swapctl.o               \
 575         sysconf.o               \
 576         syslog.o                \
 577         tcdrain.o               \
 578         tcflow.o                \
 579         tcflush.o               \
 580         tcgetattr.o             \
 581         tcgetpgrp.o             \
 582         tcgetsid.o              \
 583         tcsendbreak.o           \
 584         tcsetattr.o             \
 585         tcsetpgrp.o             \
 586         tell.o                  \
 587         telldir.o               \
 588         tfind.o                 \
 589         time_data.o             \
 590         time_gdata.o            \
 591         tls_data.o              \
 592         truncate.o              \
 593         tsdalloc.o              \
 594         tsearch.o               \
 595         ttyname.o               \
 596         ttyslot.o               \
 597         ualarm.o                \
 598         ucred.o                 \
 599         valloc.o                \
 600         vlfmt.o                 \
 601         vpfmt.o                 \
 602         waitpid.o               \
 603         walkstack.o             \
 604         wdata.o                 \
 605         xgetwidth.o             \
 606         xpg4.o                  \
 607         xpg6.o
 608 
 609 PORTPRINT_W=                    \
 610         doprnt_w.o
 611 
 612 PORTPRINT=                      \
 613         asprintf.o              \
 614         doprnt.o                \
 615         fprintf.o               \
 616         printf.o                \
 617         snprintf.o              \
 618         sprintf.o               \
 619         vfprintf.o              \
 620         vprintf.o               \
 621         vsnprintf.o             \
 622         vsprintf.o              \
 623         vwprintf.o              \
 624         wprintf.o
 625 
 626 # Preserved solely to ease maintenance of 32-bit and 64-bit library builds
 627 # This macro should ALWAYS be empty; native APIs are already 'large file'.
 628 PORTSTDIO64=
 629 
 630 PORTSTDIO_W=                    \
 631         doscan_w.o
 632 
 633 PORTSTDIO=                      \
 634         __extensions.o          \
 635         _endopen.o              \
 636         _filbuf.o               \
 637         _findbuf.o              \
 638         _flsbuf.o               \
 639         _wrtchk.o               \
 640         clearerr.o              \
 641         ctermid.o               \
 642         ctermid_r.o             \
 643         cuserid.o               \
 644         data.o                  \
 645         doscan.o                \
 646         fdopen.o                \
 647         feof.o                  \
 648         ferror.o                \
 649         fgetc.o                 \
 650         fgets.o                 \
 651         fileno.o                \
 652         flockf.o                \
 653         flush.o                 \
 654         fopen.o                 \
 655         fpos.o                  \
 656         fputc.o                 \
 657         fputs.o                 \
 658         fread.o                 \
 659         fseek.o                 \
 660         fseeko.o                \
 661         ftell.o                 \
 662         ftello.o                \
 663         fwrite.o                \
 664         getc.o                  \
 665         getchar.o               \
 666         getline.o               \
 667         getpass.o               \
 668         gets.o                  \
 669         getw.o                  \
 670         popen.o                 \
 671         putc.o                  \
 672         putchar.o               \
 673         puts.o                  \
 674         putw.o                  \
 675         rewind.o                \
 676         scanf.o                 \
 677         setbuf.o                \
 678         setbuffer.o             \
 679         setvbuf.o               \
 680         system.o                \
 681         tempnam.o               \
 682         tmpfile.o               \
 683         tmpnam_r.o              \
 684         ungetc.o                \
 685         mse.o                   \
 686         vscanf.o                \
 687         vwscanf.o               \
 688         wscanf.o
 689 
 690 PORTI18N=                       \
 691         getwchar.o              \
 692         putwchar.o              \
 693         putws.o                 \
 694         strtows.o               \
 695         wcsnlen.o               \
 696         wcstoimax.o             \
 697         wcstol.o                \
 698         wcstoul.o               \
 699         wcswcs.o                \
 700         wscat.o                 \
 701         wschr.o                 \
 702         wscmp.o                 \
 703         wscpy.o                 \
 704         wscspn.o                \
 705         wsdup.o                 \
 706         wslen.o                 \
 707         wsncat.o                \
 708         wsncmp.o                \
 709         wsncpy.o                \
 710         wspbrk.o                \
 711         wsprintf.o              \
 712         wsrchr.o                \
 713         wsscanf.o               \
 714         wsspn.o                 \
 715         wstod.o                 \
 716         wstok.o                 \
 717         wstol.o                 \
 718         wstoll.o                \
 719         wsxfrm.o                \
 720         wmemchr.o               \
 721         wmemcmp.o               \
 722         wmemcpy.o               \
 723         wmemmove.o              \
 724         wmemset.o               \
 725         wcsstr.o                \
 726         gettext.o               \
 727         gettext_real.o          \
 728         gettext_util.o          \
 729         gettext_gnu.o           \
 730         plural_parser.o         \
 731         wdresolve.o             \
 732         _ctype.o                \
 733         isascii.o               \
 734         toascii.o
 735 
 736 PORTI18N_COND=                  \
 737         wcstol_longlong.o       \
 738         wcstoul_longlong.o
 739 
 740 PORTLOCALE=                     \
 741         big5.o                  \
 742         btowc.o                 \
 743         collate.o               \
 744         collcmp.o               \
 745         euc.o                   \
 746         fnmatch.o               \
 747         fgetwc.o                \
 748         fgetws.o                \
 749         fix_grouping.o          \
 750         fputwc.o                \
 751         fputws.o                \
 752         fwide.o                 \
 753         gb18030.o               \
 754         gb2312.o                \
 755         gbk.o                   \
 756         getdate.o               \
 757         isdigit.o               \
 758         iswctype.o              \
 759         ldpart.o                \
 760         lmessages.o             \
 761         lnumeric.o              \
 762         lmonetary.o             \
 763         localeconv.o            \
 764         localeimpl.o            \
 765         mbftowc.o               \
 766         mblen.o                 \
 767         mbrlen.o                \
 768         mbrtowc.o               \
 769         mbsinit.o               \
 770         mbsnrtowcs.o            \
 771         mbsrtowcs.o             \
 772         mbstowcs.o              \
 773         mbtowc.o                \
 774         mskanji.o               \
 775         nextwctype.o            \
 776         nl_langinfo.o           \
 777         none.o                  \
 778         regcomp.o               \
 779         regfree.o               \
 780         regerror.o              \
 781         regexec.o               \
 782         rune.o                  \
 783         runetype.o              \
 784         setlocale.o             \
 785         setrunelocale.o         \
 786         strcasecmp.o            \
 787         strcasestr.o            \
 788         strcoll.o               \
 789         strfmon.o               \
 790         strftime.o              \
 791         strncasecmp.o           \
 792         strptime.o              \
 793         strxfrm.o               \
 794         table.o                 \
 795         timelocal.o             \
 796         tolower.o               \
 797         towlower.o              \
 798         ungetwc.o               \
 799         utf8.o                  \
 800         wcrtomb.o               \
 801         wcscasecmp.o            \
 802         wcscoll.o               \
 803         wcsftime.o              \
 804         wcsnrtombs.o            \
 805         wcsrtombs.o             \
 806         wcstombs.o              \
 807         wcswidth.o              \
 808         wcsxfrm.o               \
 809         wctob.o                 \
 810         wctomb.o                \
 811         wctrans.o               \
 812         wctype.o                \
 813         wcwidth.o               \
 814         wscol.o
 815 
 816 AIOOBJS=                        \
 817         aio.o                   \
 818         aio_alloc.o             \
 819         posix_aio.o
 820 
 821 RTOBJS=                         \
 822         clock_timer.o           \
 823         mqueue.o                \
 824         pos4obj.o               \
 825         sched.o                 \
 826         sem.o                   \
 827         shm.o                   \
 828         sigev_thread.o
 829 
 830 TPOOLOBJS=                      \
 831         thread_pool.o
 832 
 833 THREADSOBJS=                    \
 834         alloc.o                 \
 835         assfail.o               \
 836         cancel.o                \
 837         door_calls.o            \
 838         tmem.o                  \
 839         pthr_attr.o             \
 840         pthr_barrier.o          \
 841         pthr_cond.o             \
 842         pthr_mutex.o            \
 843         pthr_rwlock.o           \
 844         pthread.o               \
 845         rwlock.o                \
 846         scalls.o                \
 847         sema.o                  \
 848         sigaction.o             \
 849         spawn.o                 \
 850         synch.o                 \
 851         tdb_agent.o             \
 852         thr.o                   \
 853         thread_interface.o      \
 854         tls.o                   \
 855         tsd.o
 856 
 857 THREADSMACHOBJS=                \
 858         machdep.o
 859 
 860 THREADSASMOBJS=                 \
 861         asm_subr.o
 862 
 863 UNICODEOBJS=                    \
 864         u8_textprep.o           \
 865         uconv.o
 866 
 867 UNWINDMACHOBJS=                 \
 868         unwind.o
 869 
 870 UNWINDASMOBJS=                  \
 871         unwind_frame.o
 872 
 873 # Preserved solely to ease maintenance of 32-bit and 64-bit library builds
 874 # This macro should ALWAYS be empty; native APIs are already 'large file'.
 875 PORTSYS64=
 876 
 877 PORTSYS=                        \
 878         _autofssys.o            \
 879         access.o                \
 880         acctctl.o               \
 881         bsd_signal.o            \
 882         chmod.o                 \
 883         chown.o                 \
 884         corectl.o               \
 885         eventfd.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