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