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