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