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