xref: /titanic_41/usr/src/lib/libc/i386/Makefile.com (revision b509e89b2befbaa42939abad9da1d7f5a8c6aaae)
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	utime.o			\
308	utimes.o		\
309	utssys.o		\
310	uucopy.o		\
311	vhangup.o		\
312	waitid.o		\
313	write.o			\
314	writev.o		\
315	yield.o
316
317SYSOBJS=			\
318	__clock_gettime.o	\
319	__getcontext.o		\
320	__uadmin.o		\
321	_lwp_mutex_unlock.o	\
322	_stack_grow.o		\
323	door.o			\
324	forkx.o			\
325	forkallx.o		\
326	fxstat.o		\
327	getcontext.o		\
328	gettimeofday.o		\
329	lwp_private.o		\
330	lxstat.o		\
331	nuname.o		\
332	pipe.o			\
333	ptrace.o		\
334	syscall.o		\
335	sysi86.o		\
336	tls_get_addr.o		\
337	uadmin.o		\
338	umount.o		\
339	uname.o			\
340	vforkx.o		\
341	xmknod.o		\
342	xstat.o
343
344# objects under ../port which contain transitional large file interfaces
345PORTGEN64=			\
346	_xftw64.o		\
347	attropen64.o		\
348	ftw64.o			\
349	mkstemp64.o		\
350	nftw64.o		\
351	tell64.o		\
352	truncate64.o
353
354# objects from source under ../port
355PORTFP=				\
356	__flt_decim.o		\
357	__flt_rounds.o		\
358	__tbl_10_b.o		\
359	__tbl_10_h.o		\
360	__tbl_10_s.o		\
361	__tbl_2_b.o		\
362	__tbl_2_h.o		\
363	__tbl_2_s.o		\
364	__tbl_fdq.o		\
365	__tbl_tens.o		\
366	__x_power.o		\
367	_base_sup.o		\
368	aconvert.o		\
369	decimal_bin.o		\
370	double_decim.o		\
371	econvert.o		\
372	fconvert.o		\
373	file_decim.o		\
374	finite.o		\
375	fp_data.o		\
376	func_decim.o		\
377	gconvert.o		\
378	hex_bin.o		\
379	ieee_globals.o		\
380	pack_float.o		\
381	sigfpe.o		\
382	string_decim.o
383
384PORTGEN=			\
385	_env_data.o		\
386	_xftw.o			\
387	a64l.o			\
388	abort.o			\
389	addsev.o		\
390	assert.o		\
391	atof.o			\
392	atoi.o			\
393	atol.o			\
394	atoll.o			\
395	attrat.o		\
396	attropen.o		\
397	atexit.o		\
398	atfork.o		\
399	basename.o		\
400	calloc.o		\
401	catgets.o		\
402	catopen.o		\
403	cfgetispeed.o		\
404	cfgetospeed.o		\
405	cfree.o			\
406	cfsetispeed.o		\
407	cfsetospeed.o		\
408	cftime.o		\
409	clock.o			\
410	closedir.o		\
411	closefrom.o		\
412	confstr.o		\
413	crypt.o			\
414	csetlen.o		\
415	ctime.o			\
416	ctime_r.o		\
417	deflt.o			\
418	directio.o		\
419	dirname.o		\
420	div.o			\
421	drand48.o		\
422	dup2.o			\
423	env_data.o		\
424	err.o			\
425	errno.o			\
426	euclen.o		\
427	event_port.o		\
428	execvp.o		\
429	fattach.o		\
430	fdetach.o		\
431	fdopendir.o		\
432	fmtmsg.o		\
433	ftime.o			\
434	ftok.o			\
435	ftw.o			\
436	gcvt.o			\
437	getauxv.o		\
438	getcwd.o		\
439	getdate_err.o		\
440	getdtblsize.o		\
441	getenv.o		\
442	getexecname.o		\
443	getgrnam.o		\
444	getgrnam_r.o		\
445	gethostid.o		\
446	gethostname.o		\
447	gethz.o			\
448	getisax.o		\
449	getloadavg.o		\
450	getlogin.o		\
451	getmntent.o		\
452	getnetgrent.o		\
453	getopt.o		\
454	getopt_long.o		\
455	getpagesize.o		\
456	getpw.o			\
457	getpwnam.o		\
458	getpwnam_r.o		\
459	getrusage.o		\
460	getspent.o		\
461	getspent_r.o		\
462	getsubopt.o		\
463	gettxt.o		\
464	getusershell.o		\
465	getut.o			\
466	getutx.o		\
467	getvfsent.o		\
468	getwd.o			\
469	getwidth.o		\
470	getxby_door.o		\
471	gtxt.o			\
472	hsearch.o		\
473	iconv.o			\
474	imaxabs.o		\
475	imaxdiv.o		\
476	index.o			\
477	initgroups.o		\
478	insque.o		\
479	isaexec.o		\
480	isastream.o		\
481	isatty.o		\
482	killpg.o		\
483	klpdlib.o		\
484	l64a.o			\
485	lckpwdf.o		\
486	lconstants.o		\
487	lexp10.o		\
488	lfind.o			\
489	lfmt.o			\
490	lfmt_log.o		\
491	llabs.o			\
492	lldiv.o			\
493	llog10.o		\
494	lltostr.o		\
495	localtime.o		\
496	lsearch.o		\
497	madvise.o		\
498	malloc.o		\
499	memalign.o		\
500	mkdev.o			\
501	mkdtemp.o		\
502	mkfifo.o		\
503	mkstemp.o		\
504	mktemp.o		\
505	mlock.o			\
506	mlockall.o		\
507	mon.o			\
508	msync.o			\
509	munlock.o		\
510	munlockall.o		\
511	ndbm.o			\
512	nftw.o			\
513	nlspath_checks.o	\
514	nsparse.o		\
515	nss_common.o		\
516	nss_dbdefs.o		\
517	nss_deffinder.o		\
518	opendir.o		\
519	opt_data.o		\
520	perror.o		\
521	pfmt.o			\
522	pfmt_data.o		\
523	pfmt_print.o		\
524	plock.o			\
525	poll.o			\
526	posix_fadvise.o		\
527	posix_fallocate.o	\
528	posix_madvise.o		\
529	posix_memalign.o	\
530	priocntl.o		\
531	privlib.o		\
532	priv_str_xlate.o	\
533	psiginfo.o		\
534	psignal.o		\
535	pt.o			\
536	putpwent.o		\
537	putspent.o		\
538	raise.o			\
539	rand.o			\
540	random.o		\
541	rctlops.o		\
542	readdir.o		\
543	readdir_r.o		\
544	realpath.o		\
545	reboot.o		\
546	regexpr.o		\
547	remove.o		\
548	rewinddir.o		\
549	rindex.o		\
550	scandir.o		\
551	seekdir.o		\
552	select.o		\
553	select_large_fdset.o	\
554	setlabel.o		\
555	setpriority.o		\
556	settimeofday.o		\
557	sh_locks.o		\
558	sigflag.o		\
559	siglist.o		\
560	sigsend.o		\
561	sigsetops.o		\
562	ssignal.o		\
563	stack.o			\
564	str2sig.o		\
565	strcase_charmap.o	\
566	strcasecmp.o		\
567	strcspn.o		\
568	strdup.o		\
569	strerror.o		\
570	strlcat.o		\
571	strlcpy.o		\
572	strncasecmp.o		\
573	strpbrk.o		\
574	strsep.o		\
575	strsignal.o		\
576	strspn.o		\
577	strstr.o		\
578	strtod.o		\
579	strtoimax.o		\
580	strtok.o		\
581	strtok_r.o		\
582	strtoumax.o		\
583	swab.o			\
584	swapctl.o		\
585	sysconf.o		\
586	syslog.o		\
587	tcdrain.o		\
588	tcflow.o		\
589	tcflush.o		\
590	tcgetattr.o		\
591	tcgetpgrp.o		\
592	tcgetsid.o		\
593	tcsendbreak.o		\
594	tcsetattr.o		\
595	tcsetpgrp.o		\
596	tell.o			\
597	telldir.o		\
598	tfind.o			\
599	time_data.o		\
600	time_gdata.o		\
601	truncate.o		\
602	tsdalloc.o		\
603	tsearch.o		\
604	ttyname.o		\
605	ttyslot.o		\
606	ualarm.o		\
607	ucred.o			\
608	valloc.o		\
609	vlfmt.o			\
610	vpfmt.o			\
611	waitpid.o		\
612	walkstack.o		\
613	wdata.o			\
614	xgetwidth.o		\
615	xpg4.o			\
616	xpg6.o
617
618PORTPRINT_W=			\
619	doprnt_w.o
620
621PORTPRINT=			\
622	asprintf.o		\
623	doprnt.o		\
624	fprintf.o		\
625	printf.o		\
626	snprintf.o		\
627	sprintf.o		\
628	vfprintf.o		\
629	vprintf.o		\
630	vsnprintf.o		\
631	vsprintf.o		\
632	vwprintf.o		\
633	wprintf.o
634
635# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
636PORTPRINT_C89=			\
637	vfprintf_c89.o		\
638	vprintf_c89.o		\
639	vsnprintf_c89.o		\
640	vsprintf_c89.o		\
641	vwprintf_c89.o
642
643PORTSTDIO_C89=			\
644	vscanf_c89.o		\
645	vwscanf_c89.o		\
646
647# portable stdio objects that contain large file interfaces.
648# Note: fopen64 is a special case, as we build it small.
649PORTSTDIO64=			\
650	fopen64.o		\
651	fpos64.o
652
653PORTSTDIO_W=			\
654	doscan_w.o
655
656PORTSTDIO=			\
657	__extensions.o		\
658	_endopen.o		\
659	_filbuf.o		\
660	_findbuf.o		\
661	_flsbuf.o		\
662	_wrtchk.o		\
663	clearerr.o		\
664	ctermid.o		\
665	ctermid_r.o		\
666	cuserid.o		\
667	data.o			\
668	doscan.o		\
669	fdopen.o		\
670	feof.o			\
671	ferror.o		\
672	fgetc.o			\
673	fgets.o			\
674	fileno.o		\
675	flockf.o		\
676	flush.o			\
677	fopen.o			\
678	fpos.o			\
679	fputc.o			\
680	fputs.o			\
681	fread.o			\
682	fseek.o			\
683	fseeko.o		\
684	ftell.o			\
685	ftello.o		\
686	fwrite.o		\
687	getc.o			\
688	getchar.o		\
689	getpass.o		\
690	gets.o			\
691	getw.o			\
692	mse.o			\
693	popen.o			\
694	putc.o			\
695	putchar.o		\
696	puts.o			\
697	putw.o			\
698	rewind.o		\
699	scanf.o			\
700	setbuf.o		\
701	setbuffer.o		\
702	setvbuf.o		\
703	system.o		\
704	tempnam.o		\
705	tmpfile.o		\
706	tmpnam_r.o		\
707	ungetc.o		\
708	vscanf.o		\
709	vwscanf.o		\
710	wscanf.o
711
712PORTI18N=			\
713	__fgetwc_xpg5.o		\
714	__fgetws_xpg5.o		\
715	__fputwc_xpg5.o		\
716	__fputws_xpg5.o		\
717	__ungetwc_xpg5.o	\
718	getwchar.o		\
719	putwchar.o		\
720	putws.o			\
721	strtows.o		\
722	wcsstr.o		\
723	wcstoimax.o		\
724	wcstol.o		\
725	wcstoul.o		\
726	wcswcs.o		\
727	wmemchr.o		\
728	wmemcmp.o		\
729	wmemcpy.o		\
730	wmemmove.o		\
731	wmemset.o		\
732	wscasecmp.o		\
733	wscat.o			\
734	wschr.o			\
735	wscmp.o			\
736	wscpy.o			\
737	wscspn.o		\
738	wsdup.o			\
739	wslen.o			\
740	wsncasecmp.o		\
741	wsncat.o		\
742	wsncmp.o		\
743	wsncpy.o		\
744	wspbrk.o		\
745	wsprintf.o		\
746	wsrchr.o		\
747	wsscanf.o		\
748	wsspn.o			\
749	wstod.o			\
750	wstok.o			\
751	wstol.o			\
752	wstoll.o		\
753	wsxfrm.o		\
754	gettext.o		\
755	gettext_gnu.o		\
756	gettext_real.o		\
757	gettext_util.o		\
758	plural_parser.o		\
759	wdresolve.o		\
760	_ctype.o		\
761	isascii.o		\
762	toascii.o
763
764PORTI18N_COND=			\
765	wcstol_longlong.o	\
766	wcstoul_longlong.o
767
768AIOOBJS=			\
769	aio.o			\
770	aio_alloc.o		\
771	posix_aio.o
772
773RTOBJS=				\
774	clock_timer.o		\
775	mqueue.o		\
776	pos4obj.o		\
777	sched.o			\
778	sem.o			\
779	shm.o			\
780	sigev_thread.o
781
782TPOOLOBJS=			\
783	thread_pool.o
784
785THREADSOBJS=			\
786	alloc.o			\
787	assfail.o		\
788	cancel.o		\
789	door_calls.o		\
790	pthr_attr.o		\
791	pthr_barrier.o		\
792	pthr_cond.o		\
793	pthr_mutex.o		\
794	pthr_rwlock.o		\
795	pthread.o		\
796	rwlock.o		\
797	scalls.o		\
798	sema.o			\
799	sigaction.o		\
800	spawn.o			\
801	synch.o			\
802	tdb_agent.o		\
803	thr.o			\
804	thread_interface.o	\
805	tls.o			\
806	tsd.o
807
808THREADSMACHOBJS=		\
809	machdep.o
810
811THREADSASMOBJS=			\
812	asm_subr.o
813
814UNICODEOBJS=			\
815	u8_textprep.o		\
816	uconv.o
817
818UNWINDMACHOBJS=			\
819	unwind.o
820
821UNWINDASMOBJS=			\
822	unwind_frame.o
823
824# objects that implement the transitional large file API
825PORTSYS64=			\
826	fstatat64.o		\
827	lockf64.o		\
828	openat64.o
829
830PORTSYS=			\
831	_autofssys.o		\
832	acctctl.o		\
833	bsd_signal.o		\
834	corectl.o		\
835	exacctsys.o		\
836	execl.o			\
837	execle.o		\
838	execv.o			\
839	faccessat.o		\
840	fsmisc.o		\
841	fstatat.o		\
842	getpagesizes.o		\
843	getpeerucred.o		\
844	inst_sync.o		\
845	issetugid.o		\
846	label.o			\
847	libc_fcntl.o		\
848	libc_link.o		\
849	libc_open.o		\
850	lockf.o			\
851	lwp.o			\
852	lwp_cond.o		\
853	lwp_rwlock.o		\
854	lwp_sigmask.o		\
855	meminfosys.o		\
856	msgsys.o		\
857	nfssys.o		\
858	openat.o		\
859	pgrpsys.o		\
860	posix_sigwait.o		\
861	ppriv.o			\
862	psetsys.o		\
863	rctlsys.o		\
864	sbrk.o			\
865	semsys.o		\
866	set_errno.o		\
867	sharefs.o		\
868	shmsys.o		\
869	sidsys.o		\
870	siginterrupt.o		\
871	signal.o		\
872	sigpending.o		\
873	sigstack.o		\
874	tasksys.o		\
875	time.o			\
876	time_util.o		\
877	ucontext.o		\
878	ustat.o			\
879	zone.o
880
881PORTREGEX=			\
882	glob.o			\
883	regcmp.o		\
884	regex.o			\
885	wordexp.o
886
887MOSTOBJS=			\
888	$(STRETS)		\
889	$(CRTOBJS)		\
890	$(DYNOBJS)		\
891	$(FPOBJS)		\
892	$(FPASMOBJS)		\
893	$(ATOMICOBJS)		\
894	$(XATTROBJS)		\
895	$(COMOBJS)		\
896	$(DTRACEOBJS)		\
897	$(GENOBJS)		\
898	$(PORTFP)		\
899	$(PORTGEN)		\
900	$(PORTGEN64)		\
901	$(PORTI18N)		\
902	$(PORTI18N_COND)	\
903	$(PORTPRINT)		\
904	$(PORTPRINT_C89)	\
905	$(PORTPRINT_W)		\
906	$(PORTREGEX)		\
907	$(PORTSTDIO)		\
908	$(PORTSTDIO64)		\
909	$(PORTSTDIO_C89)	\
910	$(PORTSTDIO_W)		\
911	$(PORTSYS)		\
912	$(PORTSYS64)		\
913	$(AIOOBJS)		\
914	$(RTOBJS)		\
915	$(TPOOLOBJS)		\
916	$(THREADSOBJS)		\
917	$(THREADSMACHOBJS)	\
918	$(THREADSASMOBJS)	\
919	$(UNICODEOBJS)		\
920	$(UNWINDMACHOBJS)	\
921	$(UNWINDASMOBJS)	\
922	$(COMSYSOBJS)		\
923	$(SYSOBJS)		\
924	$(COMSYSOBJS64)		\
925	$(SYSOBJS64)		\
926	$(VALUES)
927
928TRACEOBJS=			\
929	plockstat.o
930
931# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
932# modules whose source is provided in the $(SRC)/lib/common directory.
933# This must be done because otherwise the Sun C compiler would insert
934# its own versions of these modules and those versions contain code
935# to call out to C++ initialization functions.  Such C++ initialization
936# functions can call back into libc before thread initialization is
937# complete and this leads to segmentation violations and other problems.
938# Since libc contains no C++ code, linking with the minimal crti.o and
939# crtn.o modules is safe and avoids the problems described above.
940OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
941CRTSRCS= ../../common/i386
942
943LDPASS_OFF=	$(POUND_SIGN)
944
945# include common library definitions
946include ../../Makefile.lib
947
948# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
949# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
950# need to be compatible with the ones for the libc stuff.  Whenever the changes
951# that affect the compilation conditions of libc happened, those for libc_i18n
952# also need to be updated.
953
954# we need to override the default SONAME here because we might
955# be building a variant object (still libc.so.1, but different filename)
956SONAME = libc.so.1
957
958CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
959
960# This is necessary to avoid problems with calling _ex_unwind().
961# We probably don't want any inlining anyway.
962XINLINE = -xinline=
963CFLAGS += $(XINLINE)
964
965# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
966# enables ASSERT() checking in the threads portion of the library.
967# This is automatically enabled for DEBUG builds, not for non-debug builds.
968THREAD_DEBUG =
969$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
970
971# Make string literals read-only to save memory.
972CFLAGS += $(XSTRCONST)
973
974ALTPICS= $(TRACEOBJS:%=pics/%)
975
976$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
977$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(LDLIBS)
978
979MAPFILES =	../port/mapfile-vers ../i386/mapfile-vers
980
981#
982# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
983#
984CFLAGS +=	$(EXTN_CFLAGS)
985CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
986		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
987ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
988
989# Conditionally add support for making |wordexp()| check whether
990# /usr/bin/ksh is ksh93 or not
991include ../../../Makefile.ksh93switch
992CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
993
994# Inform the run-time linker about libc specialized initialization
995RTLDINFO =	-z rtldinfo=tls_rtldinfo
996DYNFLAGS +=	$(RTLDINFO)
997
998DYNFLAGS +=	-e __rtboot
999DYNFLAGS +=	$(EXTN_DYNFLAGS)
1000
1001# Inform the kernel about the initial DTrace area (in case
1002# libc is being used as the interpreter / runtime linker).
1003DTRACE_DATA =	-zdtrace=dtrace_data
1004DYNFLAGS +=	$(DTRACE_DATA)
1005
1006# DTrace needs an executable data segment.
1007MAPFILE.NED=
1008
1009BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1010
1011# Override this top level flag so the compiler builds in its native
1012# C99 mode.  This has been enabled to support the complex arithmetic
1013# added to libc.
1014C99MODE=	$(C99_ENABLE)
1015
1016# libc method of building an archive
1017BUILD.AR= $(RM) $@ ; \
1018	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
1019
1020# extra files for the clean target
1021CLEANFILES=			\
1022	../port/gen/errlst.c	\
1023	../port/gen/new_list.c	\
1024	assym.h			\
1025	genassym		\
1026	crt/_rtld.s		\
1027	crt/_rtbootld.s		\
1028	pics/_rtbootld.o	\
1029	pics/crti.o		\
1030	pics/crtn.o		\
1031	$(ALTPICS)
1032
1033CLOBBERFILES +=	$(LIB_PIC)
1034
1035# list of C source for lint
1036SRCS=							\
1037	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1038	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1039	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1040	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1041	$(PORTFP:%.o=../port/fp/%.c)			\
1042	$(PORTGEN:%.o=../port/gen/%.c)			\
1043	$(PORTI18N:%.o=../port/i18n/%.c)		\
1044	$(PORTPRINT:%.o=../port/print/%.c)		\
1045	$(PORTREGEX:%.o=../port/regex/%.c)		\
1046	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1047	$(PORTSYS:%.o=../port/sys/%.c)			\
1048	$(AIOOBJS:%.o=../port/aio/%.c)			\
1049	$(RTOBJS:%.o=../port/rt/%.c)			\
1050	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
1051	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1052	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1053	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1054	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1055	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1056	$(LIBCBASE)/gen/ecvt.c				\
1057	$(LIBCBASE)/gen/makectxt.c			\
1058	$(LIBCBASE)/gen/siginfolst.c			\
1059	$(LIBCBASE)/gen/siglongjmp.c			\
1060	$(LIBCBASE)/gen/strcmp.c			\
1061	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1062	$(LIBCBASE)/sys/ptrace.c			\
1063	$(LIBCBASE)/sys/uadmin.c
1064
1065# conditional assignments
1066$(DYNLIB) := CRTI = crti.o
1067$(DYNLIB) := CRTN = crtn.o
1068
1069# Files which need the threads .il inline template
1070TIL=				\
1071	aio.o			\
1072	alloc.o			\
1073	assfail.o		\
1074	atexit.o		\
1075	atfork.o		\
1076	cancel.o		\
1077	door_calls.o		\
1078	errno.o			\
1079	lwp.o			\
1080	ma.o			\
1081	machdep.o		\
1082	posix_aio.o		\
1083	pthr_attr.o		\
1084	pthr_barrier.o		\
1085	pthr_cond.o		\
1086	pthr_mutex.o		\
1087	pthr_rwlock.o		\
1088	pthread.o		\
1089	rand.o			\
1090	rwlock.o		\
1091	scalls.o		\
1092	sched.o			\
1093	sema.o			\
1094	sigaction.o		\
1095	sigev_thread.o		\
1096	spawn.o			\
1097	stack.o			\
1098	synch.o			\
1099	tdb_agent.o		\
1100	thr.o			\
1101	thread_interface.o	\
1102	thread_pool.o		\
1103	tls.o			\
1104	tsd.o			\
1105	unwind.o
1106
1107THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1108$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1109
1110# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1111
1112# large-file-aware components that should be built large
1113
1114$(COMSYSOBJS64:%=pics/%) := \
1115	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1116
1117$(SYSOBJS64:%=pics/%) := \
1118	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1119
1120$(PORTGEN64:%=pics/%) := \
1121	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1122
1123$(PORTSTDIO64:%=pics/%) := \
1124	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1125
1126$(PORTSYS64:%=pics/%) := \
1127	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1128
1129$(PORTSTDIO_W:%=pics/%) := \
1130	CPPFLAGS += -D_WIDE
1131
1132$(PORTPRINT_W:%=pics/%) := \
1133	CPPFLAGS += -D_WIDE
1134
1135$(PORTPRINT_C89:%=pics/%) := \
1136	CPPFLAGS += -D_C89_INTMAX32
1137
1138$(PORTSTDIO_C89:%=pics/%) := \
1139	CPPFLAGS += -D_C89_INTMAX32
1140
1141$(PORTI18N_COND:%=pics/%) := \
1142	CPPFLAGS += -D_WCS_LONGLONG
1143
1144.KEEP_STATE:
1145
1146all: $(LIBS) $(LIB_PIC)
1147
1148lint	:=	CPPFLAGS += -I../$(MACH)/fp
1149lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1150lint	:=	LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1151
1152lint:
1153	@echo $(LINT.c) ...
1154	@$(LINT.c) $(SRCS) $(LDLIBS)
1155
1156$(LINTLIB):= SRCS=../port/llib-lc
1157$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1158$(LINTLIB):= LINTFLAGS=-nvx
1159
1160# object files that depend on inline template
1161$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1162# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1163
1164# include common libc targets
1165include ../Makefile.targ
1166
1167# We need to strip out all CTF and DOF data from the static library
1168$(LIB_PIC) := DIR = pics
1169$(LIB_PIC): pics $$(PICS)
1170	$(BUILD.AR)
1171	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1172	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1173	$(AR) -ts $@ > /dev/null
1174	$(POST_PROCESS_A)
1175
1176$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1177	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
1178	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1179	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1180	$(RM) $(LIBCBASE)/crt/_rtld.s
1181
1182# partially built from C source
1183pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1184	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1185	$(CTFCONVERT_O)
1186
1187ASSYMDEP_OBJS=			\
1188	_lwp_mutex_unlock.o	\
1189	_stack_grow.o		\
1190	getcontext.o		\
1191	tls_get_addr.o		\
1192	vforkx.o
1193
1194$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1195
1196$(ASSYMDEP_OBJS:%=pics/%): assym.h
1197
1198# assym.h build rules
1199
1200GENASSYM_C = ../$(MACH)/genassym.c
1201
1202# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1203#	live in Makefile.master
1204
1205CPPFLAGS.genassym = \
1206	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1207
1208genassym: $(GENASSYM_C)
1209	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc	\
1210		-D__EXTENSIONS__ $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1211
1212OFFSETS = ../$(MACH)/offsets.in
1213
1214assym.h: $(OFFSETS) genassym
1215	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1216	./genassym >>$@
1217
1218# derived C source and related explicit dependencies
1219../port/gen/errlst.c + \
1220../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1221	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1222
1223pics/errlst.o: ../port/gen/errlst.c
1224
1225pics/new_list.o: ../port/gen/new_list.c
1226