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