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 mkdev.o \ 508 mkdtemp.o \ 509 mkfifo.o \ 510 mkstemp.o \ 511 mktemp.o \ 512 mlock.o \ 513 mlockall.o \ 514 mon.o \ 515 msync.o \ 516 munlock.o \ 517 munlockall.o \ 518 ndbm.o \ 519 nftw.o \ 520 nlspath_checks.o \ 521 nsparse.o \ 522 nss_common.o \ 523 nss_dbdefs.o \ 524 nss_deffinder.o \ 525 opendir.o \ 526 opt_data.o \ 527 perror.o \ 528 pfmt.o \ 529 pfmt_data.o \ 530 pfmt_print.o \ 531 pipe.o \ 532 plock.o \ 533 poll.o \ 534 posix_fadvise.o \ 535 posix_fallocate.o \ 536 posix_madvise.o \ 537 posix_memalign.o \ 538 priocntl.o \ 539 priv_str_xlate.o \ 540 privlib.o \ 541 psecflags.o \ 542 psiginfo.o \ 543 psignal.o \ 544 pt.o \ 545 putpwent.o \ 546 putspent.o \ 547 raise.o \ 548 rand.o \ 549 random.o \ 550 rctlops.o \ 551 readdir.o \ 552 readdir_r.o \ 553 reallocarray.o \ 554 recallocarray.o \ 555 realpath.o \ 556 reboot.o \ 557 regexpr.o \ 558 remove.o \ 559 rewinddir.o \ 560 rindex.o \ 561 scandir.o \ 562 seekdir.o \ 563 select.o \ 564 setlabel.o \ 565 setpriority.o \ 566 settimeofday.o \ 567 sh_locks.o \ 568 sigflag.o \ 569 siglist.o \ 570 sigsend.o \ 571 sigsetops.o \ 572 ssignal.o \ 573 stack.o \ 574 stpcpy.o \ 575 stpncpy.o \ 576 str2sig.o \ 577 strcase_charmap.o \ 578 strchrnul.o \ 579 strcspn.o \ 580 strdup.o \ 581 strerror.o \ 582 strlcat.o \ 583 strlcpy.o \ 584 strndup.o \ 585 strpbrk.o \ 586 strsep.o \ 587 strsignal.o \ 588 strspn.o \ 589 strstr.o \ 590 strtod.o \ 591 strtoimax.o \ 592 strtok.o \ 593 strtok_r.o \ 594 strtonum.o \ 595 strtoumax.o \ 596 swab.o \ 597 swapctl.o \ 598 sysconf.o \ 599 syslog.o \ 600 tcdrain.o \ 601 tcflow.o \ 602 tcflush.o \ 603 tcgetattr.o \ 604 tcgetpgrp.o \ 605 tcgetsid.o \ 606 tcsendbreak.o \ 607 tcsetattr.o \ 608 tcsetpgrp.o \ 609 tell.o \ 610 telldir.o \ 611 tfind.o \ 612 time_data.o \ 613 time_gdata.o \ 614 timespec_get.o \ 615 tls_data.o \ 616 truncate.o \ 617 tsdalloc.o \ 618 tsearch.o \ 619 ttyname.o \ 620 ttyslot.o \ 621 ualarm.o \ 622 ucred.o \ 623 valloc.o \ 624 vlfmt.o \ 625 vpfmt.o \ 626 waitpid.o \ 627 walkstack.o \ 628 wdata.o \ 629 xgetwidth.o \ 630 xpg4.o \ 631 xpg6.o 632 633 PORTINET= \ 634 inet_lnaof.o \ 635 inet_makeaddr.o \ 636 inet_network.o \ 637 inet_ntoa.o \ 638 inet_ntop.o \ 639 inet_pton.o 640 641 PORTPRINT_W= \ 642 doprnt_w.o 643 644 PORTPRINT= \ 645 asprintf.o \ 646 doprnt.o \ 647 fprintf.o \ 648 printf.o \ 649 snprintf.o \ 650 sprintf.o \ 651 vfprintf.o \ 652 vprintf.o \ 653 vsnprintf.o \ 654 vsprintf.o \ 655 vwprintf.o \ 656 wprintf.o 657 658 # c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only) 659 PORTPRINT_C89= \ 660 vfprintf_c89.o \ 661 vprintf_c89.o \ 662 vsnprintf_c89.o \ 663 vsprintf_c89.o \ 664 vwprintf_c89.o 665 666 PORTSTDIO_C89= \ 667 vscanf_c89.o \ 668 vwscanf_c89.o \ 669 670 # portable stdio objects that contain large file interfaces. 671 # Note: fopen64 is a special case, as we build it small. 672 PORTSTDIO64= \ 673 fopen64.o \ 674 fpos64.o 675 676 PORTSTDIO_W= \ 677 doscan_w.o 678 679 PORTSTDIO= \ 680 __extensions.o \ 681 _endopen.o \ 682 _filbuf.o \ 683 _findbuf.o \ 684 _flsbuf.o \ 685 _wrtchk.o \ 686 clearerr.o \ 687 ctermid.o \ 688 ctermid_r.o \ 689 cuserid.o \ 690 data.o \ 691 doscan.o \ 692 fdopen.o \ 693 feof.o \ 694 ferror.o \ 695 fgetc.o \ 696 fgets.o \ 697 fileno.o \ 698 flockf.o \ 699 flush.o \ 700 fopen.o \ 701 fpos.o \ 702 fputc.o \ 703 fputs.o \ 704 fread.o \ 705 fseek.o \ 706 fseeko.o \ 707 ftell.o \ 708 ftello.o \ 709 fwrite.o \ 710 getc.o \ 711 getchar.o \ 712 getline.o \ 713 getpass.o \ 714 gets.o \ 715 getw.o \ 716 mse.o \ 717 popen.o \ 718 putc.o \ 719 putchar.o \ 720 puts.o \ 721 putw.o \ 722 rewind.o \ 723 scanf.o \ 724 setbuf.o \ 725 setbuffer.o \ 726 setvbuf.o \ 727 system.o \ 728 tempnam.o \ 729 tmpfile.o \ 730 tmpnam_r.o \ 731 ungetc.o \ 732 vscanf.o \ 733 vwscanf.o \ 734 wscanf.o 735 736 PORTI18N= \ 737 getwchar.o \ 738 putwchar.o \ 739 putws.o \ 740 strtows.o \ 741 wcsnlen.o \ 742 wcsstr.o \ 743 wcstoimax.o \ 744 wcstol.o \ 745 wcstoul.o \ 746 wcswcs.o \ 747 wmemchr.o \ 748 wmemcmp.o \ 749 wmemcpy.o \ 750 wmemmove.o \ 751 wmemset.o \ 752 wscat.o \ 753 wschr.o \ 754 wscmp.o \ 755 wscpy.o \ 756 wscspn.o \ 757 wsdup.o \ 758 wslen.o \ 759 wsncat.o \ 760 wsncmp.o \ 761 wsncpy.o \ 762 wspbrk.o \ 763 wsprintf.o \ 764 wsrchr.o \ 765 wsscanf.o \ 766 wsspn.o \ 767 wstod.o \ 768 wstok.o \ 769 wstol.o \ 770 wstoll.o \ 771 wsxfrm.o \ 772 gettext.o \ 773 gettext_gnu.o \ 774 gettext_real.o \ 775 gettext_util.o \ 776 plural_parser.o \ 777 wdresolve.o \ 778 _ctype.o \ 779 isascii.o \ 780 toascii.o 781 782 PORTI18N_COND= \ 783 wcstol_longlong.o \ 784 wcstoul_longlong.o 785 786 PORTLOCALE= \ 787 big5.o \ 788 btowc.o \ 789 collate.o \ 790 collcmp.o \ 791 euc.o \ 792 fnmatch.o \ 793 fgetwc.o \ 794 fgetws.o \ 795 fix_grouping.o \ 796 fputwc.o \ 797 fputws.o \ 798 fwide.o \ 799 gb18030.o \ 800 gb2312.o \ 801 gbk.o \ 802 getdate.o \ 803 isdigit.o \ 804 iswctype.o \ 805 ldpart.o \ 806 lmessages.o \ 807 lnumeric.o \ 808 lmonetary.o \ 809 localeconv.o \ 810 localeimpl.o \ 811 mbftowc.o \ 812 mblen.o \ 813 mbrlen.o \ 814 mbrtowc.o \ 815 mbsinit.o \ 816 mbsnrtowcs.o \ 817 mbsrtowcs.o \ 818 mbstowcs.o \ 819 mbtowc.o \ 820 mskanji.o \ 821 nextwctype.o \ 822 nl_langinfo.o \ 823 none.o \ 824 rune.o \ 825 runetype.o \ 826 setlocale.o \ 827 setrunelocale.o \ 828 strcasecmp.o \ 829 strcasestr.o \ 830 strcoll.o \ 831 strfmon.o \ 832 strftime.o \ 833 strncasecmp.o \ 834 strptime.o \ 835 strxfrm.o \ 836 table.o \ 837 timelocal.o \ 838 tolower.o \ 839 towlower.o \ 840 ungetwc.o \ 841 utf8.o \ 842 wcrtomb.o \ 843 wcscasecmp.o \ 844 wcscoll.o \ 845 wcsftime.o \ 846 wcsnrtombs.o \ 847 wcsrtombs.o \ 848 wcswidth.o \ 849 wcstombs.o \ 850 wcsxfrm.o \ 851 wctob.o \ 852 wctomb.o \ 853 wctrans.o \ 854 wctype.o \ 855 wcwidth.o \ 856 wscol.o 857 858 AIOOBJS= \ 859 aio.o \ 860 aio_alloc.o \ 861 posix_aio.o 862 863 RTOBJS= \ 864 clock_timer.o \ 865 mqueue.o \ 866 pos4obj.o \ 867 sched.o \ 868 sem.o \ 869 shm.o \ 870 sigev_thread.o 871 872 TPOOLOBJS= \ 873 thread_pool.o 874 875 THREADSOBJS= \ 876 alloc.o \ 877 assfail.o \ 878 cancel.o \ 879 c11_thr.o \ 880 door_calls.o \ 881 tmem.o \ 882 pthr_attr.o \ 883 pthr_barrier.o \ 884 pthr_cond.o \ 885 pthr_mutex.o \ 886 pthr_rwlock.o \ 887 pthread.o \ 888 rwlock.o \ 889 scalls.o \ 890 sema.o \ 891 sigaction.o \ 892 spawn.o \ 893 synch.o \ 894 tdb_agent.o \ 895 thr.o \ 896 thread_interface.o \ 897 tls.o \ 898 tsd.o 899 900 THREADSMACHOBJS= \ 901 machdep.o 902 903 THREADSASMOBJS= \ 904 asm_subr.o 905 906 UNICODEOBJS= \ 907 u8_textprep.o \ 908 uconv.o 909 910 UNWINDMACHOBJS= \ 911 unwind.o 912 913 UNWINDASMOBJS= \ 914 unwind_frame.o 915 916 # objects that implement the transitional large file API 917 PORTSYS64= \ 918 lockf64.o \ 919 stat64.o 920 921 PORTSYS= \ 922 _autofssys.o \ 923 access.o \ 924 acctctl.o \ 925 bsd_signal.o \ 926 chmod.o \ 927 chown.o \ 928 corectl.o \ 929 epoll.o \ 930 eventfd.o \ 931 exacctsys.o \ 932 execl.o \ 933 execle.o \ 934 execv.o \ 935 fcntl.o \ 936 getpagesizes.o \ 937 getpeerucred.o \ 938 inst_sync.o \ 939 issetugid.o \ 940 label.o \ 941 link.o \ 942 lockf.o \ 943 lwp.o \ 944 lwp_cond.o \ 945 lwp_rwlock.o \ 946 lwp_sigmask.o \ 947 meminfosys.o \ 948 mkdir.o \ 949 mknod.o \ 950 msgsys.o \ 951 nfssys.o \ 952 open.o \ 953 pgrpsys.o \ 954 posix_sigwait.o \ 955 ppriv.o \ 956 psetsys.o \ 957 rctlsys.o \ 958 readlink.o \ 959 rename.o \ 960 sbrk.o \ 961 semsys.o \ 962 set_errno.o \ 963 sharefs.o \ 964 shmsys.o \ 965 sidsys.o \ 966 siginterrupt.o \ 967 signal.o \ 968 signalfd.o \ 969 sigpending.o \ 970 sigstack.o \ 971 stat.o \ 972 symlink.o \ 973 tasksys.o \ 974 time.o \ 975 time_util.o \ 976 timerfd.o \ 977 ucontext.o \ 978 unlink.o \ 979 ustat.o \ 980 utimesys.o \ 981 zone.o 982 983 PORTREGEX= \ 984 glob.o \ 985 regcmp.o \ 986 regcomp.o \ 987 regerror.o \ 988 regex.o \ 989 regexec.o \ 990 regfree.o \ 991 wordexp.o 992 993 PORTREGEX64= \ 994 glob64.o 995 996 MOSTOBJS= \ 997 $(STRETS) \ 998 $(CRTOBJS) \ 999 $(DYNOBJS) \ 1000 $(FPOBJS) \ 1001 $(FPASMOBJS) \ 1002 $(ATOMICOBJS) \ 1003 $(CHACHAOBJS) \ 1004 $(XATTROBJS) \ 1005 $(COMOBJS) \ 1006 $(DTRACEOBJS) \ 1007 $(GENOBJS) \ 1008 $(PORTFP) \ 1009 $(PORTGEN) \ 1010 $(PORTGEN64) \ 1011 $(PORTI18N) \ 1012 $(PORTI18N_COND) \ 1013 $(PORTINET) \ 1014 $(PORTLOCALE) \ 1015 $(PORTPRINT) \ 1016 $(PORTPRINT_C89) \ 1017 $(PORTPRINT_W) \ 1018 $(PORTREGEX) \ 1019 $(PORTREGEX64) \ 1020 $(PORTSTDIO) \ 1021 $(PORTSTDIO64) \ 1022 $(PORTSTDIO_C89) \ 1023 $(PORTSTDIO_W) \ 1024 $(PORTSYS) \ 1025 $(PORTSYS64) \ 1026 $(AIOOBJS) \ 1027 $(RTOBJS) \ 1028 $(SECFLAGSOBJS) \ 1029 $(TPOOLOBJS) \ 1030 $(THREADSOBJS) \ 1031 $(THREADSMACHOBJS) \ 1032 $(THREADSASMOBJS) \ 1033 $(UNICODEOBJS) \ 1034 $(UNWINDMACHOBJS) \ 1035 $(UNWINDASMOBJS) \ 1036 $(COMSYSOBJS) \ 1037 $(SYSOBJS) \ 1038 $(COMSYSOBJS64) \ 1039 $(SYSOBJS64) \ 1040 $(VALUES) 1041 1042 TRACEOBJS= \ 1043 plockstat.o 1044 1045 # NOTE: libc.so.1 must be linked with the minimal crti.o and crtn.o 1046 # modules whose source is provided in the $(SRC)/lib/crt directory. 1047 # This must be done because otherwise the Sun C compiler would insert 1048 # its own versions of these modules and those versions contain code 1049 # to call out to C++ initialization functions. Such C++ initialization 1050 # functions can call back into libc before thread initialization is 1051 # complete and this leads to segmentation violations and other problems. 1052 # Since libc contains no C++ code, linking with the minimal crti.o and 1053 # crtn.o modules is safe and avoids the problems described above. 1054 OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN) 1055 CRTSRCS= ../../crt/i386 1056 1057 LDPASS_OFF= $(POUND_SIGN) 1058 1059 # include common library definitions 1060 include ../../Makefile.lib 1061 1062 # we need to override the default SONAME here because we might 1063 # be building a variant object (still libc.so.1, but different filename) 1064 SONAME = libc.so.1 1065 1066 CFLAGS += $(CCVERBOSE) $(CTF_FLAGS) 1067 1068 # This is necessary to avoid problems with calling _ex_unwind(). 1069 # We probably don't want any inlining anyway. 1070 XINLINE = -xinline= 1071 CFLAGS += $(XINLINE) 1072 1073 CERRWARN += -_gcc=-Wno-parentheses 1074 CERRWARN += -_gcc=-Wno-switch 1075 CERRWARN += -_gcc=-Wno-uninitialized 1076 CERRWARN += -_gcc=-Wno-unused-value 1077 CERRWARN += -_gcc=-Wno-unused-label 1078 CERRWARN += -_gcc=-Wno-unused-variable 1079 CERRWARN += -_gcc=-Wno-type-limits 1080 CERRWARN += -_gcc=-Wno-char-subscripts 1081 CERRWARN += -_gcc=-Wno-clobbered 1082 CERRWARN += -_gcc=-Wno-unused-function 1083 CERRWARN += -_gcc=-Wno-address 1084 1085 # Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...) 1086 # enables ASSERT() checking in the threads portion of the library. 1087 # This is automatically enabled for DEBUG builds, not for non-debug builds. 1088 THREAD_DEBUG = 1089 $(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG 1090 1091 # Make string literals read-only to save memory. 1092 CFLAGS += $(XSTRCONST) 1093 1094 ALTPICS= $(TRACEOBJS:%=pics/%) 1095 1096 $(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) \ 1097 $(EXTPICS) $(LDLIBS) 1098 1099 MAPFILES = $(LIBCDIR)/port/mapfile-vers 1100 1101 # 1102 # EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile 1103 # 1104 CFLAGS += $(EXTN_CFLAGS) 1105 CPPFLAGS= -D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \ 1106 -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master) 1107 ASFLAGS= $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH) 1108 1109 # As a favor to the dtrace syscall provider, libc still calls the 1110 # old syscall traps that have been obsoleted by the *at() interfaces. 1111 # Delete this to compile libc using only the new *at() system call traps 1112 CPPFLAGS += -D_RETAIN_OLD_SYSCALLS 1113 1114 # Inform the run-time linker about libc specialized initialization 1115 RTLDINFO = -z rtldinfo=tls_rtldinfo 1116 DYNFLAGS += $(RTLDINFO) 1117 1118 # Force libc's internal references to be resolved immediately upon loading 1119 # in order to avoid critical region problems. Since almost all libc symbols 1120 # are marked 'protected' in the mapfiles, this is a minimal set (15 to 20). 1121 DYNFLAGS += -znow 1122 1123 DYNFLAGS += -e __rtboot 1124 DYNFLAGS += $(EXTN_DYNFLAGS) 1125 1126 # Inform the kernel about the initial DTrace area (in case 1127 # libc is being used as the interpreter / runtime linker). 1128 DTRACE_DATA = -zdtrace=dtrace_data 1129 DYNFLAGS += $(DTRACE_DATA) 1130 1131 # DTrace needs an executable data segment. 1132 MAPFILE.NED= 1133 1134 BUILD.s= $(AS) $(ASFLAGS) $< -o $@ 1135 1136 # Override this top level flag so the compiler builds in its native 1137 # C99 mode. This has been enabled to support the complex arithmetic 1138 # added to libc. 1139 CSTD= $(CSTD_GNU99) 1140 1141 # libc method of building an archive 1142 # The "$(GREP) -v ' L '" part is necessary only until 1143 # lorder is fixed to ignore thread-local variables. 1144 BUILD.AR= $(RM) $@ ; \ 1145 $(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)` 1146 1147 # extra files for the clean target 1148 CLEANFILES += \ 1149 $(LIBCDIR)/port/gen/errlst.c \ 1150 $(LIBCDIR)/port/gen/new_list.c \ 1151 assym.h \ 1152 genassym \ 1153 crt/_rtld.s \ 1154 crt/_rtbootld.s \ 1155 pics/_rtbootld.o \ 1156 pics/crti.o \ 1157 pics/crtn.o \ 1158 $(ALTPICS) 1159 1160 CLOBBERFILES += $(LIB_PIC) 1161 1162 # list of C source for lint 1163 SRCS= \ 1164 $(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c) \ 1165 $(XATTROBJS:%.o=$(SRC)/common/xattr/%.c) \ 1166 $(COMOBJS:%.o=$(SRC)/common/util/%.c) \ 1167 $(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c) \ 1168 $(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c) \ 1169 $(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c) \ 1170 $(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c) \ 1171 $(PORTINET:%.o=$(LIBCDIR)/port/inet/%.c) \ 1172 $(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c) \ 1173 $(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c) \ 1174 $(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c) \ 1175 $(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c) \ 1176 $(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c) \ 1177 $(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c) \ 1178 $(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c) \ 1179 $(SECFLAGSOBJS:%.o=$(SRC)/common/secflags/%.c) \ 1180 $(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c) \ 1181 $(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c) \ 1182 $(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c) \ 1183 $(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c) \ 1184 $(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c) \ 1185 $(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c) \ 1186 $(LIBCBASE)/gen/ecvt.c \ 1187 $(LIBCBASE)/gen/makectxt.c \ 1188 $(LIBCBASE)/gen/siginfolst.c \ 1189 $(LIBCBASE)/gen/siglongjmp.c \ 1190 $(LIBCBASE)/gen/strcmp.c \ 1191 $(LIBCBASE)/gen/sync_instruction_memory.c \ 1192 $(LIBCBASE)/sys/ptrace.c \ 1193 $(LIBCBASE)/sys/uadmin.c 1194 1195 # conditional assignments 1196 $(DYNLIB) := CRTI = crti.o 1197 $(DYNLIB) := CRTN = crtn.o 1198 1199 # Files which need the threads .il inline template 1200 TIL= \ 1201 aio.o \ 1202 alloc.o \ 1203 assfail.o \ 1204 atexit.o \ 1205 atfork.o \ 1206 cancel.o \ 1207 door_calls.o \ 1208 err.o \ 1209 errno.o \ 1210 lwp.o \ 1211 ma.o \ 1212 machdep.o \ 1213 posix_aio.o \ 1214 pthr_attr.o \ 1215 pthr_barrier.o \ 1216 pthr_cond.o \ 1217 pthr_mutex.o \ 1218 pthr_rwlock.o \ 1219 pthread.o \ 1220 rand.o \ 1221 rwlock.o \ 1222 scalls.o \ 1223 sched.o \ 1224 sema.o \ 1225 sigaction.o \ 1226 sigev_thread.o \ 1227 spawn.o \ 1228 stack.o \ 1229 synch.o \ 1230 tdb_agent.o \ 1231 thr.o \ 1232 thread_interface.o \ 1233 thread_pool.o \ 1234 tls.o \ 1235 tsd.o \ 1236 tmem.o \ 1237 unwind.o 1238 1239 THREADS_INLINES = $(LIBCBASE)/threads/i386.il 1240 $(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES) 1241 1242 # pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il 1243 1244 # large-file-aware components that should be built large 1245 1246 $(COMSYSOBJS64:%=pics/%) := \ 1247 CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1248 1249 $(SYSOBJS64:%=pics/%) := \ 1250 CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1251 1252 $(PORTGEN64:%=pics/%) := \ 1253 CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1254 1255 $(PORTREGEX64:%=pics/%) := \ 1256 CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1257 1258 $(PORTSTDIO64:%=pics/%) := \ 1259 CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1260 1261 $(PORTSYS64:%=pics/%) := \ 1262 CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 1263 1264 $(PORTSTDIO_W:%=pics/%) := \ 1265 CPPFLAGS += -D_WIDE 1266 1267 $(PORTPRINT_W:%=pics/%) := \ 1268 CPPFLAGS += -D_WIDE 1269 1270 $(PORTPRINT_C89:%=pics/%) := \ 1271 CPPFLAGS += -D_C89_INTMAX32 1272 1273 $(PORTSTDIO_C89:%=pics/%) := \ 1274 CPPFLAGS += -D_C89_INTMAX32 1275 1276 $(PORTI18N_COND:%=pics/%) := \ 1277 CPPFLAGS += -D_WCS_LONGLONG 1278 1279 pics/arc4random.o := CPPFLAGS += -I$(SRC)/common/crypto/chacha 1280 1281 pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS) 1282 1283 .KEEP_STATE: 1284 1285 all: $(LIBS) $(LIB_PIC) 1286 1287 lint := CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp 1288 lint := CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99 1289 lint := LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 1290 1291 lint: 1292 @echo $(LINT.c) ... 1293 @$(LINT.c) $(SRCS) $(LDLIBS) 1294 1295 $(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc 1296 $(LINTLIB):= CPPFLAGS += -D_MSE_INT_H 1297 $(LINTLIB):= LINTFLAGS=-nvx 1298 1299 # object files that depend on inline template 1300 $(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il 1301 # pics/mul64.o: $(LIBCBASE)/crt/mul64.il 1302 1303 # include common libc targets 1304 include $(LIBCDIR)/Makefile.targ 1305 1306 # We need to strip out all CTF and DOF data from the static library 1307 $(LIB_PIC) := DIR = pics 1308 $(LIB_PIC): pics $$(PICS) 1309 $(BUILD.AR) 1310 $(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1 1311 $(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1 1312 $(AR) -ts $@ > /dev/null 1313 $(POST_PROCESS_A) 1314 1315 $(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c 1316 $(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \ 1317 $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s 1318 $(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@ 1319 $(RM) $(LIBCBASE)/crt/_rtld.s 1320 1321 # partially built from C source 1322 pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s 1323 $(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@ 1324 $(CTFCONVERT_O) 1325 1326 ASSYMDEP_OBJS= \ 1327 _lwp_mutex_unlock.o \ 1328 _stack_grow.o \ 1329 getcontext.o \ 1330 setjmp.o \ 1331 tls_get_addr.o \ 1332 vforkx.o 1333 1334 $(ASSYMDEP_OBJS:%=pics/%) := CPPFLAGS += -I. 1335 1336 $(ASSYMDEP_OBJS:%=pics/%): assym.h 1337 1338 # assym.h build rules 1339 1340 GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c 1341 1342 genassym: $(GENASSYM_C) 1343 $(NATIVECC) $(NATIVE_CFLAGS) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc \ 1344 -D__EXTENSIONS__ $(CPPFLAGS.native) -o $@ $(GENASSYM_C) 1345 1346 OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in 1347 1348 assym.h: $(OFFSETS) genassym 1349 $(OFFSETS_CREATE) <$(OFFSETS) >$@ 1350 ./genassym >>$@ 1351 1352 # derived C source and related explicit dependencies 1353 $(LIBCDIR)/port/gen/errlst.c + \ 1354 $(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk 1355 cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist 1356 1357 pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c 1358 1359 pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c