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