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