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