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