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