xref: /titanic_41/usr/src/lib/libc/i386/Makefile.com (revision ae5b046d8f8cec187d40041c4b74b43f561d5ac7)
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	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	memcntl.o		\
247	mincore.o		\
248	mkdir.o			\
249	mknod.o			\
250	mmap.o			\
251	modctl.o		\
252	mount.o			\
253	mprotect.o		\
254	munmap.o		\
255	nice.o			\
256	ntp_adjtime.o		\
257	ntp_gettime.o		\
258	open.o			\
259	p_online.o		\
260	pathconf.o		\
261	pause.o			\
262	pcsample.o		\
263	pollsys.o		\
264	pread.o			\
265	priocntlset.o		\
266	processor_bind.o	\
267	processor_info.o	\
268	profil.o		\
269	putmsg.o		\
270	putpmsg.o		\
271	pwrite.o		\
272	read.o			\
273	readlink.o		\
274	readv.o			\
275	rename.o		\
276	resolvepath.o		\
277	rmdir.o			\
278	seteguid.o		\
279	setgid.o		\
280	setgroups.o		\
281	setitimer.o		\
282	setreid.o		\
283	setrlimit.o		\
284	setuid.o		\
285	sigaltstk.o		\
286	sigprocmsk.o		\
287	sigsendset.o		\
288	sigsuspend.o		\
289	stat.o			\
290	statfs.o		\
291	statvfs.o		\
292	stty.o			\
293	symlink.o		\
294	sync.o			\
295	sysconfig.o		\
296	sysfs.o			\
297	sysinfo.o		\
298	syslwp.o		\
299	times.o			\
300	ulimit.o		\
301	umask.o			\
302	umount2.o		\
303	unlink.o		\
304	utime.o			\
305	utimes.o		\
306	utssys.o		\
307	uucopy.o		\
308	vhangup.o		\
309	waitid.o		\
310	write.o			\
311	writev.o		\
312	yield.o
313
314SYSOBJS=			\
315	__clock_gettime.o	\
316	__getcontext.o		\
317	__uadmin.o		\
318	_lwp_mutex_unlock.o	\
319	_stack_grow.o		\
320	door.o			\
321	forkx.o			\
322	forkallx.o		\
323	fxstat.o		\
324	getcontext.o		\
325	gettimeofday.o		\
326	lwp_private.o		\
327	lxstat.o		\
328	nuname.o		\
329	pipe.o			\
330	ptrace.o		\
331	syscall.o		\
332	sysi86.o		\
333	tls_get_addr.o		\
334	uadmin.o		\
335	umount.o		\
336	uname.o			\
337	vforkx.o		\
338	xmknod.o		\
339	xstat.o
340
341# objects under ../port which contain transitional large file interfaces
342PORTGEN64=			\
343	_xftw64.o		\
344	attropen64.o		\
345	ftw64.o			\
346	mkstemp64.o		\
347	nftw64.o		\
348	tell64.o		\
349	truncate64.o
350
351# objects from source under ../port
352PORTFP=				\
353	__flt_decim.o		\
354	__flt_rounds.o		\
355	__tbl_10_b.o		\
356	__tbl_10_h.o		\
357	__tbl_10_s.o		\
358	__tbl_2_b.o		\
359	__tbl_2_h.o		\
360	__tbl_2_s.o		\
361	__tbl_fdq.o		\
362	__tbl_tens.o		\
363	__x_power.o		\
364	_base_sup.o		\
365	aconvert.o		\
366	decimal_bin.o		\
367	double_decim.o		\
368	econvert.o		\
369	fconvert.o		\
370	file_decim.o		\
371	finite.o		\
372	fp_data.o		\
373	func_decim.o		\
374	gconvert.o		\
375	hex_bin.o		\
376	ieee_globals.o		\
377	pack_float.o		\
378	sigfpe.o		\
379	string_decim.o
380
381PORTGEN=			\
382	_env_data.o		\
383	_xftw.o			\
384	a64l.o			\
385	abort.o			\
386	addsev.o		\
387	assert.o		\
388	atof.o			\
389	atoi.o			\
390	atol.o			\
391	atoll.o			\
392	attrat.o		\
393	attropen.o		\
394	atexit.o		\
395	atfork.o		\
396	basename.o		\
397	calloc.o		\
398	catgets.o		\
399	catopen.o		\
400	cfgetispeed.o		\
401	cfgetospeed.o		\
402	cfree.o			\
403	cfsetispeed.o		\
404	cfsetospeed.o		\
405	cftime.o		\
406	clock.o			\
407	closedir.o		\
408	closefrom.o		\
409	confstr.o		\
410	crypt.o			\
411	csetlen.o		\
412	ctime.o			\
413	ctime_r.o		\
414	deflt.o			\
415	directio.o		\
416	dirname.o		\
417	div.o			\
418	drand48.o		\
419	dup2.o			\
420	env_data.o		\
421	err.o			\
422	errno.o			\
423	euclen.o		\
424	event_port.o		\
425	execvp.o		\
426	fattach.o		\
427	fdetach.o		\
428	fdopendir.o		\
429	fmtmsg.o		\
430	ftime.o			\
431	ftok.o			\
432	ftw.o			\
433	gcvt.o			\
434	getauxv.o		\
435	getcwd.o		\
436	getdate_err.o		\
437	getdtblsize.o		\
438	getenv.o		\
439	getexecname.o		\
440	getgrnam.o		\
441	getgrnam_r.o		\
442	gethostid.o		\
443	gethostname.o		\
444	gethz.o			\
445	getisax.o		\
446	getloadavg.o		\
447	getlogin.o		\
448	getmntent.o		\
449	getnetgrent.o		\
450	getopt.o		\
451	getopt_long.o		\
452	getpagesize.o		\
453	getpw.o			\
454	getpwnam.o		\
455	getpwnam_r.o		\
456	getrusage.o		\
457	getspent.o		\
458	getspent_r.o		\
459	getsubopt.o		\
460	gettxt.o		\
461	getusershell.o		\
462	getut.o			\
463	getutx.o		\
464	getvfsent.o		\
465	getwd.o			\
466	getwidth.o		\
467	getxby_door.o		\
468	gtxt.o			\
469	hsearch.o		\
470	iconv.o			\
471	imaxabs.o		\
472	imaxdiv.o		\
473	index.o			\
474	initgroups.o		\
475	insque.o		\
476	isaexec.o		\
477	isastream.o		\
478	isatty.o		\
479	killpg.o		\
480	klpdlib.o		\
481	l64a.o			\
482	lckpwdf.o		\
483	lconstants.o		\
484	lexp10.o		\
485	lfind.o			\
486	lfmt.o			\
487	lfmt_log.o		\
488	llabs.o			\
489	lldiv.o			\
490	llog10.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	rwlock.o		\
791	scalls.o		\
792	sema.o			\
793	sigaction.o		\
794	spawn.o			\
795	synch.o			\
796	tdb_agent.o		\
797	thr.o			\
798	thread_interface.o	\
799	tls.o			\
800	tsd.o
801
802THREADSMACHOBJS=		\
803	machdep.o
804
805THREADSASMOBJS=			\
806	asm_subr.o
807
808UNICODEOBJS=			\
809	u8_textprep.o		\
810	uconv.o
811
812UNWINDMACHOBJS=			\
813	unwind.o
814
815UNWINDASMOBJS=			\
816	unwind_frame.o
817
818# objects that implement the transitional large file API
819PORTSYS64=			\
820	fstatat64.o		\
821	lockf64.o		\
822	openat64.o
823
824PORTSYS=			\
825	_autofssys.o		\
826	acctctl.o		\
827	bsd_signal.o		\
828	corectl.o		\
829	exacctsys.o		\
830	execl.o			\
831	execle.o		\
832	execv.o			\
833	faccessat.o		\
834	fsmisc.o		\
835	fstatat.o		\
836	getpagesizes.o		\
837	getpeerucred.o		\
838	inst_sync.o		\
839	issetugid.o		\
840	label.o			\
841	libc_fcntl.o		\
842	libc_link.o		\
843	libc_open.o		\
844	lockf.o			\
845	lwp.o			\
846	lwp_cond.o		\
847	lwp_rwlock.o		\
848	lwp_sigmask.o		\
849	meminfosys.o		\
850	msgsys.o		\
851	nfssys.o		\
852	openat.o		\
853	pgrpsys.o		\
854	posix_sigwait.o		\
855	ppriv.o			\
856	psetsys.o		\
857	rctlsys.o		\
858	sbrk.o			\
859	semsys.o		\
860	set_errno.o		\
861	sharefs.o		\
862	shmsys.o		\
863	sidsys.o		\
864	siginterrupt.o		\
865	signal.o		\
866	sigpending.o		\
867	sigstack.o		\
868	tasksys.o		\
869	time.o			\
870	time_util.o		\
871	ucontext.o		\
872	ustat.o			\
873	zone.o
874
875PORTREGEX=			\
876	glob.o			\
877	regcmp.o		\
878	regex.o			\
879	wordexp.o
880
881MOSTOBJS=			\
882	$(STRETS)		\
883	$(CRTOBJS)		\
884	$(DYNOBJS)		\
885	$(FPOBJS)		\
886	$(FPASMOBJS)		\
887	$(ATOMICOBJS)		\
888	$(XATTROBJS)		\
889	$(COMOBJS)		\
890	$(DTRACEOBJS)		\
891	$(GENOBJS)		\
892	$(PORTFP)		\
893	$(PORTGEN)		\
894	$(PORTGEN64)		\
895	$(PORTI18N)		\
896	$(PORTI18N_COND)	\
897	$(PORTPRINT)		\
898	$(PORTPRINT_C89)	\
899	$(PORTPRINT_W)		\
900	$(PORTREGEX)		\
901	$(PORTSTDIO)		\
902	$(PORTSTDIO64)		\
903	$(PORTSTDIO_C89)	\
904	$(PORTSTDIO_W)		\
905	$(PORTSYS)		\
906	$(PORTSYS64)		\
907	$(AIOOBJS)		\
908	$(RTOBJS)		\
909	$(TPOOLOBJS)		\
910	$(THREADSOBJS)		\
911	$(THREADSMACHOBJS)	\
912	$(THREADSASMOBJS)	\
913	$(UNICODEOBJS)		\
914	$(UNWINDMACHOBJS)	\
915	$(UNWINDASMOBJS)	\
916	$(COMSYSOBJS)		\
917	$(SYSOBJS)		\
918	$(COMSYSOBJS64)		\
919	$(SYSOBJS64)		\
920	$(VALUES)
921
922TRACEOBJS=			\
923	plockstat.o
924
925# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
926# modules whose source is provided in the $(SRC)/lib/common directory.
927# This must be done because otherwise the Sun C compiler would insert
928# its own versions of these modules and those versions contain code
929# to call out to C++ initialization functions.  Such C++ initialization
930# functions can call back into libc before thread initialization is
931# complete and this leads to segmentation violations and other problems.
932# Since libc contains no C++ code, linking with the minimal crti.o and
933# crtn.o modules is safe and avoids the problems described above.
934OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
935CRTSRCS= ../../common/i386
936
937LDPASS_OFF=	$(POUND_SIGN)
938
939# include common library definitions
940include ../../Makefile.lib
941
942# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
943# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
944# need to be compatible with the ones for the libc stuff.  Whenever the changes
945# that affect the compilation conditions of libc happened, those for libc_i18n
946# also need to be updated.
947
948# we need to override the default SONAME here because we might
949# be building a variant object (still libc.so.1, but different filename)
950SONAME = libc.so.1
951
952CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
953
954# This is necessary to avoid problems with calling _ex_unwind().
955# We probably don't want any inlining anyway.
956XINLINE = -xinline=
957CFLAGS += $(XINLINE)
958
959# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
960# enables ASSERT() checking in the threads portion of the library.
961# This is automatically enabled for DEBUG builds, not for non-debug builds.
962THREAD_DEBUG =
963$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
964
965ALTPICS= $(TRACEOBJS:%=pics/%)
966
967$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
968$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(LDLIBS)
969
970MAPFILES =	../port/mapfile-vers ../i386/mapfile-vers
971
972#
973# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
974#
975CFLAGS +=	$(EXTN_CFLAGS)
976CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
977		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
978ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
979
980# Conditionally add support for making |wordexp()| check whether
981# /usr/bin/ksh is ksh93 or not
982include ../../../Makefile.ksh93switch
983CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
984
985# Inform the run-time linker about libc specialized initialization
986RTLDINFO =	-z rtldinfo=tls_rtldinfo
987DYNFLAGS +=	$(RTLDINFO)
988
989DYNFLAGS +=	-e __rtboot
990DYNFLAGS +=	$(EXTN_DYNFLAGS)
991
992# Inform the kernel about the initial DTrace area (in case
993# libc is being used as the interpreter / runtime linker).
994DTRACE_DATA =	-zdtrace=dtrace_data
995DYNFLAGS +=	$(DTRACE_DATA)
996
997# DTrace needs an executable data segment.
998MAPFILE.NED=
999
1000BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1001
1002# Override this top level flag so the compiler builds in its native
1003# C99 mode.  This has been enabled to support the complex arithmetic
1004# added to libc.
1005C99MODE=	$(C99_ENABLE)
1006
1007# libc method of building an archive
1008BUILD.AR= $(RM) $@ ; \
1009	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
1010
1011# extra files for the clean target
1012CLEANFILES=			\
1013	../port/gen/errlst.c	\
1014	../port/gen/new_list.c	\
1015	assym.h			\
1016	genassym		\
1017	crt/_rtld.s		\
1018	crt/_rtbootld.s		\
1019	pics/_rtbootld.o	\
1020	pics/crti.o		\
1021	pics/crtn.o		\
1022	$(ALTPICS)
1023
1024CLOBBERFILES +=	$(LIB_PIC)
1025
1026# list of C source for lint
1027SRCS=							\
1028	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1029	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1030	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1031	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1032	$(PORTFP:%.o=../port/fp/%.c)			\
1033	$(PORTGEN:%.o=../port/gen/%.c)			\
1034	$(PORTI18N:%.o=../port/i18n/%.c)		\
1035	$(PORTPRINT:%.o=../port/print/%.c)		\
1036	$(PORTREGEX:%.o=../port/regex/%.c)		\
1037	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1038	$(PORTSYS:%.o=../port/sys/%.c)			\
1039	$(AIOOBJS:%.o=../port/aio/%.c)			\
1040	$(RTOBJS:%.o=../port/rt/%.c)			\
1041	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
1042	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1043	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1044	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1045	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1046	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1047	$(LIBCBASE)/gen/ecvt.c				\
1048	$(LIBCBASE)/gen/makectxt.c			\
1049	$(LIBCBASE)/gen/siginfolst.c			\
1050	$(LIBCBASE)/gen/siglongjmp.c			\
1051	$(LIBCBASE)/gen/strcmp.c			\
1052	$(LIBCBASE)/gen/sync_instruction_memory.c	\
1053	$(LIBCBASE)/sys/ptrace.c			\
1054	$(LIBCBASE)/sys/uadmin.c
1055
1056# conditional assignments
1057$(DYNLIB) := CRTI = crti.o
1058$(DYNLIB) := CRTN = crtn.o
1059
1060# Files which need the threads .il inline template
1061TIL=				\
1062	aio.o			\
1063	alloc.o			\
1064	assfail.o		\
1065	atexit.o		\
1066	atfork.o		\
1067	cancel.o		\
1068	door_calls.o		\
1069	errno.o			\
1070	lwp.o			\
1071	ma.o			\
1072	machdep.o		\
1073	posix_aio.o		\
1074	pthr_attr.o		\
1075	pthr_barrier.o		\
1076	pthr_cond.o		\
1077	pthr_mutex.o		\
1078	pthr_rwlock.o		\
1079	pthread.o		\
1080	rand.o			\
1081	rwlock.o		\
1082	scalls.o		\
1083	sched.o			\
1084	sema.o			\
1085	sigaction.o		\
1086	sigev_thread.o		\
1087	spawn.o			\
1088	stack.o			\
1089	synch.o			\
1090	tdb_agent.o		\
1091	thr.o			\
1092	thread_interface.o	\
1093	thread_pool.o		\
1094	tls.o			\
1095	tsd.o			\
1096	unwind.o
1097
1098THREADS_INLINES = $(LIBCBASE)/threads/i386.il
1099$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
1100
1101# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
1102
1103# large-file-aware components that should be built large
1104
1105$(COMSYSOBJS64:%=pics/%) := \
1106	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1107
1108$(SYSOBJS64:%=pics/%) := \
1109	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1110
1111$(PORTGEN64:%=pics/%) := \
1112	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1113
1114$(PORTSTDIO64:%=pics/%) := \
1115	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1116
1117$(PORTSYS64:%=pics/%) := \
1118	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1119
1120$(PORTSTDIO_W:%=pics/%) := \
1121	CPPFLAGS += -D_WIDE
1122
1123$(PORTPRINT_W:%=pics/%) := \
1124	CPPFLAGS += -D_WIDE
1125
1126$(PORTPRINT_C89:%=pics/%) := \
1127	CPPFLAGS += -D_C89_INTMAX32
1128
1129$(PORTSTDIO_C89:%=pics/%) := \
1130	CPPFLAGS += -D_C89_INTMAX32
1131
1132$(PORTI18N_COND:%=pics/%) := \
1133	CPPFLAGS += -D_WCS_LONGLONG
1134
1135.KEEP_STATE:
1136
1137all: $(LIBS) $(LIB_PIC)
1138
1139lint	:=	CPPFLAGS += -I../$(MACH)/fp
1140lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1141lint	:=	LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1142
1143lint:
1144	@echo $(LINT.c) ...
1145	@$(LINT.c) $(SRCS) $(LDLIBS)
1146
1147$(LINTLIB):= SRCS=../port/llib-lc
1148$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1149$(LINTLIB):= LINTFLAGS=-nvx
1150
1151# object files that depend on inline template
1152$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
1153# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
1154
1155# include common libc targets
1156include ../Makefile.targ
1157
1158# We need to strip out all CTF and DOF data from the static library
1159$(LIB_PIC) := DIR = pics
1160$(LIB_PIC): pics $$(PICS)
1161	$(BUILD.AR)
1162	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1163	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1164	$(AR) -ts $@ > /dev/null
1165	$(POST_PROCESS_A)
1166
1167$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1168	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
1169	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1170	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1171	$(RM) $(LIBCBASE)/crt/_rtld.s
1172
1173# partially built from C source
1174pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1175	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1176	$(CTFCONVERT_O)
1177
1178ASSYMDEP_OBJS=			\
1179	_lwp_mutex_unlock.o	\
1180	_stack_grow.o		\
1181	getcontext.o		\
1182	tls_get_addr.o		\
1183	vforkx.o
1184
1185$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1186
1187$(ASSYMDEP_OBJS:%=pics/%): assym.h
1188
1189# assym.h build rules
1190
1191GENASSYM_C = ../$(MACH)/genassym.c
1192
1193# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1194#	live in Makefile.master
1195
1196CPPFLAGS.genassym = \
1197	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1198
1199genassym: $(GENASSYM_C)
1200	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc	\
1201		-D__EXTENSIONS__ $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1202
1203OFFSETS = ../$(MACH)/offsets.in
1204
1205assym.h: $(OFFSETS) genassym
1206	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1207	./genassym >>$@
1208
1209# derived C source and related explicit dependencies
1210../port/gen/errlst.c + \
1211../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1212	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1213
1214pics/errlst.o: ../port/gen/errlst.c
1215
1216pics/new_list.o: ../port/gen/new_list.c
1217