xref: /illumos-gate/usr/src/lib/libc/sparcv9/Makefile.com (revision a92282e44f968185a6bba094d1e5fece2da819cf)
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 2013 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#
32
33LIBCDIR=	$(SRC)/lib/libc
34LIB_PIC=	libc_pic.a
35VERS=		.1
36CPP=		/usr/lib/cpp
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_mag64.o		\
109	fpgetmask.o		\
110	fpgetrnd.o		\
111	fpgetsticky.o		\
112	fpsetmask.o		\
113	fpsetrnd.o		\
114	fpsetsticky.o
115
116$(__GNUC)FPASMOBJS +=		\
117	__quad.o
118
119ATOMICOBJS=			\
120	atomic.o
121
122CHACHAOBJS=			\
123	chacha.o
124
125XATTROBJS=			\
126	xattr_common.o
127
128COMOBJS=			\
129	bcmp.o			\
130	bcopy.o			\
131	bsearch.o		\
132	bzero.o			\
133	explicit_bzero.o	\
134	memccpy.o		\
135	memmem.o		\
136	qsort.o			\
137	strtol.o		\
138	strtoul.o		\
139	strtoll.o		\
140	strtoull.o		\
141	multi3.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	getctxt.o		\
156	lock.o			\
157	makectxt.o		\
158	memchr.o		\
159	memcmp.o		\
160	new_list.o		\
161	setjmp.o		\
162	siginfolst.o		\
163	siglongjmp.o		\
164	smt_pause.o		\
165	sparc_data.o		\
166	strchr.o		\
167	strcmp.o		\
168	strlcpy.o		\
169	strncmp.o		\
170	strncpy.o		\
171	strnlen.o		\
172	swapctxt.o		\
173	sync_instruction_memory.o
174
175# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
176# This macro should ALWAYS be empty; native APIs are already 'large file'.
177COMSYSOBJS64=
178
179SYSOBJS64=
180
181COMSYSOBJS=			\
182	__clock_timer.o		\
183	__getloadavg.o		\
184	__rusagesys.o		\
185	__signotify.o		\
186	__sigrt.o		\
187	__time.o		\
188	_lgrp_home_fast.o	\
189	_lgrpsys.o		\
190	_nfssys.o		\
191	_portfs.o		\
192	_pset.o			\
193	_rpcsys.o		\
194	_sigaction.o		\
195	_so_accept.o		\
196	_so_bind.o		\
197	_so_connect.o		\
198	_so_getpeername.o	\
199	_so_getsockname.o	\
200	_so_getsockopt.o	\
201	_so_listen.o		\
202	_so_recv.o		\
203	_so_recvfrom.o		\
204	_so_recvmsg.o		\
205	_so_send.o		\
206	_so_sendmsg.o		\
207	_so_sendto.o		\
208	_so_setsockopt.o	\
209	_so_shutdown.o		\
210	_so_socket.o		\
211	_so_socketpair.o	\
212	_sockconfig.o		\
213	acct.o			\
214	acl.o			\
215	adjtime.o		\
216	alarm.o			\
217	brk.o			\
218	chdir.o			\
219	chroot.o		\
220	cladm.o			\
221	close.o			\
222	execve.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	memset_s.o		\
495	mkdev.o			\
496	mkdtemp.o		\
497	mkfifo.o		\
498	mkstemp.o		\
499	mktemp.o		\
500	mlock.o			\
501	mlockall.o		\
502	mon.o			\
503	msync.o			\
504	munlock.o		\
505	munlockall.o		\
506	ndbm.o			\
507	nftw.o			\
508	nlspath_checks.o	\
509	nsparse.o		\
510	nss_common.o		\
511	nss_dbdefs.o		\
512	nss_deffinder.o		\
513	opendir.o		\
514	opt_data.o		\
515	perror.o		\
516	pfmt.o			\
517	pfmt_data.o		\
518	pfmt_print.o		\
519	pipe.o			\
520	plock.o			\
521	poll.o			\
522	posix_fadvise.o		\
523	posix_fallocate.o	\
524	posix_madvise.o		\
525	posix_memalign.o	\
526	priocntl.o		\
527	priv_str_xlate.o	\
528	privlib.o		\
529	psecflags.o		\
530	psiginfo.o		\
531	psignal.o		\
532	pt.o			\
533	putpwent.o		\
534	putspent.o		\
535	raise.o			\
536	rand.o			\
537	random.o		\
538	rctlops.o		\
539	readdir.o		\
540	readdir_r.o		\
541	reallocarray.o		\
542	reallocf.o		\
543	recallocarray.o		\
544	realpath.o		\
545	reboot.o		\
546	regexpr.o		\
547	remove.o		\
548	rewinddir.o		\
549	rindex.o		\
550	scandir.o		\
551	seekdir.o		\
552	select.o		\
553	set_constraint_handler_s.o \
554	setlabel.o		\
555	setpriority.o		\
556	settimeofday.o		\
557	sh_locks.o		\
558	sigflag.o		\
559	siglist.o		\
560	sigsend.o		\
561	sigsetops.o		\
562	ssignal.o		\
563	ssp.o			\
564	stack.o			\
565	stpcpy.o		\
566	stpncpy.o		\
567	str2sig.o		\
568	strcase_charmap.o	\
569	strcat.o		\
570	strchrnul.o		\
571	strcspn.o		\
572	strdup.o		\
573	strerror.o		\
574	strlcat.o		\
575	strncat.o		\
576	strndup.o		\
577	strpbrk.o		\
578	strrchr.o		\
579	strsep.o		\
580	strsignal.o		\
581	strspn.o		\
582	strstr.o		\
583	strtod.o		\
584	strtoimax.o		\
585	strtok.o		\
586	strtok_r.o		\
587	strtonum.o		\
588	strtoumax.o		\
589	swab.o			\
590	swapctl.o		\
591	sysconf.o		\
592	syslog.o		\
593	tcdrain.o		\
594	tcflow.o		\
595	tcflush.o		\
596	tcgetattr.o		\
597	tcgetpgrp.o		\
598	tcgetsid.o		\
599	tcsendbreak.o		\
600	tcsetattr.o		\
601	tcsetpgrp.o		\
602	tell.o			\
603	telldir.o		\
604	tfind.o			\
605	time_data.o		\
606	time_gdata.o		\
607	timespec_get.o		\
608	tls_data.o		\
609	truncate.o		\
610	tsdalloc.o		\
611	tsearch.o		\
612	ttyname.o		\
613	ttyslot.o		\
614	ualarm.o		\
615	ucred.o			\
616	valloc.o		\
617	vlfmt.o			\
618	vpfmt.o			\
619	waitpid.o		\
620	walkstack.o		\
621	wdata.o			\
622	xgetwidth.o		\
623	xpg4.o			\
624	xpg6.o
625
626PORTINET=			\
627	inet_lnaof.o		\
628	inet_makeaddr.o		\
629	inet_network.o		\
630	inet_ntoa.o		\
631	inet_ntop.o		\
632	inet_pton.o
633
634PORTPRINT_W=			\
635	doprnt_w.o
636
637PORTPRINT=			\
638	asprintf.o		\
639	doprnt.o		\
640	fprintf.o		\
641	printf.o		\
642	snprintf.o		\
643	sprintf.o		\
644	vfprintf.o		\
645	vprintf.o		\
646	vsnprintf.o		\
647	vsprintf.o		\
648	vwprintf.o		\
649	wprintf.o
650
651# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
652# This macro should ALWAYS be empty; native APIs are already 'large file'.
653PORTSTDIO64=
654
655PORTSTDIO_W=			\
656	doscan_w.o
657
658PORTSTDIO=			\
659	__extensions.o		\
660	_endopen.o		\
661	_filbuf.o		\
662	_findbuf.o		\
663	_flsbuf.o		\
664	_stdio_flags.o		\
665	_wrtchk.o		\
666	clearerr.o		\
667	ctermid.o		\
668	ctermid_r.o		\
669	cuserid.o		\
670	data.o			\
671	doscan.o		\
672	fdopen.o		\
673	feof.o			\
674	ferror.o		\
675	fgetc.o			\
676	fgets.o			\
677	fileno.o		\
678	flockf.o		\
679	flush.o			\
680	fmemopen.o		\
681	fopen.o			\
682	fpos.o			\
683	fputc.o			\
684	fputs.o			\
685	fread.o			\
686	fseek.o			\
687	fseeko.o		\
688	ftell.o			\
689	ftello.o		\
690	fwrite.o		\
691	getc.o			\
692	getchar.o		\
693	getline.o		\
694	getpass.o		\
695	gets.o			\
696	getw.o			\
697	mse.o			\
698	open_memstream.o	\
699	open_wmemstream.o	\
700	popen.o			\
701	putc.o			\
702	putchar.o		\
703	puts.o			\
704	putw.o			\
705	rewind.o		\
706	scanf.o			\
707	setbuf.o		\
708	setbuffer.o		\
709	setvbuf.o		\
710	system.o		\
711	tempnam.o		\
712	tmpfile.o		\
713	tmpnam_r.o		\
714	ungetc.o		\
715	vscanf.o		\
716	vwscanf.o		\
717	wscanf.o
718
719PORTI18N=			\
720	getwchar.o		\
721	putwchar.o		\
722	putws.o			\
723	strtows.o		\
724	wcsnlen.o		\
725	wcstoimax.o		\
726	wcstol.o		\
727	wcstoul.o		\
728	wcswcs.o		\
729	wscat.o			\
730	wschr.o			\
731	wscmp.o			\
732	wscpy.o			\
733	wscspn.o		\
734	wsdup.o			\
735	wslen.o			\
736	wsncat.o		\
737	wsncmp.o		\
738	wsncpy.o		\
739	wspbrk.o		\
740	wsprintf.o		\
741	wsrchr.o		\
742	wsscanf.o		\
743	wsspn.o			\
744	wstod.o			\
745	wstok.o			\
746	wstol.o			\
747	wstoll.o		\
748	wsxfrm.o		\
749	wmemchr.o		\
750	wmemcmp.o		\
751	wmemcpy.o		\
752	wmemmove.o		\
753	wmemset.o		\
754	wcsstr.o		\
755	gettext.o		\
756	gettext_real.o		\
757	gettext_util.o		\
758	gettext_gnu.o		\
759	plural_parser.o		\
760	wdresolve.o		\
761	_ctype.o		\
762	isascii.o		\
763	toascii.o
764
765PORTI18N_COND=			\
766	wcstol_longlong.o	\
767	wcstoul_longlong.o
768
769PORTLOCALE=			\
770	big5.o			\
771	btowc.o			\
772	c16rtomb.o		\
773	c32rtomb.o		\
774	collate.o		\
775	collcmp.o		\
776	euc.o			\
777	fnmatch.o		\
778	fgetwc.o		\
779	fgetws.o		\
780	fix_grouping.o		\
781	fputwc.o		\
782	fputws.o		\
783	fwide.o			\
784	gb18030.o		\
785	gb2312.o		\
786	gbk.o			\
787	getdate.o		\
788	isdigit.o		\
789	iswctype.o		\
790	ldpart.o		\
791	lmessages.o		\
792	lnumeric.o		\
793	lmonetary.o		\
794	localeconv.o		\
795	localeimpl.o		\
796	mbftowc.o		\
797	mblen.o			\
798	mbrlen.o		\
799	mbrtoc16.o		\
800	mbrtoc32.o		\
801	mbrtowc.o		\
802	mbsinit.o		\
803	mbsnrtowcs.o		\
804	mbsrtowcs.o		\
805	mbstowcs.o		\
806	mbtowc.o		\
807	mskanji.o		\
808	nextwctype.o		\
809	nl_langinfo.o		\
810	none.o			\
811	rune.o			\
812	runetype.o		\
813	setlocale.o		\
814	setrunelocale.o		\
815	strcasecmp.o		\
816	strcasestr.o		\
817	strcoll.o		\
818	strfmon.o		\
819	strftime.o		\
820	strncasecmp.o		\
821	strptime.o		\
822	strxfrm.o		\
823	table.o			\
824	timelocal.o		\
825	tolower.o		\
826	towlower.o		\
827	ungetwc.o		\
828	utf8.o			\
829	wcrtomb.o		\
830	wcscasecmp.o		\
831	wcscoll.o		\
832	wcsftime.o		\
833	wcsnrtombs.o		\
834	wcsrtombs.o		\
835	wcstombs.o		\
836	wcswidth.o		\
837	wcsxfrm.o		\
838	wctob.o			\
839	wctomb.o		\
840	wctrans.o		\
841	wctype.o		\
842	wcwidth.o		\
843	wscol.o
844
845AIOOBJS=			\
846	aio.o			\
847	aio_alloc.o		\
848	posix_aio.o
849
850RTOBJS=				\
851	clock_timer.o		\
852	mqueue.o		\
853	pos4obj.o		\
854	sched.o			\
855	sem.o			\
856	shm.o			\
857	sigev_thread.o
858
859SECFLAGSOBJS=			\
860	secflags.o
861
862TPOOLOBJS=			\
863	thread_pool.o
864
865THREADSOBJS=			\
866	alloc.o			\
867	assfail.o		\
868	c11_thr.o		\
869	cancel.o		\
870	door_calls.o		\
871	tmem.o			\
872	pthr_attr.o		\
873	pthr_barrier.o		\
874	pthr_cond.o		\
875	pthr_mutex.o		\
876	pthr_rwlock.o		\
877	pthread.o		\
878	rwlock.o		\
879	scalls.o		\
880	sema.o			\
881	sigaction.o		\
882	spawn.o			\
883	synch.o			\
884	tdb_agent.o		\
885	thr.o			\
886	thread_interface.o	\
887	tls.o			\
888	tsd.o
889
890THREADSMACHOBJS=		\
891	machdep.o
892
893THREADSASMOBJS=			\
894	asm_subr.o
895
896UNICODEOBJS=			\
897	u8_textprep.o		\
898	uconv.o
899
900UNWINDMACHOBJS=			\
901	unwind.o
902
903UNWINDASMOBJS=			\
904	unwind_frame.o
905
906# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
907# This macro should ALWAYS be empty; native APIs are already 'large file'.
908PORTSYS64=
909
910PORTSYS=			\
911	_autofssys.o		\
912	access.o		\
913	acctctl.o		\
914	bsd_signal.o		\
915	chmod.o			\
916	chown.o			\
917	corectl.o		\
918	eventfd.o		\
919	epoll.o			\
920	exacctsys.o		\
921	execl.o			\
922	execle.o		\
923	execv.o			\
924	fcntl.o			\
925	getpagesizes.o		\
926	getpeerucred.o		\
927	inst_sync.o		\
928	issetugid.o		\
929	label.o			\
930	link.o			\
931	lockf.o			\
932	lwp.o			\
933	lwp_cond.o		\
934	lwp_rwlock.o		\
935	lwp_sigmask.o		\
936	meminfosys.o		\
937	mkdir.o			\
938	mknod.o			\
939	msgsys.o		\
940	nfssys.o		\
941	open.o			\
942	pgrpsys.o		\
943	posix_sigwait.o		\
944	ppriv.o			\
945	psetsys.o		\
946	rctlsys.o		\
947	readlink.o		\
948	rename.o		\
949	sbrk.o			\
950	semsys.o		\
951	set_errno.o		\
952	sharefs.o		\
953	shmsys.o		\
954	sidsys.o		\
955	siginterrupt.o		\
956	signal.o		\
957	signalfd.o		\
958	sigpending.o		\
959	sigstack.o		\
960	stat.o			\
961	symlink.o		\
962	tasksys.o		\
963	time.o			\
964	time_util.o		\
965	timerfd.o		\
966	ucontext.o		\
967	unlink.o		\
968	ustat.o			\
969	utimesys.o		\
970	zone.o
971
972PORTREGEX=			\
973	glob.o			\
974	regcmp.o		\
975	regcomp.o		\
976	regerror.o		\
977	regex.o			\
978	regexec.o		\
979	regfree.o		\
980	wordexp.o
981
982VALUES=	values-Xa.o
983
984MOSTOBJS=			\
985	$(STRETS)		\
986	$(CRTOBJS)		\
987	$(DYNOBJS)		\
988	$(FPOBJS)		\
989	$(FPOBJS64)		\
990	$(FPASMOBJS)		\
991	$(ATOMICOBJS)		\
992	$(CHACHAOBJS)		\
993	$(XATTROBJS)		\
994	$(COMOBJS)		\
995	$(GENOBJS)		\
996	$(PRFOBJS)		\
997	$(PORTFP)		\
998	$(PORTGEN)		\
999	$(PORTGEN64)		\
1000	$(PORTI18N)		\
1001	$(PORTI18N_COND)	\
1002	$(PORTINET)		\
1003	$(PORTLOCALE)		\
1004	$(PORTPRINT)		\
1005	$(PORTPRINT_W)		\
1006	$(PORTREGEX)		\
1007	$(PORTSTDIO)		\
1008	$(PORTSTDIO64)		\
1009	$(PORTSTDIO_W)		\
1010	$(PORTSYS)		\
1011	$(PORTSYS64)		\
1012	$(AIOOBJS)		\
1013	$(RTOBJS)		\
1014	$(SECFLAGSOBJS)		\
1015	$(TPOOLOBJS)		\
1016	$(THREADSOBJS)		\
1017	$(THREADSMACHOBJS)	\
1018	$(THREADSASMOBJS)	\
1019	$(UNICODEOBJS)		\
1020	$(UNWINDMACHOBJS)	\
1021	$(UNWINDASMOBJS)	\
1022	$(COMSYSOBJS)		\
1023	$(SYSOBJS)		\
1024	$(COMSYSOBJS64)		\
1025	$(SYSOBJS64)		\
1026	$(VALUES)
1027
1028TRACEOBJS=			\
1029	plockstat.o
1030
1031# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
1032# modules whose source is provided in the $(SRC)/lib/crt directory.
1033# This must be done because otherwise the Sun C compiler would insert
1034# its own versions of these modules and those versions contain code
1035# to call out to C++ initialization functions.  Such C++ initialization
1036# functions can call back into libc before thread initialization is
1037# complete and this leads to segmentation violations and other problems.
1038# Since libc contains no C++ code, linking with the minimal crti.o and
1039# crtn.o modules is safe and avoids the problems described above.
1040OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1041CRTSRCS= ../../crt/sparc
1042
1043# include common library definitions
1044include $(SRC)/lib/Makefile.lib
1045include $(SRC)/lib/Makefile.lib.64
1046
1047# we need to override the default SONAME here because we might
1048# be building a variant object (still libc.so.1, but different filename)
1049SONAME = libc.so.1
1050
1051CFLAGS64 += $(CCVERBOSE)
1052
1053# This is necessary to avoid problems with calling _ex_unwind().
1054# We probably don't want any inlining anyway.
1055CFLAGS64 += -xinline=
1056
1057CERRWARN += -_gcc=-Wno-parentheses
1058CERRWARN += -_gcc=-Wno-switch
1059CERRWARN += $(CNOWARN_UNINIT)
1060CERRWARN += -_gcc=-Wno-unused-value
1061CERRWARN += -_gcc=-Wno-unused-label
1062CERRWARN += -_gcc=-Wno-unused-variable
1063CERRWARN += -_gcc=-Wno-type-limits
1064CERRWARN += -_gcc=-Wno-char-subscripts
1065CERRWARN += -_gcc=-Wno-clobbered
1066CERRWARN += -_gcc=-Wno-unused-function
1067CERRWARN += -_gcc=-Wno-address
1068
1069# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1070# enables ASSERT() checking in the threads portion of the library.
1071# This is automatically enabled for DEBUG builds, not for non-debug builds.
1072THREAD_DEBUG =
1073$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1074
1075# Make string literals read-only to save memory.
1076CFLAGS64 += $(XSTRCONST)
1077
1078ALTPICS= $(TRACEOBJS:%=pics/%)
1079
1080$(DYNLIB) := BUILD.SO = $(LD) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1081
1082MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1083
1084sparcv9_C_PICFLAGS= $(sparcv9_C_BIGPICFLAGS)
1085CFLAGS64 +=	$(EXTN_CFLAGS)
1086CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
1087		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1088ASFLAGS=	$(EXTN_ASFLAGS) $(AS_BIGPICFLAGS) -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
1089		$(sparcv9_AS_XARCH)
1090
1091# As a favor to the dtrace syscall provider, libc still calls the
1092# old syscall traps that have been obsoleted by the *at() interfaces.
1093# Delete this to compile libc using only the new *at() system call traps
1094CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1095
1096# Inform the run-time linker about libc specialized initialization
1097RTLDINFO =	-z rtldinfo=tls_rtldinfo
1098DYNFLAGS +=	$(RTLDINFO)
1099
1100# Force libc's internal references to be resolved immediately upon loading
1101# in order to avoid critical region problems.  Since almost all libc symbols
1102# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1103DYNFLAGS +=	-znow
1104
1105DYNFLAGS +=	$(EXTN_DYNFLAGS)
1106
1107BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1108
1109# Override this top level flag so the compiler builds in its native
1110# C99 mode.  This has been enabled to support the complex arithmetic
1111# added to libc.
1112CSTD=	$(CSTD_GNU99)
1113
1114# libc method of building an archive
1115# The "$(GREP) -v ' L '" part is necessary only until
1116# lorder is fixed to ignore thread-local variables.
1117BUILD.AR= $(RM) $@ ; \
1118	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1119
1120# extra files for the clean target
1121CLEANFILES=			\
1122	$(LIBCDIR)/port/gen/errlst.c	\
1123	$(LIBCDIR)/port/gen/new_list.c	\
1124	assym.h			\
1125	genassym		\
1126	pics/crti.o		\
1127	pics/crtn.o		\
1128	$(ALTPICS)
1129
1130CLOBBERFILES +=	$(LIB_PIC)
1131
1132# conditional assignments
1133$(DYNLIB) := CRTI = crti.o
1134$(DYNLIB) := CRTN = crtn.o
1135
1136# Files which need the threads .il inline template
1137TIL=				\
1138	aio.o			\
1139	alloc.o			\
1140	assfail.o		\
1141	atexit.o		\
1142	atfork.o		\
1143	cancel.o		\
1144	door_calls.o		\
1145	err.o			\
1146	errno.o			\
1147	getctxt.o		\
1148	lwp.o			\
1149	ma.o			\
1150	machdep.o		\
1151	posix_aio.o		\
1152	pthr_attr.o		\
1153	pthr_barrier.o		\
1154	pthr_cond.o		\
1155	pthr_mutex.o		\
1156	pthr_rwlock.o		\
1157	pthread.o		\
1158	rand.o			\
1159	rwlock.o		\
1160	scalls.o		\
1161	sched.o			\
1162	sema.o			\
1163	sigaction.o		\
1164	sigev_thread.o		\
1165	spawn.o			\
1166	stack.o			\
1167	swapctxt.o		\
1168	synch.o			\
1169	tdb_agent.o		\
1170	thr.o			\
1171	thread_interface.o	\
1172	thread_pool.o		\
1173	tls.o			\
1174	tsd.o			\
1175	unwind.o
1176
1177$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1178
1179# Files in fp, port/fp subdirectories that need base.il inline template
1180IL=				\
1181	__flt_decim.o		\
1182	decimal_bin.o
1183
1184$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1185
1186# Files in fp subdirectory which need __quad.il inline template
1187QIL=				\
1188	_Q_add.o		\
1189	_Q_cmp.o		\
1190	_Q_cmpe.o		\
1191	_Q_div.o		\
1192	_Q_dtoq.o		\
1193	_Q_fcc.o		\
1194	_Q_mul.o		\
1195	_Q_qtod.o		\
1196	_Q_qtoi.o		\
1197	_Q_qtos.o		\
1198	_Q_qtou.o		\
1199	_Q_sqrt.o		\
1200	_Q_stoq.o		\
1201	_Q_sub.o		\
1202	_Qp_qtox.o		\
1203	_Qp_qtoux.o
1204
1205$(QIL:%=pics/%) := CFLAGS64 += $(LIBCDIR)/$(MACH)/fp/__quad.il
1206pics/_Qp%.o := CFLAGS64 += -I$(LIBCDIR)/$(MACH)/fp
1207pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1208
1209# Files in crt subdirectory which need muldiv64.il inline template
1210#CIL=	mul64.o divrem64.o
1211#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
1212
1213# large-file-aware components that should be built large
1214
1215#$(COMSYSOBJS64:%=pics/%) := \
1216#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1217
1218#$(SYSOBJS64:%=pics/%) := \
1219#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1220
1221#$(PORTGEN64:%=pics/%) := \
1222#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1223
1224#$(PORTSTDIO64:%=pics/%) := \
1225#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1226
1227#$(PORTSYS64:%=pics/%) := \
1228#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1229
1230$(PORTSTDIO_W:%=pics/%) := \
1231	CPPFLAGS += -D_WIDE
1232
1233$(PORTPRINT_W:%=pics/%) := \
1234	CPPFLAGS += -D_WIDE
1235
1236$(PORTI18N_COND:%=pics/%) := \
1237	CPPFLAGS += -D_WCS_LONGLONG
1238
1239pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1240
1241# Files which need extra optimization
1242pics/getenv.o := sparcv9_COPTFLAG = -xO4
1243
1244#
1245# Disable the stack protector due to issues with bootstrapping rtld. See
1246# cmd/sgs/rtld/Makefile.com for more information.
1247#
1248STACKPROTECT = none
1249
1250.KEEP_STATE:
1251
1252all: $(LIBS) $(LIB_PIC)
1253
1254# object files that depend on inline template
1255$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1256$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1257$(QIL:%=pics/%): $(LIBCDIR)/$(MACH)/fp/__quad.il
1258#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
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/%): crt/stret.s
1274#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1275#	$(POST_PROCESS_S_O)
1276
1277#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1278#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1279#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1280#	$(RM) crt/_rtld.s
1281
1282ASSYMDEP_OBJS=			\
1283	_lwp_mutex_unlock.o	\
1284	_stack_grow.o		\
1285	asm_subr.o		\
1286	setjmp.o		\
1287	smt_pause.o		\
1288	tls_get_addr.o		\
1289	unwind_frame.o		\
1290	vforkx.o
1291
1292$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1293
1294$(ASSYMDEP_OBJS:%=pics/%): assym.h
1295
1296# assym.h build rules
1297
1298assym.h := CFLAGS64 += $(CCGDEBUG)
1299
1300GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1301LDFLAGS.native = $(LDASSERTS) $(ZASSERTDEFLIB)=libc.so $(BDIRECT)
1302
1303genassym: $(GENASSYM_C)
1304	$(NATIVECC) $(NATIVE_CFLAGS) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc \
1305		$(CPPFLAGS.native) $(LDFLAGS.native) -o $@ $(GENASSYM_C)
1306
1307OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1308
1309assym.h: $(OFFSETS) genassym
1310	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1311	./genassym >>$@
1312
1313# derived C source and related explicit dependencies
1314$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1315	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1316
1317pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1318