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