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