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 2008 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# ident "%Z%%M% %I% %E% SMI" 26# 27 28LIBCBASE=. 29 30LIBRARY= libc.a 31LIB_PIC= libc_pic.a 32VERS= .1 33CPP= /usr/lib/cpp 34TARGET_ARCH= sparc 35 36# objects are grouped by source directory 37 38# local objects 39STRETS= 40 41CRTOBJS= \ 42 __align_cpy_2.o \ 43 __align_cpy_4.o \ 44 __align_cpy_8.o \ 45 _ftou.o \ 46 cerror.o 47 48DYNOBJS= 49 50FPOBJS= \ 51 _D_cplx_div.o \ 52 _D_cplx_div_ix.o \ 53 _D_cplx_div_rx.o \ 54 _D_cplx_mul.o \ 55 _F_cplx_div.o \ 56 _F_cplx_div_ix.o \ 57 _F_cplx_div_rx.o \ 58 _F_cplx_mul.o \ 59 _Q_add.o \ 60 _Q_cmp.o \ 61 _Q_cmpe.o \ 62 _Q_cplx_div.o \ 63 _Q_cplx_div_ix.o \ 64 _Q_cplx_div_rx.o \ 65 _Q_cplx_lr_div.o \ 66 _Q_cplx_lr_div_ix.o \ 67 _Q_cplx_lr_div_rx.o \ 68 _Q_cplx_lr_mul.o \ 69 _Q_cplx_mul.o \ 70 _Q_div.o \ 71 _Q_dtoq.o \ 72 _Q_fcc.o \ 73 _Q_itoq.o \ 74 _Q_mul.o \ 75 _Q_neg.o \ 76 _Q_qtod.o \ 77 _Q_qtoi.o \ 78 _Q_qtos.o \ 79 _Q_qtou.o \ 80 _Q_scl.o \ 81 _Q_sqrt.o \ 82 _Q_stoq.o \ 83 _Q_sub.o \ 84 _Q_utoq.o 85 86FPOBJS64= \ 87 _Qp_qtox.o \ 88 _Qp_qtoux.o \ 89 _Qp_xtoq.o \ 90 _Qp_uxtoq.o \ 91 __dtoul.o \ 92 __ftoul.o 93 94FPASMOBJS= \ 95 _Q_get_rp_rd.o \ 96 __quad_mag64.o \ 97 fpgetmask.o \ 98 fpgetrnd.o \ 99 fpgetsticky.o \ 100 fpsetmask.o \ 101 fpsetrnd.o \ 102 fpsetsticky.o 103 104$(__GNUC)FPASMOBJS += \ 105 __quad.o 106 107ATOMICOBJS= \ 108 atomic.o 109 110XATTROBJS= \ 111 xattr_common.o 112 113COMOBJS= \ 114 bcmp.o \ 115 bcopy.o \ 116 bsearch.o \ 117 bzero.o \ 118 ffs.o \ 119 memccpy.o \ 120 qsort.o \ 121 strtol.o \ 122 strtoul.o 123 124GENOBJS= \ 125 _getsp.o \ 126 _xregs_clrptr.o \ 127 abs.o \ 128 alloca.o \ 129 byteorder.o \ 130 cuexit.o \ 131 ecvt.o \ 132 getctxt.o \ 133 lexp10.o \ 134 llog10.o \ 135 lock.o \ 136 makectxt.o \ 137 memchr.o \ 138 memcmp.o \ 139 memcpy.o \ 140 memmove.o \ 141 memset.o \ 142 new_list.o \ 143 setjmp.o \ 144 siginfolst.o \ 145 siglongjmp.o \ 146 sparc_data.o \ 147 strcasecmp.o \ 148 strchr.o \ 149 strcmp.o \ 150 strcpy.o \ 151 strlcpy.o \ 152 strlen.o \ 153 strncmp.o \ 154 strncpy.o \ 155 strnlen.o \ 156 swapctxt.o \ 157 sync_instruction_memory.o 158 159# Preserved solely to ease maintenance of 32-bit and 64-bit library builds 160# This macro should ALWAYS be empty; native APIs are already 'large file'. 161COMSYSOBJS64= 162 163SYSOBJS64= 164 165COMSYSOBJS= \ 166 __clock_timer.o \ 167 __getloadavg.o \ 168 __rusagesys.o \ 169 __signotify.o \ 170 __sigrt.o \ 171 __time.o \ 172 _lgrp_home_fast.o \ 173 _lgrpsys.o \ 174 _nfssys.o \ 175 _portfs.o \ 176 _pset.o \ 177 _rpcsys.o \ 178 _sigaction.o \ 179 _so_accept.o \ 180 _so_bind.o \ 181 _so_connect.o \ 182 _so_getpeername.o \ 183 _so_getsockname.o \ 184 _so_getsockopt.o \ 185 _so_listen.o \ 186 _so_recv.o \ 187 _so_recvfrom.o \ 188 _so_recvmsg.o \ 189 _so_send.o \ 190 _so_sendmsg.o \ 191 _so_sendto.o \ 192 _so_setsockopt.o \ 193 _so_shutdown.o \ 194 _so_socket.o \ 195 _so_socketpair.o \ 196 _sockconfig.o \ 197 access.o \ 198 acct.o \ 199 acl.o \ 200 adjtime.o \ 201 alarm.o \ 202 brk.o \ 203 chdir.o \ 204 chmod.o \ 205 chown.o \ 206 chroot.o \ 207 cladm.o \ 208 close.o \ 209 creat.o \ 210 dup.o \ 211 execve.o \ 212 exit.o \ 213 facl.o \ 214 fchdir.o \ 215 fchmod.o \ 216 fchown.o \ 217 fchroot.o \ 218 fcntl.o \ 219 fdsync.o \ 220 fpathconf.o \ 221 fstat.o \ 222 fstatfs.o \ 223 fstatvfs.o \ 224 getcpuid.o \ 225 getdents.o \ 226 getegid.o \ 227 geteuid.o \ 228 getgid.o \ 229 getgroups.o \ 230 gethrtime.o \ 231 getitimer.o \ 232 getmsg.o \ 233 getpid.o \ 234 getpmsg.o \ 235 getppid.o \ 236 getrlimit.o \ 237 getuid.o \ 238 gtty.o \ 239 install_utrap.o \ 240 ioctl.o \ 241 kaio.o \ 242 kill.o \ 243 lchown.o \ 244 link.o \ 245 llseek.o \ 246 lseek.o \ 247 lstat.o \ 248 memcntl.o \ 249 mincore.o \ 250 mkdir.o \ 251 mknod.o \ 252 mmap.o \ 253 modctl.o \ 254 mount.o \ 255 mprotect.o \ 256 munmap.o \ 257 nice.o \ 258 ntp_adjtime.o \ 259 ntp_gettime.o \ 260 open.o \ 261 p_online.o \ 262 pathconf.o \ 263 pause.o \ 264 pcsample.o \ 265 pollsys.o \ 266 pread.o \ 267 priocntlset.o \ 268 processor_bind.o \ 269 processor_info.o \ 270 profil.o \ 271 putmsg.o \ 272 putpmsg.o \ 273 pwrite.o \ 274 read.o \ 275 readlink.o \ 276 readv.o \ 277 rename.o \ 278 resolvepath.o \ 279 rmdir.o \ 280 seteguid.o \ 281 setgid.o \ 282 setgroups.o \ 283 setitimer.o \ 284 setreid.o \ 285 setrlimit.o \ 286 setuid.o \ 287 sigaltstk.o \ 288 sigprocmsk.o \ 289 sigsendset.o \ 290 sigsuspend.o \ 291 stat.o \ 292 statfs.o \ 293 statvfs.o \ 294 stty.o \ 295 symlink.o \ 296 sync.o \ 297 sysconfig.o \ 298 sysfs.o \ 299 sysinfo.o \ 300 syslwp.o \ 301 times.o \ 302 ulimit.o \ 303 umask.o \ 304 umount2.o \ 305 unlink.o \ 306 utime.o \ 307 utimes.o \ 308 utssys.o \ 309 uucopy.o \ 310 vhangup.o \ 311 waitid.o \ 312 write.o \ 313 writev.o \ 314 yield.o 315 316SYSOBJS= \ 317 __clock_gettime.o \ 318 __getcontext.o \ 319 _lwp_mutex_unlock.o \ 320 _stack_grow.o \ 321 door.o \ 322 forkx.o \ 323 forkallx.o \ 324 gettimeofday.o \ 325 pipe.o \ 326 sparc_utrap_install.o \ 327 syscall.o \ 328 tls_get_addr.o \ 329 uadmin.o \ 330 umount.o \ 331 uname.o \ 332 vforkx.o 333 334# Preserved solely to ease maintenance of 32-bit and 64-bit library builds 335# This macro should ALWAYS be empty; native APIs are already 'large file'. 336PORTGEN64= 337 338# objects from source under ../port 339PORTFP= \ 340 __flt_decim.o \ 341 __flt_rounds.o \ 342 __tbl_10_b.o \ 343 __tbl_10_h.o \ 344 __tbl_10_s.o \ 345 __tbl_2_b.o \ 346 __tbl_2_h.o \ 347 __tbl_2_s.o \ 348 __tbl_fdq.o \ 349 __tbl_tens.o \ 350 __x_power.o \ 351 _base_sup.o \ 352 aconvert.o \ 353 decimal_bin.o \ 354 double_decim.o \ 355 econvert.o \ 356 fconvert.o \ 357 file_decim.o \ 358 finite.o \ 359 fp_data.o \ 360 func_decim.o \ 361 gconvert.o \ 362 hex_bin.o \ 363 ieee_globals.o \ 364 pack_float.o \ 365 sigfpe.o \ 366 string_decim.o 367 368PORTGEN= \ 369 _env_data.o \ 370 _xftw.o \ 371 a64l.o \ 372 abort.o \ 373 addsev.o \ 374 assert.o \ 375 attrat.o \ 376 atof.o \ 377 atoi.o \ 378 atol.o \ 379 atoll.o \ 380 attropen.o \ 381 atexit.o \ 382 atfork.o \ 383 basename.o \ 384 calloc.o \ 385 catgets.o \ 386 catopen.o \ 387 cfgetispeed.o \ 388 cfgetospeed.o \ 389 cfree.o \ 390 cfsetispeed.o \ 391 cfsetospeed.o \ 392 cftime.o \ 393 clock.o \ 394 closedir.o \ 395 closefrom.o \ 396 confstr.o \ 397 crypt.o \ 398 csetlen.o \ 399 ctime.o \ 400 ctime_r.o \ 401 deflt.o \ 402 directio.o \ 403 dirname.o \ 404 div.o \ 405 drand48.o \ 406 dup2.o \ 407 env_data.o \ 408 err.o \ 409 errno.o \ 410 euclen.o \ 411 event_port.o \ 412 execvp.o \ 413 fattach.o \ 414 fdetach.o \ 415 fdopendir.o \ 416 fmtmsg.o \ 417 ftime.o \ 418 ftok.o \ 419 ftw.o \ 420 gcvt.o \ 421 getauxv.o \ 422 getcwd.o \ 423 getdate_err.o \ 424 getdtblsize.o \ 425 getenv.o \ 426 getexecname.o \ 427 getgrnam.o \ 428 getgrnam_r.o \ 429 gethostid.o \ 430 gethostname.o \ 431 gethz.o \ 432 getisax.o \ 433 getloadavg.o \ 434 getlogin.o \ 435 getmntent.o \ 436 getnetgrent.o \ 437 getopt.o \ 438 getopt_long.o \ 439 getpagesize.o \ 440 getpw.o \ 441 getpwnam.o \ 442 getpwnam_r.o \ 443 getrusage.o \ 444 getspent.o \ 445 getspent_r.o \ 446 getsubopt.o \ 447 gettxt.o \ 448 getusershell.o \ 449 getut.o \ 450 getutx.o \ 451 getvfsent.o \ 452 getwd.o \ 453 getwidth.o \ 454 getxby_door.o \ 455 gtxt.o \ 456 hsearch.o \ 457 iconv.o \ 458 imaxabs.o \ 459 imaxdiv.o \ 460 index.o \ 461 initgroups.o \ 462 insque.o \ 463 isaexec.o \ 464 isastream.o \ 465 isatty.o \ 466 killpg.o \ 467 klpdlib.o \ 468 l64a.o \ 469 lckpwdf.o \ 470 lconstants.o \ 471 ldivide.o \ 472 lfind.o \ 473 lfmt.o \ 474 lfmt_log.o \ 475 lldiv.o \ 476 lltostr.o \ 477 lmath.o \ 478 localtime.o \ 479 lsearch.o \ 480 madvise.o \ 481 malloc.o \ 482 memalign.o \ 483 mkdev.o \ 484 mkdtemp.o \ 485 mkfifo.o \ 486 mkstemp.o \ 487 mktemp.o \ 488 mlock.o \ 489 mlockall.o \ 490 mon.o \ 491 msync.o \ 492 munlock.o \ 493 munlockall.o \ 494 ndbm.o \ 495 nftw.o \ 496 nlspath_checks.o \ 497 nsparse.o \ 498 nss_common.o \ 499 nss_dbdefs.o \ 500 nss_deffinder.o \ 501 opendir.o \ 502 opt_data.o \ 503 perror.o \ 504 pfmt.o \ 505 pfmt_data.o \ 506 pfmt_print.o \ 507 plock.o \ 508 poll.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 strsignal.o \ 554 strspn.o \ 555 strstr.o \ 556 strtod.o \ 557 strtoimax.o \ 558 strtok.o \ 559 strtok_r.o \ 560 strtoll.o \ 561 strtoull.o \ 562 strtoumax.o \ 563 swab.o \ 564 swapctl.o \ 565 sysconf.o \ 566 syslog.o \ 567 tcdrain.o \ 568 tcflow.o \ 569 tcflush.o \ 570 tcgetattr.o \ 571 tcgetpgrp.o \ 572 tcgetsid.o \ 573 tcsendbreak.o \ 574 tcsetattr.o \ 575 tcsetpgrp.o \ 576 tell.o \ 577 telldir.o \ 578 tfind.o \ 579 time_data.o \ 580 time_gdata.o \ 581 truncate.o \ 582 tsdalloc.o \ 583 tsearch.o \ 584 ttyname.o \ 585 ttyslot.o \ 586 ualarm.o \ 587 ucred.o \ 588 valloc.o \ 589 vlfmt.o \ 590 vpfmt.o \ 591 waitpid.o \ 592 walkstack.o \ 593 wdata.o \ 594 xgetwidth.o \ 595 xpg4.o \ 596 xpg6.o 597 598PORTPRINT_W= \ 599 doprnt_w.o 600 601PORTPRINT= \ 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 fallocate.o \ 741 mqueue.o \ 742 pos4obj.o \ 743 sched.o \ 744 sem.o \ 745 shm.o \ 746 sigev_thread.o 747 748TPOOLOBJS= \ 749 thread_pool.o 750 751THREADSOBJS= \ 752 alloc.o \ 753 assfail.o \ 754 cancel.o \ 755 door_calls.o \ 756 pthr_attr.o \ 757 pthr_barrier.o \ 758 pthr_cond.o \ 759 pthr_mutex.o \ 760 pthr_rwlock.o \ 761 pthread.o \ 762 rtsched.o \ 763 rwlock.o \ 764 scalls.o \ 765 sema.o \ 766 sigaction.o \ 767 spawn.o \ 768 synch.o \ 769 tdb_agent.o \ 770 thr.o \ 771 thread_interface.o \ 772 tls.o \ 773 tsd.o 774 775THREADSMACHOBJS= \ 776 machdep.o 777 778THREADSASMOBJS= \ 779 asm_subr.o 780 781UNICODEOBJS= \ 782 u8_textprep.o \ 783 uconv.o 784 785UNWINDMACHOBJS= \ 786 unwind.o 787 788UNWINDASMOBJS= \ 789 unwind_frame.o 790 791# Preserved solely to ease maintenance of 32-bit and 64-bit library builds 792# This macro should ALWAYS be empty; native APIs are already 'large file'. 793PORTSYS64= 794 795PORTSYS= \ 796 _autofssys.o \ 797 acctctl.o \ 798 bsd_signal.o \ 799 corectl.o \ 800 exacctsys.o \ 801 execl.o \ 802 execle.o \ 803 execv.o \ 804 faccessat.o \ 805 fsmisc.o \ 806 fstatat.o \ 807 getpagesizes.o \ 808 getpeerucred.o \ 809 inst_sync.o \ 810 issetugid.o \ 811 label.o \ 812 libc_fcntl.o \ 813 libc_link.o \ 814 libc_open.o \ 815 lockf.o \ 816 lwp.o \ 817 lwp_cond.o \ 818 lwp_rwlock.o \ 819 lwp_sigmask.o \ 820 meminfosys.o \ 821 msgsys.o \ 822 nfssys.o \ 823 openat.o \ 824 pgrpsys.o \ 825 posix_sigwait.o \ 826 ppriv.o \ 827 psetsys.o \ 828 rctlsys.o \ 829 sbrk.o \ 830 semsys.o \ 831 set_errno.o \ 832 sharefs.o \ 833 shmsys.o \ 834 sidsys.o \ 835 siginterrupt.o \ 836 signal.o \ 837 sigpending.o \ 838 sigstack.o \ 839 tasksys.o \ 840 time.o \ 841 time_util.o \ 842 ucontext.o \ 843 ustat.o \ 844 zone.o 845 846PORTREGEX= \ 847 glob.o \ 848 regcmp.o \ 849 regex.o \ 850 wordexp.o 851 852VALUES= values-Xa.o 853 854MOSTOBJS= \ 855 $(STRETS) \ 856 $(CRTOBJS) \ 857 $(DYNOBJS) \ 858 $(FPOBJS) \ 859 $(FPOBJS64) \ 860 $(FPASMOBJS) \ 861 $(ATOMICOBJS) \ 862 $(XATTROBJS) \ 863 $(COMOBJS) \ 864 $(GENOBJS) \ 865 $(PORTFP) \ 866 $(PORTGEN) \ 867 $(PORTGEN64) \ 868 $(PORTI18N) \ 869 $(PORTI18N_COND) \ 870 $(PORTPRINT) \ 871 $(PORTPRINT_W) \ 872 $(PORTREGEX) \ 873 $(PORTSTDIO) \ 874 $(PORTSTDIO64) \ 875 $(PORTSTDIO_W) \ 876 $(PORTSYS) \ 877 $(PORTSYS64) \ 878 $(AIOOBJS) \ 879 $(RTOBJS) \ 880 $(TPOOLOBJS) \ 881 $(THREADSOBJS) \ 882 $(THREADSMACHOBJS) \ 883 $(THREADSASMOBJS) \ 884 $(UNICODEOBJS) \ 885 $(UNWINDMACHOBJS) \ 886 $(UNWINDASMOBJS) \ 887 $(COMSYSOBJS) \ 888 $(SYSOBJS) \ 889 $(COMSYSOBJS64) \ 890 $(SYSOBJS64) \ 891 $(VALUES) 892 893TRACEOBJS= \ 894 plockstat.o 895 896# NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o 897# modules whose source is provided in the $(SRC)/lib/common directory. 898# This must be done because otherwise the Sun C compiler would insert 899# its own versions of these modules and those versions contain code 900# to call out to C++ initialization functions. Such C++ initialization 901# functions can call back into libc before thread initialization is 902# complete and this leads to segmentation violations and other problems. 903# Since libc contains no C++ code, linking with the minimal crti.o and 904# crtn.o modules is safe and avoids the problems described above. 905OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN) 906CRTSRCS= ../../common/sparcv9 907 908# include common library definitions 909include ../../Makefile.lib 910include ../../Makefile.lib.64 911 912# NOTE: libc_i18n.a will be part of libc.so.1. Therefore, the compilation 913# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff 914# need to be compatible with the ones for the libc stuff. Whenever the changes 915# that affect the compilation conditions of libc happened, those for libc_i18n 916# also need to be updated. 917 918CFLAGS64 += $(CCVERBOSE) 919 920# This is necessary to avoid problems with calling _ex_unwind(). 921# We probably don't want any inlining anyway. 922CFLAGS64 += -xinline= 923 924# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...) 925# enables ASSERT() checking in the threads portion of the library. 926# This is automatically enabled for DEBUG builds, not for non-debug builds. 927THREAD_DEBUG = 928$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG 929 930CFLAGS64 += $(THREAD_DEBUG) 931 932ALTPICS= $(TRACEOBJS:%=pics/%) 933 934$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a 935$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) 936 937MAPFILES = ../port/mapfile-vers mapfile-vers 938 939sparcv9_C_PICFLAGS= -K PIC 940CFLAGS64 += $(EXTN_CFLAGS) 941CPPFLAGS= -D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) \ 942 -I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master) 943ASFLAGS= -K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \ 944 $(sparcv9_AS_XARCH) 945 946# Conditionally add support for making |wordexp()| check whether 947# /usr/bin/ksh is ksh93 or not 948include ../../../Makefile.ksh93switch 949CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH) 950 951# Inform the run-time linker about libc specialized initialization 952RTLDINFO = -z rtldinfo=tls_rtldinfo 953DYNFLAGS += $(RTLDINFO) 954 955DYNFLAGS += $(EXTN_DYNFLAGS) 956 957BUILD.s= $(AS) $(ASFLAGS) $< -o $@ 958 959# Override this top level flag so the compiler builds in its native 960# C99 mode. This has been enabled to support the complex arithmetic 961# added to libc. 962C99MODE= $(C99_ENABLE) 963 964# libc method of building an archive 965BUILD.AR= $(RM) $@ ; \ 966 $(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)` 967 968# extra files for the clean target 969CLEANFILES= \ 970 ../port/gen/errlst.c \ 971 ../port/gen/new_list.c \ 972 assym.h \ 973 genassym \ 974 pics/crti.o \ 975 pics/crtn.o \ 976 $(ALTPICS) 977 978CLOBBERFILES += $(LIB_PIC) 979 980# list of C source for lint 981SRCS= \ 982 $(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c) \ 983 $(XATTROBJS:%.o=$(SRC)/common/xattr/%.c) \ 984 $(COMOBJS:%.o=$(SRC)/common/util/%.c) \ 985 $(PORTFP:%.o=../port/fp/%.c) \ 986 $(PORTGEN:%.o=../port/gen/%.c) \ 987 $(PORTI18N:%.o=../port/i18n/%.c) \ 988 $(PORTPRINT:%.o=../port/print/%.c) \ 989 $(PORTREGEX:%.o=../port/regex/%.c) \ 990 $(PORTSTDIO:%.o=../port/stdio/%.c) \ 991 $(PORTSYS:%.o=../port/sys/%.c) \ 992 $(AIOOBJS:%.o=../port/aio/%.c) \ 993 $(RTOBJS:%.o=../port/rt/%.c) \ 994 $(TPOOLOBJS:%.o=../port/tpool/%.c) \ 995 $(THREADSOBJS:%.o=../port/threads/%.c) \ 996 $(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c) \ 997 $(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c) \ 998 $(UNWINDMACHOBJS:%.o=../port/unwind/%.c) \ 999 $(FPOBJS:%.o=../$(MACH)/fp/%.c) \ 1000 $(FPOBJS64:%.o=$(LIBCBASE)/fp/%.c) \ 1001 $(LIBCBASE)/crt/_ftou.c \ 1002 $(LIBCBASE)/gen/_xregs_clrptr.c \ 1003 $(LIBCBASE)/gen/byteorder.c \ 1004 $(LIBCBASE)/gen/ecvt.c \ 1005 $(LIBCBASE)/gen/getctxt.c \ 1006 $(LIBCBASE)/gen/lexp10.c \ 1007 $(LIBCBASE)/gen/llog10.c \ 1008 $(LIBCBASE)/gen/makectxt.c \ 1009 $(LIBCBASE)/gen/siginfolst.c \ 1010 $(LIBCBASE)/gen/siglongjmp.c \ 1011 $(LIBCBASE)/gen/swapctxt.c 1012 1013# conditional assignments 1014$(DYNLIB) := CRTI = crti.o 1015$(DYNLIB) := CRTN = crtn.o 1016 1017# Files which need the threads .il inline template 1018TIL= \ 1019 aio.o \ 1020 alloc.o \ 1021 assfail.o \ 1022 atexit.o \ 1023 atfork.o \ 1024 cancel.o \ 1025 door_calls.o \ 1026 errno.o \ 1027 getctxt.o \ 1028 lwp.o \ 1029 ma.o \ 1030 machdep.o \ 1031 posix_aio.o \ 1032 pthr_attr.o \ 1033 pthr_barrier.o \ 1034 pthr_cond.o \ 1035 pthr_mutex.o \ 1036 pthr_rwlock.o \ 1037 pthread.o \ 1038 rand.o \ 1039 rtsched.o \ 1040 rwlock.o \ 1041 scalls.o \ 1042 sema.o \ 1043 sigaction.o \ 1044 sigev_thread.o \ 1045 spawn.o \ 1046 stack.o \ 1047 swapctxt.o \ 1048 synch.o \ 1049 tdb_agent.o \ 1050 thr.o \ 1051 thread_interface.o \ 1052 thread_pool.o \ 1053 tls.o \ 1054 tsd.o \ 1055 unwind.o 1056 1057$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il 1058 1059# Files in fp, port/fp subdirectories that need base.il inline template 1060IL= \ 1061 __flt_decim.o \ 1062 decimal_bin.o 1063 1064$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il 1065 1066# Files in fp subdirectory which need __quad.il inline template 1067QIL= \ 1068 _Q_add.o \ 1069 _Q_cmp.o \ 1070 _Q_cmpe.o \ 1071 _Q_div.o \ 1072 _Q_dtoq.o \ 1073 _Q_fcc.o \ 1074 _Q_mul.o \ 1075 _Q_qtod.o \ 1076 _Q_qtoi.o \ 1077 _Q_qtos.o \ 1078 _Q_qtou.o \ 1079 _Q_sqrt.o \ 1080 _Q_stoq.o \ 1081 _Q_sub.o \ 1082 _Qp_qtox.o \ 1083 _Qp_qtoux.o 1084 1085$(QIL:%=pics/%) := CFLAGS64 += ../$(MACH)/fp/__quad.il 1086pics/_Qp%.o := CFLAGS64 += -I../$(MACH)/fp 1087pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra 1088 1089# Files in crt subdirectory which need muldiv64.il inline template 1090#CIL= mul64.o divrem64.o 1091#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il 1092 1093# large-file-aware components that should be built large 1094 1095#$(COMSYSOBJS64:%=pics/%) := \ 1096# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1097 1098#$(SYSOBJS64:%=pics/%) := \ 1099# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1100 1101#$(PORTGEN64:%=pics/%) := \ 1102# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1103 1104#$(PORTSTDIO64:%=pics/%) := \ 1105# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1106 1107#$(PORTSYS64:%=pics/%) := \ 1108# CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1109 1110$(PORTSTDIO_W:%=pics/%) := \ 1111 CPPFLAGS += -D_WIDE 1112 1113$(PORTPRINT_W:%=pics/%) := \ 1114 CPPFLAGS += -D_WIDE 1115 1116$(PORTI18N_COND:%=pics/%) := \ 1117 CPPFLAGS += -D_WCS_LONGLONG 1118 1119# Files which need extra optimization 1120pics/getenv.o := sparcv9_COPTFLAG = -xO4 1121 1122.KEEP_STATE: 1123 1124all: $(LIBS) $(LIB_PIC) 1125 1126lint := CPPFLAGS += -I../$(MACH)/fp 1127lint := CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99 1128lint := LINTFLAGS64 += -mn 1129 1130lint: 1131 @echo $(LINT.c) ... $(LDLIBS) 1132 @$(LINT.c) $(SRCS) $(LDLIBS) 1133 1134$(LINTLIB):= SRCS=../port/llib-lc 1135$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H 1136$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=v9 1137 1138# object files that depend on inline template 1139$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il 1140$(IL:%=pics/%): $(LIBCBASE)/fp/base.il 1141$(QIL:%=pics/%): ../$(MACH)/fp/__quad.il 1142#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il 1143 1144# include common libc targets 1145include ../Makefile.targ 1146 1147# We need to strip out all CTF and DOF data from the static library 1148$(LIB_PIC) := DIR = pics 1149$(LIB_PIC): pics $$(PICS) 1150 $(BUILD.AR) 1151 $(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1 1152 $(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1 1153 $(AR) -ts $@ > /dev/null 1154 $(POST_PROCESS_A) 1155 1156# special cases 1157#$(STRETS:%=pics/%): crt/stret.s 1158# $(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@ 1159# $(POST_PROCESS_O) 1160 1161#crt/_rtbootld.s: crt/_rtboot.s crt/_rtld.c 1162# $(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s 1163# $(CAT) crt/_rtboot.s crt/_rtld.s > $@ 1164# $(RM) crt/_rtld.s 1165 1166ASSYMDEP_OBJS= \ 1167 _lwp_mutex_unlock.o \ 1168 _stack_grow.o \ 1169 asm_subr.o \ 1170 tls_get_addr.o \ 1171 unwind_frame.o \ 1172 vforkx.o 1173 1174$(ASSYMDEP_OBJS:%=pics/%) := CPPFLAGS += -I. 1175 1176$(ASSYMDEP_OBJS:%=pics/%): assym.h 1177 1178# assym.h build rules 1179 1180GENASSYM_C = ../$(MACH)/genassym.c 1181 1182# XXX A hack. Perhaps this should be 'CPPFLAGS.native' and 1183# live in Makefile.master 1184 1185CPPFLAGS.genassym = \ 1186 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) 1187 1188genassym: $(GENASSYM_C) 1189 $(NATIVECC) -I$(LIBCBASE)/inc -I../inc \ 1190 $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C) 1191 1192OFFSETS = ../$(MACH)/offsets.in 1193 1194assym.h: $(OFFSETS) genassym 1195 $(OFFSETS_CREATE) <$(OFFSETS) >$@ 1196 ./genassym >>$@ 1197 1198# derived C source and related explicit dependencies 1199../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk 1200 cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist 1201 1202pics/new_list.o: ../port/gen/new_list.c 1203