xref: /titanic_51/usr/src/lib/libc/i386/Makefile.com (revision d42c7aec1963a7ded6694ac33a5bd96422fc8ca7)
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 2008 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
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	byteorder64.o		\
111	cuexit.o		\
112	ecvt.o			\
113	errlst.o		\
114	i386_data.o		\
115	ladd.o			\
116	ldivide.o		\
117	lmul.o			\
118	lock.o			\
119	lshiftl.o		\
120	lsign.o			\
121	lsub.o			\
122	makectxt.o		\
123	memccpy.o		\
124	memchr.o		\
125	memcmp.o		\
126	memcpy.o		\
127	memset.o		\
128	new_list.o		\
129	setjmp.o		\
130	siginfolst.o		\
131	siglongjmp.o		\
132	strcat.o		\
133	strchr.o		\
134	strcmp.o		\
135	strcpy.o		\
136	strlen.o		\
137	strncat.o		\
138	strncmp.o		\
139	strncpy.o		\
140	strnlen.o		\
141	strrchr.o		\
142	sync_instruction_memory.o
143
144# sysobjs that contain large-file interfaces
145COMSYSOBJS64=			\
146	creat64.o		\
147	fstat64.o		\
148	fstatvfs64.o		\
149	getdents64.o		\
150	getrlimit64.o		\
151	lseek64.o		\
152	lstat64.o		\
153	open64.o		\
154	pread64.o		\
155	pwrite64.o		\
156	setrlimit64.o		\
157	stat64.o		\
158	statvfs64.o
159
160SYSOBJS64=			\
161	mmap64.o
162
163COMSYSOBJS=			\
164	__clock_timer.o		\
165	__getloadavg.o		\
166	__rusagesys.o		\
167	__signotify.o		\
168	__sigrt.o		\
169	__time.o		\
170	_lgrp_home_fast.o	\
171	_lgrpsys.o		\
172	_nfssys.o		\
173	_portfs.o		\
174	_pset.o			\
175	_rpcsys.o		\
176	_sigaction.o		\
177	_so_accept.o		\
178	_so_bind.o		\
179	_so_connect.o		\
180	_so_getpeername.o	\
181	_so_getsockname.o	\
182	_so_getsockopt.o	\
183	_so_listen.o		\
184	_so_recv.o		\
185	_so_recvfrom.o		\
186	_so_recvmsg.o		\
187	_so_send.o		\
188	_so_sendmsg.o		\
189	_so_sendto.o		\
190	_so_setsockopt.o	\
191	_so_shutdown.o		\
192	_so_socket.o		\
193	_so_socketpair.o	\
194	_sockconfig.o		\
195	access.o		\
196	acct.o			\
197	acl.o			\
198	adjtime.o		\
199	alarm.o			\
200	brk.o			\
201	chdir.o			\
202	chmod.o			\
203	chown.o			\
204	chroot.o		\
205	cladm.o			\
206	close.o			\
207	creat.o			\
208	dup.o			\
209	execve.o		\
210	exit.o			\
211	facl.o			\
212	fchdir.o		\
213	fchmod.o		\
214	fchown.o		\
215	fchroot.o		\
216	fcntl.o			\
217	fdsync.o		\
218	fpathconf.o		\
219	fstat.o			\
220	fstatfs.o		\
221	fstatvfs.o		\
222	getcpuid.o		\
223	getdents.o		\
224	getegid.o		\
225	geteuid.o		\
226	getgid.o		\
227	getgroups.o		\
228	gethrtime.o		\
229	getitimer.o		\
230	getmsg.o		\
231	getpid.o		\
232	getpmsg.o		\
233	getppid.o		\
234	getrlimit.o		\
235	getuid.o		\
236	gtty.o			\
237	install_utrap.o		\
238	ioctl.o			\
239	kaio.o			\
240	kill.o			\
241	lchown.o		\
242	link.o			\
243	llseek.o		\
244	lseek.o			\
245	lstat.o			\
246	mmapobjsys.o		\
247	memcntl.o		\
248	mincore.o		\
249	mkdir.o			\
250	mknod.o			\
251	mmap.o			\
252	modctl.o		\
253	mount.o			\
254	mprotect.o		\
255	munmap.o		\
256	nice.o			\
257	ntp_adjtime.o		\
258	ntp_gettime.o		\
259	open.o			\
260	p_online.o		\
261	pathconf.o		\
262	pause.o			\
263	pcsample.o		\
264	pollsys.o		\
265	pread.o			\
266	priocntlset.o		\
267	processor_bind.o	\
268	processor_info.o	\
269	profil.o		\
270	putmsg.o		\
271	putpmsg.o		\
272	pwrite.o		\
273	read.o			\
274	readlink.o		\
275	readv.o			\
276	rename.o		\
277	resolvepath.o		\
278	rmdir.o			\
279	seteguid.o		\
280	setgid.o		\
281	setgroups.o		\
282	setitimer.o		\
283	setreid.o		\
284	setrlimit.o		\
285	setuid.o		\
286	sigaltstk.o		\
287	sigprocmsk.o		\
288	sigsendset.o		\
289	sigsuspend.o		\
290	stat.o			\
291	statfs.o		\
292	statvfs.o		\
293	stty.o			\
294	symlink.o		\
295	sync.o			\
296	sysconfig.o		\
297	sysfs.o			\
298	sysinfo.o		\
299	syslwp.o		\
300	times.o			\
301	ulimit.o		\
302	umask.o			\
303	umount2.o		\
304	unlink.o		\
305	utime.o			\
306	utimes.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	strtoll.o		\
581	strtoull.o		\
582	strtoumax.o		\
583	swab.o			\
584	swapctl.o		\
585	sysconf.o		\
586	syslog.o		\
587	tcdrain.o		\
588	tcflow.o		\
589	tcflush.o		\
590	tcgetattr.o		\
591	tcgetpgrp.o		\
592	tcgetsid.o		\
593	tcsendbreak.o		\
594	tcsetattr.o		\
595	tcsetpgrp.o		\
596	tell.o			\
597	telldir.o		\
598	tfind.o			\
599	time_data.o		\
600	time_gdata.o		\
601	truncate.o		\
602	tsdalloc.o		\
603	tsearch.o		\
604	ttyname.o		\
605	ttyslot.o		\
606	ualarm.o		\
607	ucred.o			\
608	valloc.o		\
609	vlfmt.o			\
610	vpfmt.o			\
611	waitpid.o		\
612	walkstack.o		\
613	wdata.o			\
614	xgetwidth.o		\
615	xpg4.o			\
616	xpg6.o
617
618PORTPRINT_W=			\
619	doprnt_w.o
620
621PORTPRINT=			\
622	doprnt.o		\
623	fprintf.o		\
624	printf.o		\
625	snprintf.o		\
626	sprintf.o		\
627	vfprintf.o		\
628	vprintf.o		\
629	vsnprintf.o		\
630	vsprintf.o		\
631	vwprintf.o		\
632	wprintf.o
633
634# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
635PORTPRINT_C89=			\
636	vfprintf_c89.o		\
637	vprintf_c89.o		\
638	vsnprintf_c89.o		\
639	vsprintf_c89.o		\
640	vwprintf_c89.o
641
642PORTSTDIO_C89=			\
643	vscanf_c89.o		\
644	vwscanf_c89.o		\
645
646# portable stdio objects that contain large file interfaces.
647# Note: fopen64 is a special case, as we build it small.
648PORTSTDIO64=			\
649	fopen64.o		\
650	fpos64.o
651
652PORTSTDIO_W=			\
653	doscan_w.o
654
655PORTSTDIO=			\
656	__extensions.o		\
657	_endopen.o		\
658	_filbuf.o		\
659	_findbuf.o		\
660	_flsbuf.o		\
661	_wrtchk.o		\
662	clearerr.o		\
663	ctermid.o		\
664	ctermid_r.o		\
665	cuserid.o		\
666	data.o			\
667	doscan.o		\
668	fdopen.o		\
669	feof.o			\
670	ferror.o		\
671	fgetc.o			\
672	fgets.o			\
673	fileno.o		\
674	flockf.o		\
675	flush.o			\
676	fopen.o			\
677	fpos.o			\
678	fputc.o			\
679	fputs.o			\
680	fread.o			\
681	fseek.o			\
682	fseeko.o		\
683	ftell.o			\
684	ftello.o		\
685	fwrite.o		\
686	getc.o			\
687	getchar.o		\
688	getpass.o		\
689	gets.o			\
690	getw.o			\
691	mse.o			\
692	popen.o			\
693	putc.o			\
694	putchar.o		\
695	puts.o			\
696	putw.o			\
697	rewind.o		\
698	scanf.o			\
699	setbuf.o		\
700	setbuffer.o		\
701	setvbuf.o		\
702	system.o		\
703	tempnam.o		\
704	tmpfile.o		\
705	tmpnam_r.o		\
706	ungetc.o		\
707	vscanf.o		\
708	vwscanf.o		\
709	wscanf.o
710
711PORTI18N=			\
712	__fgetwc_xpg5.o		\
713	__fgetws_xpg5.o		\
714	__fputwc_xpg5.o		\
715	__fputws_xpg5.o		\
716	__ungetwc_xpg5.o	\
717	getwchar.o		\
718	putwchar.o		\
719	putws.o			\
720	strtows.o		\
721	wcsstr.o		\
722	wcstoimax.o		\
723	wcstol.o		\
724	wcstoul.o		\
725	wcswcs.o		\
726	wmemchr.o		\
727	wmemcmp.o		\
728	wmemcpy.o		\
729	wmemmove.o		\
730	wmemset.o		\
731	wscasecmp.o		\
732	wscat.o			\
733	wschr.o			\
734	wscmp.o			\
735	wscpy.o			\
736	wscspn.o		\
737	wsdup.o			\
738	wslen.o			\
739	wsncasecmp.o		\
740	wsncat.o		\
741	wsncmp.o		\
742	wsncpy.o		\
743	wspbrk.o		\
744	wsprintf.o		\
745	wsrchr.o		\
746	wsscanf.o		\
747	wsspn.o			\
748	wstod.o			\
749	wstok.o			\
750	wstol.o			\
751	wstoll.o		\
752	wsxfrm.o		\
753	gettext.o		\
754	gettext_gnu.o		\
755	gettext_real.o		\
756	gettext_util.o		\
757	plural_parser.o		\
758	wdresolve.o		\
759	_ctype.o		\
760	isascii.o		\
761	toascii.o
762
763PORTI18N_COND=			\
764	wcstol_longlong.o	\
765	wcstoul_longlong.o
766
767AIOOBJS=			\
768	aio.o			\
769	aio_alloc.o		\
770	posix_aio.o
771
772RTOBJS=				\
773	clock_timer.o		\
774	mqueue.o		\
775	pos4obj.o		\
776	sched.o			\
777	sem.o			\
778	shm.o			\
779	sigev_thread.o
780
781TPOOLOBJS=			\
782	thread_pool.o
783
784THREADSOBJS=			\
785	alloc.o			\
786	assfail.o		\
787	cancel.o		\
788	door_calls.o		\
789	pthr_attr.o		\
790	pthr_barrier.o		\
791	pthr_cond.o		\
792	pthr_mutex.o		\
793	pthr_rwlock.o		\
794	pthread.o		\
795	rwlock.o		\
796	scalls.o		\
797	sema.o			\
798	sigaction.o		\
799	spawn.o			\
800	synch.o			\
801	tdb_agent.o		\
802	thr.o			\
803	thread_interface.o	\
804	tls.o			\
805	tsd.o
806
807THREADSMACHOBJS=		\
808	machdep.o
809
810THREADSASMOBJS=			\
811	asm_subr.o
812
813UNICODEOBJS=			\
814	u8_textprep.o		\
815	uconv.o
816
817UNWINDMACHOBJS=			\
818	unwind.o
819
820UNWINDASMOBJS=			\
821	unwind_frame.o
822
823# objects that implement the transitional large file API
824PORTSYS64=			\
825	fstatat64.o		\
826	lockf64.o		\
827	openat64.o
828
829PORTSYS=			\
830	_autofssys.o		\
831	acctctl.o		\
832	bsd_signal.o		\
833	corectl.o		\
834	exacctsys.o		\
835	execl.o			\
836	execle.o		\
837	execv.o			\
838	faccessat.o		\
839	fsmisc.o		\
840	fstatat.o		\
841	getpagesizes.o		\
842	getpeerucred.o		\
843	inst_sync.o		\
844	issetugid.o		\
845	label.o			\
846	libc_fcntl.o		\
847	libc_link.o		\
848	libc_open.o		\
849	lockf.o			\
850	lwp.o			\
851	lwp_cond.o		\
852	lwp_rwlock.o		\
853	lwp_sigmask.o		\
854	meminfosys.o		\
855	msgsys.o		\
856	nfssys.o		\
857	openat.o		\
858	pgrpsys.o		\
859	posix_sigwait.o		\
860	ppriv.o			\
861	psetsys.o		\
862	rctlsys.o		\
863	sbrk.o			\
864	semsys.o		\
865	set_errno.o		\
866	sharefs.o		\
867	shmsys.o		\
868	sidsys.o		\
869	siginterrupt.o		\
870	signal.o		\
871	sigpending.o		\
872	sigstack.o		\
873	tasksys.o		\
874	time.o			\
875	time_util.o		\
876	ucontext.o		\
877	ustat.o			\
878	zone.o
879
880PORTREGEX=			\
881	glob.o			\
882	regcmp.o		\
883	regex.o			\
884	wordexp.o
885
886MOSTOBJS=			\
887	$(STRETS)		\
888	$(CRTOBJS)		\
889	$(DYNOBJS)		\
890	$(FPOBJS)		\
891	$(FPASMOBJS)		\
892	$(ATOMICOBJS)		\
893	$(XATTROBJS)		\
894	$(COMOBJS)		\
895	$(DTRACEOBJS)		\
896	$(GENOBJS)		\
897	$(PORTFP)		\
898	$(PORTGEN)		\
899	$(PORTGEN64)		\
900	$(PORTI18N)		\
901	$(PORTI18N_COND)	\
902	$(PORTPRINT)		\
903	$(PORTPRINT_C89)	\
904	$(PORTPRINT_W)		\
905	$(PORTREGEX)		\
906	$(PORTSTDIO)		\
907	$(PORTSTDIO64)		\
908	$(PORTSTDIO_C89)	\
909	$(PORTSTDIO_W)		\
910	$(PORTSYS)		\
911	$(PORTSYS64)		\
912	$(AIOOBJS)		\
913	$(RTOBJS)		\
914	$(TPOOLOBJS)		\
915	$(THREADSOBJS)		\
916	$(THREADSMACHOBJS)	\
917	$(THREADSASMOBJS)	\
918	$(UNICODEOBJS)		\
919	$(UNWINDMACHOBJS)	\
920	$(UNWINDASMOBJS)	\
921	$(COMSYSOBJS)		\
922	$(SYSOBJS)		\
923	$(COMSYSOBJS64)		\
924	$(SYSOBJS64)		\
925	$(VALUES)
926
927TRACEOBJS=			\
928	plockstat.o
929
930# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
931# modules whose source is provided in the $(SRC)/lib/common directory.
932# This must be done because otherwise the Sun C compiler would insert
933# its own versions of these modules and those versions contain code
934# to call out to C++ initialization functions.  Such C++ initialization
935# functions can call back into libc before thread initialization is
936# complete and this leads to segmentation violations and other problems.
937# Since libc contains no C++ code, linking with the minimal crti.o and
938# crtn.o modules is safe and avoids the problems described above.
939OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
940CRTSRCS= ../../common/i386
941
942LDPASS_OFF=	$(POUND_SIGN)
943
944# include common library definitions
945include ../../Makefile.lib
946
947# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
948# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
949# need to be compatible with the ones for the libc stuff.  Whenever the changes
950# that affect the compilation conditions of libc happened, those for libc_i18n
951# also need to be updated.
952
953# we need to override the default SONAME here because we might
954# be building a variant object (still libc.so.1, but different filename)
955SONAME = libc.so.1
956
957CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
958
959# This is necessary to avoid problems with calling _ex_unwind().
960# We probably don't want any inlining anyway.
961XINLINE = -xinline=
962CFLAGS += $(XINLINE)
963
964# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
965# enables ASSERT() checking in the threads portion of the library.
966# This is automatically enabled for DEBUG builds, not for non-debug builds.
967THREAD_DEBUG =
968$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
969
970# Make string literals read-only to save memory.
971CFLAGS += $(XSTRCONST)
972
973ALTPICS= $(TRACEOBJS:%=pics/%)
974
975$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
976$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(LDLIBS)
977
978MAPFILES =	../port/mapfile-vers ../i386/mapfile-vers
979
980#
981# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
982#
983CFLAGS +=	$(EXTN_CFLAGS)
984CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
985		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
986ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
987
988# Conditionally add support for making |wordexp()| check whether
989# /usr/bin/ksh is ksh93 or not
990include ../../../Makefile.ksh93switch
991CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
992
993# Inform the run-time linker about libc specialized initialization
994RTLDINFO =	-z rtldinfo=tls_rtldinfo
995DYNFLAGS +=	$(RTLDINFO)
996
997DYNFLAGS +=	-e __rtboot
998DYNFLAGS +=	$(EXTN_DYNFLAGS)
999
1000# Inform the kernel about the initial DTrace area (in case
1001# libc is being used as the interpreter / runtime linker).
1002DTRACE_DATA =	-zdtrace=dtrace_data
1003DYNFLAGS +=	$(DTRACE_DATA)
1004
1005# DTrace needs an executable data segment.
1006MAPFILE.NED=
1007
1008BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1009
1010# Override this top level flag so the compiler builds in its native
1011# C99 mode.  This has been enabled to support the complex arithmetic
1012# added to libc.
1013C99MODE=	$(C99_ENABLE)
1014
1015# libc method of building an archive
1016BUILD.AR= $(RM) $@ ; \
1017	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
1018
1019# extra files for the clean target
1020CLEANFILES=			\
1021	../port/gen/errlst.c	\
1022	../port/gen/new_list.c	\
1023	assym.h			\
1024	genassym		\
1025	crt/_rtld.s		\
1026	crt/_rtbootld.s		\
1027	pics/_rtbootld.o	\
1028	pics/crti.o		\
1029	pics/crtn.o		\
1030	$(ALTPICS)
1031
1032CLOBBERFILES +=	$(LIB_PIC)
1033
1034# list of C source for lint
1035SRCS=							\
1036	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1037	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1038	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1039	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1040	$(PORTFP:%.o=../port/fp/%.c)			\
1041	$(PORTGEN:%.o=../port/gen/%.c)			\
1042	$(PORTI18N:%.o=../port/i18n/%.c)		\
1043	$(PORTPRINT:%.o=../port/print/%.c)		\
1044	$(PORTREGEX:%.o=../port/regex/%.c)		\
1045	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1046	$(PORTSYS:%.o=../port/sys/%.c)			\
1047	$(AIOOBJS:%.o=../port/aio/%.c)			\
1048	$(RTOBJS:%.o=../port/rt/%.c)			\
1049	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
1050	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1051	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1052	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1053	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1054	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1055	$(LIBCBASE)/gen/ecvt.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) := CRTI = crti.o
1066$(DYNLIB) := CRTN = crtn.o
1067
1068# Files which need the threads .il inline template
1069TIL=				\
1070	aio.o			\
1071	alloc.o			\
1072	assfail.o		\
1073	atexit.o		\
1074	atfork.o		\
1075	cancel.o		\
1076	door_calls.o		\
1077	errno.o			\
1078	lwp.o			\
1079	ma.o			\
1080	machdep.o		\
1081	posix_aio.o		\
1082	pthr_attr.o		\
1083	pthr_barrier.o		\
1084	pthr_cond.o		\
1085	pthr_mutex.o		\
1086	pthr_rwlock.o		\
1087	pthread.o		\
1088	rand.o			\
1089	rwlock.o		\
1090	scalls.o		\
1091	sched.o			\
1092	sema.o			\
1093	sigaction.o		\
1094	sigev_thread.o		\
1095	spawn.o			\
1096	stack.o			\
1097	synch.o			\
1098	tdb_agent.o		\
1099	thr.o			\
1100	thread_interface.o	\
1101	thread_pool.o		\
1102	tls.o			\
1103	tsd.o			\
1104	unwind.o
1105
1106THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1107$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1108
1109# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1110
1111# large-file-aware components that should be built large
1112
1113$(COMSYSOBJS64:%=pics/%) := \
1114	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1115
1116$(SYSOBJS64:%=pics/%) := \
1117	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1118
1119$(PORTGEN64:%=pics/%) := \
1120	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1121
1122$(PORTSTDIO64:%=pics/%) := \
1123	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1124
1125$(PORTSYS64:%=pics/%) := \
1126	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1127
1128$(PORTSTDIO_W:%=pics/%) := \
1129	CPPFLAGS += -D_WIDE
1130
1131$(PORTPRINT_W:%=pics/%) := \
1132	CPPFLAGS += -D_WIDE
1133
1134$(PORTPRINT_C89:%=pics/%) := \
1135	CPPFLAGS += -D_C89_INTMAX32
1136
1137$(PORTSTDIO_C89:%=pics/%) := \
1138	CPPFLAGS += -D_C89_INTMAX32
1139
1140$(PORTI18N_COND:%=pics/%) := \
1141	CPPFLAGS += -D_WCS_LONGLONG
1142
1143.KEEP_STATE:
1144
1145all: $(LIBS) $(LIB_PIC)
1146
1147lint	:=	CPPFLAGS += -I../$(MACH)/fp
1148lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1149lint	:=	LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1150
1151lint:
1152	@echo $(LINT.c) ...
1153	@$(LINT.c) $(SRCS) $(LDLIBS)
1154
1155$(LINTLIB):= SRCS=../port/llib-lc
1156$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1157$(LINTLIB):= LINTFLAGS=-nvx
1158
1159# object files that depend on inline template
1160$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1161# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1162
1163# include common libc targets
1164include ../Makefile.targ
1165
1166# We need to strip out all CTF and DOF data from the static library
1167$(LIB_PIC) := DIR = pics
1168$(LIB_PIC): pics $$(PICS)
1169	$(BUILD.AR)
1170	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1171	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1172	$(AR) -ts $@ > /dev/null
1173	$(POST_PROCESS_A)
1174
1175$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1176	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
1177	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1178	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1179	$(RM) $(LIBCBASE)/crt/_rtld.s
1180
1181# partially built from C source
1182pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1183	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1184	$(CTFCONVERT_O)
1185
1186ASSYMDEP_OBJS=			\
1187	_lwp_mutex_unlock.o	\
1188	_stack_grow.o		\
1189	getcontext.o		\
1190	tls_get_addr.o		\
1191	vforkx.o
1192
1193$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1194
1195$(ASSYMDEP_OBJS:%=pics/%): assym.h
1196
1197# assym.h build rules
1198
1199GENASSYM_C = ../$(MACH)/genassym.c
1200
1201# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1202#	live in Makefile.master
1203
1204CPPFLAGS.genassym = \
1205	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1206
1207genassym: $(GENASSYM_C)
1208	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc	\
1209		-D__EXTENSIONS__ $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1210
1211OFFSETS = ../$(MACH)/offsets.in
1212
1213assym.h: $(OFFSETS) genassym
1214	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1215	./genassym >>$@
1216
1217# derived C source and related explicit dependencies
1218../port/gen/errlst.c + \
1219../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1220	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1221
1222pics/errlst.o: ../port/gen/errlst.c
1223
1224pics/new_list.o: ../port/gen/new_list.c
1225