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