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