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