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