xref: /titanic_50/usr/src/lib/libc/i386/Makefile.com (revision 1c5bc425cc346c6844d58e1fdd8794e9553dd289)
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 2011 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	big5.o			\
751	btowc.o			\
752	collate.o		\
753	collcmp.o		\
754	euc.o			\
755	fnmatch.o		\
756	fgetwc.o		\
757	fgetws.o		\
758	fix_grouping.o		\
759	fputwc.o		\
760	fputws.o		\
761	fwide.o			\
762	gb18030.o		\
763	gb2312.o		\
764	gbk.o			\
765	getdate.o		\
766	iswctype.o		\
767	ldpart.o		\
768	lmessages.o		\
769	lnumeric.o		\
770	lmonetary.o		\
771	localeconv.o		\
772	mbftowc.o		\
773	mblen.o			\
774	mbrlen.o		\
775	mbrtowc.o		\
776	mbsinit.o		\
777	mbsnrtowcs.o		\
778	mbsrtowcs.o		\
779	mbstowcs.o		\
780	mbtowc.o		\
781	mskanji.o		\
782	nextwctype.o		\
783	nl_langinfo.o		\
784	none.o			\
785	regcomp.o		\
786	regfree.o		\
787	regerror.o		\
788	regexec.o		\
789	rune.o			\
790	runetype.o		\
791	setlocale.o		\
792	setrunelocale.o		\
793	strcoll.o		\
794	strfmon.o		\
795	strftime.o		\
796	strptime.o		\
797	strxfrm.o		\
798	table.o			\
799	timelocal.o		\
800	tolower.o		\
801	towlower.o		\
802	ungetwc.o		\
803	utf8.o			\
804	wcrtomb.o		\
805	wcscoll.o		\
806	wcsftime.o		\
807	wcsnrtombs.o		\
808	wcsrtombs.o		\
809	wcswidth.o		\
810	wcstombs.o		\
811	wcsxfrm.o		\
812	wctob.o			\
813	wctomb.o		\
814	wctrans.o		\
815	wctype.o		\
816	wcwidth.o		\
817	wscol.o
818
819AIOOBJS=			\
820	aio.o			\
821	aio_alloc.o		\
822	posix_aio.o
823
824RTOBJS=				\
825	clock_timer.o		\
826	mqueue.o		\
827	pos4obj.o		\
828	sched.o			\
829	sem.o			\
830	shm.o			\
831	sigev_thread.o
832
833TPOOLOBJS=			\
834	thread_pool.o
835
836THREADSOBJS=			\
837	alloc.o			\
838	assfail.o		\
839	cancel.o		\
840	door_calls.o		\
841	pthr_attr.o		\
842	pthr_barrier.o		\
843	pthr_cond.o		\
844	pthr_mutex.o		\
845	pthr_rwlock.o		\
846	pthread.o		\
847	rwlock.o		\
848	scalls.o		\
849	sema.o			\
850	sigaction.o		\
851	spawn.o			\
852	synch.o			\
853	tdb_agent.o		\
854	thr.o			\
855	thread_interface.o	\
856	tls.o			\
857	tsd.o
858
859THREADSMACHOBJS=		\
860	machdep.o
861
862THREADSASMOBJS=			\
863	asm_subr.o
864
865UNICODEOBJS=			\
866	u8_textprep.o		\
867	uconv.o
868
869UNWINDMACHOBJS=			\
870	unwind.o
871
872UNWINDASMOBJS=			\
873	unwind_frame.o
874
875# objects that implement the transitional large file API
876PORTSYS64=			\
877	lockf64.o		\
878	stat64.o
879
880PORTSYS=			\
881	_autofssys.o		\
882	access.o		\
883	acctctl.o		\
884	bsd_signal.o		\
885	chmod.o			\
886	chown.o			\
887	corectl.o		\
888	exacctsys.o		\
889	execl.o			\
890	execle.o		\
891	execv.o			\
892	fcntl.o			\
893	getpagesizes.o		\
894	getpeerucred.o		\
895	inst_sync.o		\
896	issetugid.o		\
897	label.o			\
898	link.o			\
899	lockf.o			\
900	lwp.o			\
901	lwp_cond.o		\
902	lwp_rwlock.o		\
903	lwp_sigmask.o		\
904	meminfosys.o		\
905	mkdir.o			\
906	mknod.o			\
907	msgsys.o		\
908	nfssys.o		\
909	open.o			\
910	pgrpsys.o		\
911	posix_sigwait.o		\
912	ppriv.o			\
913	psetsys.o		\
914	rctlsys.o		\
915	readlink.o		\
916	rename.o		\
917	sbrk.o			\
918	semsys.o		\
919	set_errno.o		\
920	sharefs.o		\
921	shmsys.o		\
922	sidsys.o		\
923	siginterrupt.o		\
924	signal.o		\
925	sigpending.o		\
926	sigstack.o		\
927	stat.o			\
928	symlink.o		\
929	tasksys.o		\
930	time.o			\
931	time_util.o		\
932	ucontext.o		\
933	unlink.o		\
934	ustat.o			\
935	utimesys.o		\
936	zone.o
937
938PORTREGEX=			\
939	glob.o			\
940	regcmp.o		\
941	regex.o			\
942	wordexp.o
943
944MOSTOBJS=			\
945	$(STRETS)		\
946	$(CRTOBJS)		\
947	$(DYNOBJS)		\
948	$(FPOBJS)		\
949	$(FPASMOBJS)		\
950	$(ATOMICOBJS)		\
951	$(XATTROBJS)		\
952	$(COMOBJS)		\
953	$(DTRACEOBJS)		\
954	$(GENOBJS)		\
955	$(PORTFP)		\
956	$(PORTGEN)		\
957	$(PORTGEN64)		\
958	$(PORTI18N)		\
959	$(PORTI18N_COND)	\
960	$(PORTLOCALE)		\
961	$(PORTPRINT)		\
962	$(PORTPRINT_C89)	\
963	$(PORTPRINT_W)		\
964	$(PORTREGEX)		\
965	$(PORTSTDIO)		\
966	$(PORTSTDIO64)		\
967	$(PORTSTDIO_C89)	\
968	$(PORTSTDIO_W)		\
969	$(PORTSYS)		\
970	$(PORTSYS64)		\
971	$(AIOOBJS)		\
972	$(RTOBJS)		\
973	$(TPOOLOBJS)		\
974	$(THREADSOBJS)		\
975	$(THREADSMACHOBJS)	\
976	$(THREADSASMOBJS)	\
977	$(UNICODEOBJS)		\
978	$(UNWINDMACHOBJS)	\
979	$(UNWINDASMOBJS)	\
980	$(COMSYSOBJS)		\
981	$(SYSOBJS)		\
982	$(COMSYSOBJS64)		\
983	$(SYSOBJS64)		\
984	$(VALUES)
985
986TRACEOBJS=			\
987	plockstat.o
988
989# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
990# modules whose source is provided in the $(SRC)/lib/common directory.
991# This must be done because otherwise the Sun C compiler would insert
992# its own versions of these modules and those versions contain code
993# to call out to C++ initialization functions.  Such C++ initialization
994# functions can call back into libc before thread initialization is
995# complete and this leads to segmentation violations and other problems.
996# Since libc contains no C++ code, linking with the minimal crti.o and
997# crtn.o modules is safe and avoids the problems described above.
998OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
999CRTSRCS= ../../common/i386
1000
1001LDPASS_OFF=	$(POUND_SIGN)
1002
1003# include common library definitions
1004include ../../Makefile.lib
1005
1006# we need to override the default SONAME here because we might
1007# be building a variant object (still libc.so.1, but different filename)
1008SONAME = libc.so.1
1009
1010CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
1011
1012# This is necessary to avoid problems with calling _ex_unwind().
1013# We probably don't want any inlining anyway.
1014XINLINE = -xinline=
1015CFLAGS += $(XINLINE)
1016
1017CERRWARN += -_gcc=-Wno-parentheses
1018CERRWARN += -_gcc=-Wno-switch
1019CERRWARN += -_gcc=-Wno-uninitialized
1020CERRWARN += -_gcc=-Wno-unused-value
1021CERRWARN += -_gcc=-Wno-unused-label
1022CERRWARN += -_gcc=-Wno-unused-variable
1023CERRWARN += -_gcc=-Wno-type-limits
1024CERRWARN += -_gcc=-Wno-char-subscripts
1025CERRWARN += -_gcc=-Wno-clobbered
1026CERRWARN += -_gcc=-Wno-unused-function
1027CERRWARN += -_gcc=-Wno-address
1028
1029# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1030# enables ASSERT() checking in the threads portion of the library.
1031# This is automatically enabled for DEBUG builds, not for non-debug builds.
1032THREAD_DEBUG =
1033$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1034
1035# Make string literals read-only to save memory.
1036CFLAGS += $(XSTRCONST)
1037
1038ALTPICS= $(TRACEOBJS:%=pics/%)
1039
1040$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) \
1041		$(EXTPICS) $(LDLIBS)
1042
1043MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1044
1045#
1046# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
1047#
1048CFLAGS +=	$(EXTN_CFLAGS)
1049CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
1050		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1051ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
1052
1053# As a favor to the dtrace syscall provider, libc still calls the
1054# old syscall traps that have been obsoleted by the *at() interfaces.
1055# Delete this to compile libc using only the new *at() system call traps
1056CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1057
1058# Inform the run-time linker about libc specialized initialization
1059RTLDINFO =	-z rtldinfo=tls_rtldinfo
1060DYNFLAGS +=	$(RTLDINFO)
1061
1062# Force libc's internal references to be resolved immediately upon loading
1063# in order to avoid critical region problems.  Since almost all libc symbols
1064# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1065DYNFLAGS +=	-znow
1066
1067DYNFLAGS +=	-e __rtboot
1068DYNFLAGS +=	$(EXTN_DYNFLAGS)
1069
1070# Inform the kernel about the initial DTrace area (in case
1071# libc is being used as the interpreter / runtime linker).
1072DTRACE_DATA =	-zdtrace=dtrace_data
1073DYNFLAGS +=	$(DTRACE_DATA)
1074
1075# DTrace needs an executable data segment.
1076MAPFILE.NED=
1077
1078BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1079
1080# Override this top level flag so the compiler builds in its native
1081# C99 mode.  This has been enabled to support the complex arithmetic
1082# added to libc.
1083C99MODE=	$(C99_ENABLE)
1084
1085# libc method of building an archive
1086# The "$(GREP) -v ' L '" part is necessary only until
1087# lorder is fixed to ignore thread-local variables.
1088BUILD.AR= $(RM) $@ ; \
1089	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1090
1091# extra files for the clean target
1092CLEANFILES=			\
1093	$(LIBCDIR)/port/gen/errlst.c	\
1094	$(LIBCDIR)/port/gen/new_list.c	\
1095	assym.h			\
1096	genassym		\
1097	crt/_rtld.s		\
1098	crt/_rtbootld.s		\
1099	pics/_rtbootld.o	\
1100	pics/crti.o		\
1101	pics/crtn.o		\
1102	$(ALTPICS)
1103
1104CLOBBERFILES +=	$(LIB_PIC)
1105
1106# list of C source for lint
1107SRCS=							\
1108	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1109	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1110	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1111	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1112	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
1113	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
1114	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
1115	$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)		\
1116	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
1117	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
1118	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
1119	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
1120	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
1121	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
1122	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
1123	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1124	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
1125	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1126	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
1127	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
1128	$(LIBCBASE)/gen/ecvt.c				\
1129	$(LIBCBASE)/gen/makectxt.c			\
1130	$(LIBCBASE)/gen/siginfolst.c			\
1131	$(LIBCBASE)/gen/siglongjmp.c			\
1132	$(LIBCBASE)/gen/strcmp.c			\
1133	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1134	$(LIBCBASE)/sys/ptrace.c			\
1135	$(LIBCBASE)/sys/uadmin.c
1136
1137# conditional assignments
1138$(DYNLIB) := CRTI = crti.o
1139$(DYNLIB) := CRTN = crtn.o
1140
1141# Files which need the threads .il inline template
1142TIL=				\
1143	aio.o			\
1144	alloc.o			\
1145	assfail.o		\
1146	atexit.o		\
1147	atfork.o		\
1148	cancel.o		\
1149	door_calls.o		\
1150	err.o			\
1151	errno.o			\
1152	lwp.o			\
1153	ma.o			\
1154	machdep.o		\
1155	posix_aio.o		\
1156	pthr_attr.o		\
1157	pthr_barrier.o		\
1158	pthr_cond.o		\
1159	pthr_mutex.o		\
1160	pthr_rwlock.o		\
1161	pthread.o		\
1162	rand.o			\
1163	rwlock.o		\
1164	scalls.o		\
1165	sched.o			\
1166	sema.o			\
1167	sigaction.o		\
1168	sigev_thread.o		\
1169	spawn.o			\
1170	stack.o			\
1171	synch.o			\
1172	tdb_agent.o		\
1173	thr.o			\
1174	thread_interface.o	\
1175	thread_pool.o		\
1176	tls.o			\
1177	tsd.o			\
1178	unwind.o
1179
1180THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1181$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1182
1183# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1184
1185# large-file-aware components that should be built large
1186
1187$(COMSYSOBJS64:%=pics/%) := \
1188	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1189
1190$(SYSOBJS64:%=pics/%) := \
1191	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1192
1193$(PORTGEN64:%=pics/%) := \
1194	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1195
1196$(PORTSTDIO64:%=pics/%) := \
1197	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1198
1199$(PORTSYS64:%=pics/%) := \
1200	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1201
1202$(PORTSTDIO_W:%=pics/%) := \
1203	CPPFLAGS += -D_WIDE
1204
1205$(PORTPRINT_W:%=pics/%) := \
1206	CPPFLAGS += -D_WIDE
1207
1208$(PORTPRINT_C89:%=pics/%) := \
1209	CPPFLAGS += -D_C89_INTMAX32
1210
1211$(PORTSTDIO_C89:%=pics/%) := \
1212	CPPFLAGS += -D_C89_INTMAX32
1213
1214$(PORTI18N_COND:%=pics/%) := \
1215	CPPFLAGS += -D_WCS_LONGLONG
1216
1217.KEEP_STATE:
1218
1219all: $(LIBS) $(LIB_PIC)
1220
1221lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1222lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1223lint	:=	LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1224
1225lint:
1226	@echo $(LINT.c) ...
1227	@$(LINT.c) $(SRCS) $(LDLIBS)
1228
1229$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1230$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1231$(LINTLIB):= LINTFLAGS=-nvx
1232
1233# object files that depend on inline template
1234$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1235# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1236
1237# include common libc targets
1238include $(LIBCDIR)/Makefile.targ
1239
1240# We need to strip out all CTF and DOF data from the static library
1241$(LIB_PIC) := DIR = pics
1242$(LIB_PIC): pics $$(PICS)
1243	$(BUILD.AR)
1244	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1245	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1246	$(AR) -ts $@ > /dev/null
1247	$(POST_PROCESS_A)
1248
1249$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1250	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
1251	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1252	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1253	$(RM) $(LIBCBASE)/crt/_rtld.s
1254
1255# partially built from C source
1256pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1257	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1258	$(CTFCONVERT_O)
1259
1260ASSYMDEP_OBJS=			\
1261	_lwp_mutex_unlock.o	\
1262	_stack_grow.o		\
1263	getcontext.o		\
1264	setjmp.o		\
1265	tls_get_addr.o		\
1266	vforkx.o
1267
1268$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1269
1270$(ASSYMDEP_OBJS:%=pics/%): assym.h
1271
1272# assym.h build rules
1273
1274GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1275
1276genassym: $(GENASSYM_C)
1277	$(NATIVECC) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc	\
1278		-D__EXTENSIONS__ $(CPPFLAGS.native) -o $@ $(GENASSYM_C)
1279
1280OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1281
1282assym.h: $(OFFSETS) genassym
1283	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1284	./genassym >>$@
1285
1286# derived C source and related explicit dependencies
1287$(LIBCDIR)/port/gen/errlst.c + \
1288$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1289	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1290
1291pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1292
1293pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1294