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