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