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