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