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