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