xref: /titanic_52/usr/src/lib/libc/i386/Makefile.com (revision 5763ba1e357fad1d57b5875c499307b7ea6e2cd4)
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 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28LIB_PIC= libc_pic.a
29VERS=	.1
30CPP=	/usr/lib/cpp
31TARGET_ARCH=	i386
32
33VALUES=	values-Xa.o
34
35# objects are grouped by source directory
36
37# local objects
38STRETS=
39
40CRTOBJS=			\
41	cerror.o		\
42	cerror64.o
43
44DYNOBJS=
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
99DTRACEOBJS=			\
100	dtrace_data.o
101
102GENOBJS=			\
103	_div64.o		\
104	_divdi3.o		\
105	_getsp.o		\
106	_mul64.o		\
107	abs.o			\
108	alloca.o		\
109	byteorder.o		\
110	cuexit.o		\
111	ecvt.o			\
112	errlst.o		\
113	i386_data.o		\
114	ladd.o			\
115	ldivide.o		\
116	lexp10.o		\
117	llog10.o		\
118	lmul.o			\
119	lock.o			\
120	lshiftl.o		\
121	lsign.o			\
122	lsub.o			\
123	ltostr.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	open64.o		\
156	pread64.o		\
157	pwrite64.o		\
158	setrlimit64.o		\
159	stat64.o		\
160	statvfs64.o
161
162SYSOBJS64=			\
163	mmap64.o
164
165COMSYSOBJS=			\
166	__clock_timer.o		\
167	__fcntl.o		\
168	__getloadavg.o		\
169	__rusagesys.o		\
170	__signotify.o		\
171	__sigrt.o		\
172	__time.o		\
173	_lgrp_home_fast.o	\
174	_lgrpsys.o		\
175	_nfssys.o		\
176	_portfs.o		\
177	_pset.o			\
178	_rename.o		\
179	_rpcsys.o		\
180	_sigaction.o		\
181	_so_accept.o		\
182	_so_bind.o		\
183	_so_connect.o		\
184	_so_getpeername.o	\
185	_so_getsockname.o	\
186	_so_getsockopt.o	\
187	_so_listen.o		\
188	_so_recv.o		\
189	_so_recvfrom.o		\
190	_so_recvmsg.o		\
191	_so_send.o		\
192	_so_sendmsg.o		\
193	_so_sendto.o		\
194	_so_setsockopt.o	\
195	_so_shutdown.o		\
196	_so_socket.o		\
197	_so_socketpair.o	\
198	_sockconfig.o		\
199	access.o		\
200	acct.o			\
201	acl.o			\
202	adjtime.o		\
203	alarm.o			\
204	brk.o			\
205	chdir.o			\
206	chmod.o			\
207	chown.o			\
208	chroot.o		\
209	cladm.o			\
210	close.o			\
211	creat.o			\
212	dup.o			\
213	execve.o		\
214	exit.o			\
215	facl.o			\
216	fchdir.o		\
217	fchmod.o		\
218	fchown.o		\
219	fchroot.o		\
220	fdsync.o		\
221	fpathconf.o		\
222	fstat.o			\
223	fstatfs.o		\
224	fstatvfs.o		\
225	getcpuid.o		\
226	getdents.o		\
227	getegid.o		\
228	geteuid.o		\
229	getgid.o		\
230	getgroups.o		\
231	gethrtime.o		\
232	getitimer.o		\
233	getmsg.o		\
234	getpagesizes.o		\
235	getpid.o		\
236	getpmsg.o		\
237	getppid.o		\
238	getrlimit.o		\
239	getuid.o		\
240	gtty.o			\
241	install_utrap.o		\
242	ioctl.o			\
243	kaio.o			\
244	kill.o			\
245	lchown.o		\
246	link.o			\
247	llseek.o		\
248	lseek.o			\
249	lstat.o			\
250	memcntl.o		\
251	mincore.o		\
252	mkdir.o			\
253	mknod.o			\
254	mmap.o			\
255	modctl.o		\
256	mount.o			\
257	mprotect.o		\
258	munmap.o		\
259	nice.o			\
260	ntp_adjtime.o		\
261	ntp_gettime.o		\
262	open.o			\
263	p_online.o		\
264	pathconf.o		\
265	pause.o			\
266	pcsample.o		\
267	pollsys.o		\
268	pread.o			\
269	priocntlset.o		\
270	processor_bind.o	\
271	processor_info.o	\
272	profil.o		\
273	putmsg.o		\
274	putpmsg.o		\
275	pwrite.o		\
276	read.o			\
277	readlink.o		\
278	readv.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	l64a.o			\
484	lckpwdf.o		\
485	lconstants.o		\
486	lfind.o			\
487	lfmt.o			\
488	lfmt_log.o		\
489	llabs.o			\
490	lldiv.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	priocntl.o		\
524	privlib.o		\
525	priv_str_xlate.o	\
526	psiginfo.o		\
527	psignal.o		\
528	pt.o			\
529	putpwent.o		\
530	putspent.o		\
531	raise.o			\
532	rand.o			\
533	random.o		\
534	rctlops.o		\
535	readdir.o		\
536	readdir_r.o		\
537	realpath.o		\
538	reboot.o		\
539	regexpr.o		\
540	rename.o		\
541	rewinddir.o		\
542	rindex.o		\
543	scandir.o		\
544	seekdir.o		\
545	select.o		\
546	select_large_fdset.o	\
547	setlabel.o		\
548	setpriority.o		\
549	settimeofday.o		\
550	sh_locks.o		\
551	sigflag.o		\
552	siglist.o		\
553	sigsend.o		\
554	sigsetops.o		\
555	ssignal.o		\
556	stack.o			\
557	str2sig.o		\
558	strcase_charmap.o	\
559	strcasecmp.o		\
560	strcspn.o		\
561	strdup.o		\
562	strerror.o		\
563	strlcat.o		\
564	strlcpy.o		\
565	strncasecmp.o		\
566	strpbrk.o		\
567	strsignal.o		\
568	strspn.o		\
569	strstr.o		\
570	strtod.o		\
571	strtoimax.o		\
572	strtok.o		\
573	strtok_r.o		\
574	strtoll.o		\
575	strtoull.o		\
576	strtoumax.o		\
577	swab.o			\
578	swapctl.o		\
579	sysconf.o		\
580	syslog.o		\
581	tcdrain.o		\
582	tcflow.o		\
583	tcflush.o		\
584	tcgetattr.o		\
585	tcgetpgrp.o		\
586	tcgetsid.o		\
587	tcsendbreak.o		\
588	tcsetattr.o		\
589	tcsetpgrp.o		\
590	tell.o			\
591	telldir.o		\
592	tfind.o			\
593	time_data.o		\
594	time_gdata.o		\
595	truncate.o		\
596	tsdalloc.o		\
597	tsearch.o		\
598	ttyname.o		\
599	ttyslot.o		\
600	ualarm.o		\
601	ucred.o			\
602	valloc.o		\
603	vlfmt.o			\
604	vpfmt.o			\
605	wait3.o			\
606	wait4.o			\
607	waitpid.o		\
608	walkstack.o		\
609	wdata.o			\
610	xgetwidth.o		\
611	xpg4.o			\
612	xpg6.o
613
614PORTPRINT_W=			\
615	doprnt_w.o
616
617PORTPRINT=			\
618	doprnt.o		\
619	fprintf.o		\
620	printf.o		\
621	snprintf.o		\
622	sprintf.o		\
623	vfprintf.o		\
624	vprintf.o		\
625	vsnprintf.o		\
626	vsprintf.o		\
627	vwprintf.o		\
628	wprintf.o
629
630# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
631PORTPRINT_C89=			\
632	vfprintf_c89.o		\
633	vprintf_c89.o		\
634	vsnprintf_c89.o		\
635	vsprintf_c89.o		\
636	vwprintf_c89.o
637
638PORTSTDIO_C89=			\
639	vscanf_c89.o		\
640	vwscanf_c89.o		\
641
642# portable stdio objects that contain large file interfaces.
643# Note: fopen64 is a special case, as we build it small.
644PORTSTDIO64=			\
645	fopen64.o		\
646	fpos64.o
647
648PORTSTDIO_W=			\
649	doscan_w.o
650
651PORTSTDIO=			\
652	__extensions.o		\
653	_endopen.o		\
654	_filbuf.o		\
655	_findbuf.o		\
656	_flsbuf.o		\
657	_wrtchk.o		\
658	clearerr.o		\
659	ctermid.o		\
660	ctermid_r.o		\
661	cuserid.o		\
662	data.o			\
663	doscan.o		\
664	fdopen.o		\
665	feof.o			\
666	ferror.o		\
667	fgetc.o			\
668	fgets.o			\
669	fileno.o		\
670	flockf.o		\
671	flush.o			\
672	fopen.o			\
673	fpos.o			\
674	fputc.o			\
675	fputs.o			\
676	fread.o			\
677	fseek.o			\
678	fseeko.o		\
679	ftell.o			\
680	ftello.o		\
681	fwrite.o		\
682	getc.o			\
683	getchar.o		\
684	getpass.o		\
685	gets.o			\
686	getw.o			\
687	mse.o			\
688	popen.o			\
689	putc.o			\
690	putchar.o		\
691	puts.o			\
692	putw.o			\
693	rewind.o		\
694	scanf.o			\
695	setbuf.o		\
696	setbuffer.o		\
697	setvbuf.o		\
698	system.o		\
699	tempnam.o		\
700	tmpfile.o		\
701	tmpnam_r.o		\
702	ungetc.o		\
703	vscanf.o		\
704	vwscanf.o		\
705	wscanf.o
706
707PORTI18N=			\
708	__fgetwc_xpg5.o		\
709	__fgetws_xpg5.o		\
710	__fputwc_xpg5.o		\
711	__fputws_xpg5.o		\
712	__ungetwc_xpg5.o	\
713	getwchar.o		\
714	putwchar.o		\
715	putws.o			\
716	strtows.o		\
717	wcsstr.o		\
718	wcstoimax.o		\
719	wcstol.o		\
720	wcstoul.o		\
721	wcswcs.o		\
722	wmemchr.o		\
723	wmemcmp.o		\
724	wmemcpy.o		\
725	wmemmove.o		\
726	wmemset.o		\
727	wscasecmp.o		\
728	wscat.o			\
729	wschr.o			\
730	wscmp.o			\
731	wscpy.o			\
732	wscspn.o		\
733	wsdup.o			\
734	wslen.o			\
735	wsncasecmp.o		\
736	wsncat.o		\
737	wsncmp.o		\
738	wsncpy.o		\
739	wspbrk.o		\
740	wsprintf.o		\
741	wsrchr.o		\
742	wsscanf.o		\
743	wsspn.o			\
744	wstod.o			\
745	wstok.o			\
746	wstol.o			\
747	wstoll.o		\
748	wsxfrm.o		\
749	gettext.o		\
750	gettext_gnu.o		\
751	gettext_real.o		\
752	gettext_util.o		\
753	plural_parser.o		\
754	wdresolve.o		\
755	_ctype.o		\
756	isascii.o		\
757	toascii.o
758
759PORTI18N_COND=			\
760	wcstol_longlong.o	\
761	wcstoul_longlong.o
762
763AIOOBJS=			\
764	aio.o			\
765	aio_alloc.o		\
766	posix_aio.o
767
768RTOBJS=				\
769	clock_timer.o		\
770	fallocate.o		\
771	mqueue.o		\
772	pos4obj.o		\
773	sched.o			\
774	sem.o			\
775	shm.o			\
776	sigev_thread.o
777
778TPOOLOBJS=			\
779	thread_pool.o
780
781THREADSOBJS=			\
782	alloc.o			\
783	assfail.o		\
784	cancel.o		\
785	door_calls.o		\
786	pthr_attr.o		\
787	pthr_barrier.o		\
788	pthr_cond.o		\
789	pthr_mutex.o		\
790	pthr_rwlock.o		\
791	pthread.o		\
792	rtsched.o		\
793	rwlock.o		\
794	scalls.o		\
795	sema.o			\
796	sigaction.o		\
797	spawn.o			\
798	synch.o			\
799	tdb_agent.o		\
800	thr.o			\
801	thread_interface.o	\
802	tls.o			\
803	tsd.o
804
805THREADSMACHOBJS=		\
806	machdep.o
807
808THREADSASMOBJS=			\
809	asm_subr.o
810
811UNICODEOBJS=			\
812	u8_textprep.o		\
813	uconv.o
814
815UNWINDMACHOBJS=			\
816	unwind.o
817
818UNWINDASMOBJS=			\
819	unwind_frame.o
820
821# objects that implement the transitional large file API
822PORTSYS64=			\
823	fstatat64.o		\
824	lockf64.o		\
825	openat64.o
826
827PORTSYS=			\
828	_autofssys.o		\
829	acctctl.o		\
830	bsd_signal.o		\
831	corectl.o		\
832	exacctsys.o		\
833	execl.o			\
834	execle.o		\
835	execv.o			\
836	faccessat.o		\
837	fcntl.o			\
838	fsmisc.o		\
839	fstatat.o		\
840	fsync.o			\
841	getpeerucred.o		\
842	inst_sync.o		\
843	issetugid.o		\
844	label.o			\
845	libc_link.o		\
846	libc_open.o		\
847	lockf.o			\
848	lwp.o			\
849	lwp_cond.o		\
850	lwp_rwlock.o		\
851	lwp_sigmask.o		\
852	meminfosys.o		\
853	msgsys.o		\
854	nfssys.o		\
855	openat.o		\
856	pgrpsys.o		\
857	posix_sigwait.o		\
858	ppriv.o			\
859	psetsys.o		\
860	rctlsys.o		\
861	sbrk.o			\
862	semsys.o		\
863	set_errno.o		\
864	sharefs.o		\
865	shmsys.o		\
866	sidsys.o		\
867	siginterrupt.o		\
868	signal.o		\
869	sigpending.o		\
870	sigstack.o		\
871	tasksys.o		\
872	time.o			\
873	time_util.o		\
874	ucontext.o		\
875	ustat.o			\
876	zone.o
877
878PORTREGEX=			\
879	glob.o			\
880	regcmp.o		\
881	regex.o			\
882	wordexp.o
883
884MOSTOBJS=			\
885	$(STRETS)		\
886	$(CRTOBJS)		\
887	$(DYNOBJS)		\
888	$(FPOBJS)		\
889	$(FPASMOBJS)		\
890	$(ATOMICOBJS)		\
891	$(XATTROBJS)		\
892	$(COMOBJS)		\
893	$(DTRACEOBJS)		\
894	$(GENOBJS)		\
895	$(PORTFP)		\
896	$(PORTGEN)		\
897	$(PORTGEN64)		\
898	$(PORTI18N)		\
899	$(PORTI18N_COND)	\
900	$(PORTPRINT)		\
901	$(PORTPRINT_C89)	\
902	$(PORTPRINT_W)		\
903	$(PORTREGEX)		\
904	$(PORTSTDIO)		\
905	$(PORTSTDIO64)		\
906	$(PORTSTDIO_C89)	\
907	$(PORTSTDIO_W)		\
908	$(PORTSYS)		\
909	$(PORTSYS64)		\
910	$(AIOOBJS)		\
911	$(RTOBJS)		\
912	$(TPOOLOBJS)		\
913	$(THREADSOBJS)		\
914	$(THREADSMACHOBJS)	\
915	$(THREADSASMOBJS)	\
916	$(UNICODEOBJS)		\
917	$(UNWINDMACHOBJS)	\
918	$(UNWINDASMOBJS)	\
919	$(COMSYSOBJS)		\
920	$(SYSOBJS)		\
921	$(COMSYSOBJS64)		\
922	$(SYSOBJS64)		\
923	$(VALUES)
924
925TRACEOBJS=			\
926	plockstat.o
927
928# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
929# modules whose source is provided in the $(SRC)/lib/common directory.
930# This must be done because otherwise the Sun C compiler would insert
931# its own versions of these modules and those versions contain code
932# to call out to C++ initialization functions.  Such C++ initialization
933# functions can call back into libc before thread initialization is
934# complete and this leads to segmentation violations and other problems.
935# Since libc contains no C++ code, linking with the minimal crti.o and
936# crtn.o modules is safe and avoids the problems described above.
937OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
938CRTSRCS= ../../common/i386
939
940LDPASS_OFF=	$(POUND_SIGN)
941
942# include common library definitions
943include ../../Makefile.lib
944
945# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
946# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
947# need to be compatible with the ones for the libc stuff.  Whenever the changes
948# that affect the compilation conditions of libc happened, those for libc_i18n
949# also need to be updated.
950
951# we need to override the default SONAME here because we might
952# be building a variant object (still libc.so.1, but different filename)
953SONAME = libc.so.1
954
955CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
956
957# This is necessary to avoid problems with calling _ex_unwind().
958# We probably don't want any inlining anyway.
959XINLINE = -xinline=
960CFLAGS += $(XINLINE)
961
962# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
963# enables ASSERT() checking in the threads portion of the library.
964# This is automatically enabled for DEBUG builds, not for non-debug builds.
965THREAD_DEBUG =
966$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
967
968CFLAGS += $(THREAD_DEBUG)
969
970ALTPICS= $(TRACEOBJS:%=pics/%)
971
972$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
973$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(LDLIBS)
974
975MAPFILES =	../port/mapfile-vers ../i386/mapfile-vers
976
977#
978# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
979#
980CFLAGS +=	$(EXTN_CFLAGS)
981CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) \
982		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
983ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
984
985# Conditionally add support for making |wordexp()| check whether
986# /usr/bin/ksh is ksh93 or not
987include ../../../Makefile.ksh93switch
988CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
989
990# Inform the run-time linker about libc specialized initialization
991RTLDINFO =	-z rtldinfo=tls_rtldinfo
992DYNFLAGS +=	$(RTLDINFO)
993
994DYNFLAGS +=	-e __rtboot
995DYNFLAGS +=	$(EXTN_DYNFLAGS)
996
997# Inform the kernel about the initial DTrace area (in case
998# libc is being used as the interpreter / runtime linker).
999DTRACE_DATA =	-zdtrace=dtrace_data
1000DYNFLAGS +=	$(DTRACE_DATA)
1001
1002# DTrace needs an executable data segment.
1003MAPFILE.NED=
1004
1005BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1006
1007# Override this top level flag so the compiler builds in its native
1008# C99 mode.  This has been enabled to support the complex arithmetic
1009# added to libc.
1010C99MODE=	$(C99_ENABLE)
1011
1012# libc method of building an archive
1013BUILD.AR= $(RM) $@ ; \
1014	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
1015
1016# extra files for the clean target
1017CLEANFILES=			\
1018	../port/gen/errlst.c	\
1019	../port/gen/new_list.c	\
1020	assym.h			\
1021	genassym		\
1022	crt/_rtld.s		\
1023	crt/_rtbootld.s		\
1024	pics/_rtbootld.o	\
1025	pics/crti.o		\
1026	pics/crtn.o		\
1027	$(ALTPICS)
1028
1029CLOBBERFILES +=	$(LIB_PIC)
1030
1031# list of C source for lint
1032SRCS=							\
1033	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1034	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1035	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1036	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1037	$(PORTFP:%.o=../port/fp/%.c)			\
1038	$(PORTGEN:%.o=../port/gen/%.c)			\
1039	$(PORTI18N:%.o=../port/i18n/%.c)		\
1040	$(PORTPRINT:%.o=../port/print/%.c)		\
1041	$(PORTREGEX:%.o=../port/regex/%.c)		\
1042	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1043	$(PORTSYS:%.o=../port/sys/%.c)			\
1044	$(AIOOBJS:%.o=../port/aio/%.c)			\
1045	$(RTOBJS:%.o=../port/rt/%.c)			\
1046	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
1047	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1048	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1049	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1050	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1051	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1052	$(LIBCBASE)/gen/ecvt.c				\
1053	$(LIBCBASE)/gen/lexp10.c			\
1054	$(LIBCBASE)/gen/llog10.c			\
1055	$(LIBCBASE)/gen/ltostr.c			\
1056	$(LIBCBASE)/gen/makectxt.c			\
1057	$(LIBCBASE)/gen/siginfolst.c			\
1058	$(LIBCBASE)/gen/siglongjmp.c			\
1059	$(LIBCBASE)/gen/strcmp.c			\
1060	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1061	$(LIBCBASE)/sys/ptrace.c			\
1062	$(LIBCBASE)/sys/uadmin.c
1063
1064# conditional assignments
1065$(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
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	rtsched.o		\
1091	rwlock.o		\
1092	scalls.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