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