xref: /titanic_41/usr/src/lib/libc/i386/Makefile.com (revision 1daa57680c1c12da0548089a11b00a9d6d077bb5)
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	qsort.o			\
92	strtol.o		\
93	strtoul.o
94
95GENOBJS=			\
96	_div64.o		\
97	_divdi3.o		\
98	_getsp.o		\
99	_mul64.o		\
100	abs.o			\
101	alloca.o		\
102	byteorder.o		\
103	cuexit.o		\
104	ecvt.o			\
105	errlst.o		\
106	i386_data.o		\
107	ladd.o			\
108	ldivide.o		\
109	lexp10.o		\
110	llog10.o		\
111	lmul.o			\
112	lock.o			\
113	lshiftl.o		\
114	lsign.o			\
115	lsub.o			\
116	ltostr.o		\
117	makectxt.o		\
118	memccpy.o		\
119	memchr.o		\
120	memcmp.o		\
121	memcpy.o		\
122	memset.o		\
123	new_list.o		\
124	setjmp.o		\
125	siginfolst.o		\
126	siglongjmp.o		\
127	strcat.o		\
128	strchr.o		\
129	strcmp.o		\
130	strcpy.o		\
131	strlen.o		\
132	strncat.o		\
133	strncmp.o		\
134	strncpy.o		\
135	strrchr.o		\
136	sync_instruction_memory.o
137
138# sysobjs that contain large-file interfaces
139COMSYSOBJS64=			\
140	creat64.o		\
141	fstat64.o		\
142	fstatvfs64.o		\
143	getdents64.o		\
144	getrlimit64.o		\
145	lseek64.o		\
146	lstat64.o		\
147	open64.o		\
148	pread64.o		\
149	pwrite64.o		\
150	setrlimit64.o		\
151	stat64.o		\
152	statvfs64.o
153
154SYSOBJS64=			\
155	mmap64.o
156
157COMSYSOBJS=			\
158	__clock_timer.o		\
159	__fcntl.o		\
160	__getloadavg.o		\
161	__rusagesys.o		\
162	__signotify.o		\
163	__sigrt.o		\
164	__time.o		\
165	_lgrp_home_fast.o	\
166	_lgrpsys.o		\
167	_nfssys.o		\
168	_portfs.o		\
169	_pset.o			\
170	_rename.o		\
171	_rpcsys.o		\
172	_sigaction.o		\
173	_so_accept.o		\
174	_so_bind.o		\
175	_so_connect.o		\
176	_so_getpeername.o	\
177	_so_getsockname.o	\
178	_so_getsockopt.o	\
179	_so_listen.o		\
180	_so_recv.o		\
181	_so_recvfrom.o		\
182	_so_recvmsg.o		\
183	_so_send.o		\
184	_so_sendmsg.o		\
185	_so_sendto.o		\
186	_so_setsockopt.o	\
187	_so_shutdown.o		\
188	_so_socket.o		\
189	_so_socketpair.o	\
190	_sockconfig.o		\
191	access.o		\
192	acct.o			\
193	acl.o			\
194	adjtime.o		\
195	alarm.o			\
196	brk.o			\
197	chdir.o			\
198	chmod.o			\
199	chown.o			\
200	chroot.o		\
201	cladm.o			\
202	close.o			\
203	creat.o			\
204	dup.o			\
205	execve.o		\
206	exit.o			\
207	facl.o			\
208	fchdir.o		\
209	fchmod.o		\
210	fchown.o		\
211	fchroot.o		\
212	fdsync.o		\
213	fpathconf.o		\
214	fstat.o			\
215	fstatfs.o		\
216	fstatvfs.o		\
217	getcpuid.o		\
218	getdents.o		\
219	getegid.o		\
220	geteuid.o		\
221	getgid.o		\
222	getgroups.o		\
223	gethrtime.o		\
224	getitimer.o		\
225	getmsg.o		\
226	getpagesizes.o		\
227	getpid.o		\
228	getpmsg.o		\
229	getppid.o		\
230	getrlimit.o		\
231	getuid.o		\
232	gtty.o			\
233	install_utrap.o		\
234	ioctl.o			\
235	kaio.o			\
236	kill.o			\
237	lchown.o		\
238	link.o			\
239	llseek.o		\
240	lseek.o			\
241	lstat.o			\
242	memcntl.o		\
243	mincore.o		\
244	mkdir.o			\
245	mknod.o			\
246	mmap.o			\
247	modctl.o		\
248	mount.o			\
249	mprotect.o		\
250	munmap.o		\
251	nice.o			\
252	ntp_adjtime.o		\
253	ntp_gettime.o		\
254	open.o			\
255	p_online.o		\
256	pathconf.o		\
257	pause.o			\
258	pcsample.o		\
259	pollsys.o		\
260	pread.o			\
261	priocntlset.o		\
262	processor_bind.o	\
263	processor_info.o	\
264	profil.o		\
265	putmsg.o		\
266	putpmsg.o		\
267	pwrite.o		\
268	read.o			\
269	readlink.o		\
270	readv.o			\
271	resolvepath.o		\
272	rmdir.o			\
273	seteguid.o		\
274	setgid.o		\
275	setgroups.o		\
276	setitimer.o		\
277	setreid.o		\
278	setrlimit.o		\
279	setuid.o		\
280	sigaltstk.o		\
281	sigprocmsk.o		\
282	sigsendset.o		\
283	sigsuspend.o		\
284	stat.o			\
285	statfs.o		\
286	statvfs.o		\
287	stty.o			\
288	symlink.o		\
289	sync.o			\
290	sysconfig.o		\
291	sysfs.o			\
292	sysinfo.o		\
293	syslwp.o		\
294	times.o			\
295	ulimit.o		\
296	umask.o			\
297	umount2.o		\
298	unlink.o		\
299	utime.o			\
300	utimes.o		\
301	utssys.o		\
302	vhangup.o		\
303	waitid.o		\
304	write.o			\
305	writev.o		\
306	yield.o
307
308SYSOBJS=			\
309	__clock_gettime.o	\
310	__getcontext.o		\
311	__uadmin.o		\
312	_lwp_mutex_unlock.o	\
313	_stack_grow.o		\
314	door.o			\
315	fork1.o			\
316	forkall.o		\
317	fxstat.o		\
318	getcontext.o		\
319	gettimeofday.o		\
320	lwp_private.o		\
321	lxstat.o		\
322	nuname.o		\
323	pipe.o			\
324	ptrace.o		\
325	syscall.o		\
326	sysi86.o		\
327	tls_get_addr.o		\
328	uadmin.o		\
329	umount.o		\
330	uname.o			\
331	vfork.o			\
332	xmknod.o		\
333	xstat.o
334
335# objects under ../port which contain transitional large file interfaces
336PORTGEN64=			\
337	_xftw64.o		\
338	attropen64.o		\
339	ftw64.o			\
340	mkstemp64.o		\
341	nftw64.o		\
342	tell64.o		\
343	truncate64.o
344
345# objects from source under ../port
346PORTFP=				\
347	__flt_decim.o		\
348	__flt_rounds.o		\
349	__tbl_10_b.o		\
350	__tbl_10_h.o		\
351	__tbl_10_s.o		\
352	__tbl_2_b.o		\
353	__tbl_2_h.o		\
354	__tbl_2_s.o		\
355	__tbl_fdq.o		\
356	__tbl_tens.o		\
357	__x_power.o		\
358	_base_sup.o		\
359	aconvert.o		\
360	decimal_bin.o		\
361	double_decim.o		\
362	econvert.o		\
363	fconvert.o		\
364	file_decim.o		\
365	finite.o		\
366	fp_data.o		\
367	func_decim.o		\
368	gconvert.o		\
369	hex_bin.o		\
370	ieee_globals.o		\
371	pack_float.o		\
372	sigfpe.o		\
373	string_decim.o
374
375PORTGEN=			\
376	_env_data.o		\
377	_xftw.o			\
378	a64l.o			\
379	abort.o			\
380	addsev.o		\
381	assert.o		\
382	atof.o			\
383	atoi.o			\
384	atol.o			\
385	atoll.o			\
386	attropen.o		\
387	atexit.o		\
388	atfork.o		\
389	basename.o		\
390	calloc.o		\
391	catgets.o		\
392	catopen.o		\
393	cfgetispeed.o		\
394	cfgetospeed.o		\
395	cfree.o			\
396	cfsetispeed.o		\
397	cfsetospeed.o		\
398	cftime.o		\
399	clock.o			\
400	closedir.o		\
401	closefrom.o		\
402	confstr.o		\
403	crypt.o			\
404	csetlen.o		\
405	ctime.o			\
406	ctime_r.o		\
407	directio.o		\
408	dirname.o		\
409	div.o			\
410	drand48.o		\
411	dup2.o			\
412	env_data.o		\
413	errno.o			\
414	euclen.o		\
415	event_port.o		\
416	execvp.o		\
417	fattach.o		\
418	fdetach.o		\
419	fdopendir.o		\
420	ffs.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