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