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