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