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