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