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