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