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