xref: /titanic_51/usr/src/lib/libc/sparcv9/Makefile.com (revision ea332022e7c483fdcb7faa8a9e99fcd1de849721)
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	tls_data.o		\
594	truncate.o		\
595	tsdalloc.o		\
596	tsearch.o		\
597	ttyname.o		\
598	ttyslot.o		\
599	ualarm.o		\
600	ucred.o			\
601	valloc.o		\
602	vlfmt.o			\
603	vpfmt.o			\
604	waitpid.o		\
605	walkstack.o		\
606	wdata.o			\
607	xgetwidth.o		\
608	xpg4.o			\
609	xpg6.o
610
611PORTPRINT_W=			\
612	doprnt_w.o
613
614PORTPRINT=			\
615	asprintf.o		\
616	doprnt.o		\
617	fprintf.o		\
618	printf.o		\
619	snprintf.o		\
620	sprintf.o		\
621	vfprintf.o		\
622	vprintf.o		\
623	vsnprintf.o		\
624	vsprintf.o		\
625	vwprintf.o		\
626	wprintf.o
627
628# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
629# This macro should ALWAYS be empty; native APIs are already 'large file'.
630PORTSTDIO64=
631
632PORTSTDIO_W=			\
633	doscan_w.o
634
635PORTSTDIO=			\
636	__extensions.o		\
637	_endopen.o		\
638	_filbuf.o		\
639	_findbuf.o		\
640	_flsbuf.o		\
641	_wrtchk.o		\
642	clearerr.o		\
643	ctermid.o		\
644	ctermid_r.o		\
645	cuserid.o		\
646	data.o			\
647	doscan.o		\
648	fdopen.o		\
649	feof.o			\
650	ferror.o		\
651	fgetc.o			\
652	fgets.o			\
653	fileno.o		\
654	flockf.o		\
655	flush.o			\
656	fopen.o			\
657	fpos.o			\
658	fputc.o			\
659	fputs.o			\
660	fread.o			\
661	fseek.o			\
662	fseeko.o		\
663	ftell.o			\
664	ftello.o		\
665	fwrite.o		\
666	getc.o			\
667	getchar.o		\
668	getline.o		\
669	getpass.o		\
670	gets.o			\
671	getw.o			\
672	popen.o			\
673	putc.o			\
674	putchar.o		\
675	puts.o			\
676	putw.o			\
677	rewind.o		\
678	scanf.o			\
679	setbuf.o		\
680	setbuffer.o		\
681	setvbuf.o		\
682	system.o		\
683	tempnam.o		\
684	tmpfile.o		\
685	tmpnam_r.o		\
686	ungetc.o		\
687	mse.o			\
688	vscanf.o		\
689	vwscanf.o		\
690	wscanf.o
691
692PORTI18N=			\
693	getwchar.o		\
694	putwchar.o		\
695	putws.o			\
696	strtows.o		\
697	wcsnlen.o		\
698	wcstoimax.o		\
699	wcstol.o		\
700	wcstoul.o		\
701	wcswcs.o		\
702	wscat.o			\
703	wschr.o			\
704	wscmp.o			\
705	wscpy.o			\
706	wscspn.o		\
707	wsdup.o			\
708	wslen.o			\
709	wsncat.o		\
710	wsncmp.o		\
711	wsncpy.o		\
712	wspbrk.o		\
713	wsprintf.o		\
714	wsrchr.o		\
715	wsscanf.o		\
716	wsspn.o			\
717	wstod.o			\
718	wstok.o			\
719	wstol.o			\
720	wstoll.o		\
721	wsxfrm.o		\
722	wmemchr.o		\
723	wmemcmp.o		\
724	wmemcpy.o		\
725	wmemmove.o		\
726	wmemset.o		\
727	wcsstr.o		\
728	gettext.o		\
729	gettext_real.o		\
730	gettext_util.o		\
731	gettext_gnu.o		\
732	plural_parser.o		\
733	wdresolve.o		\
734	_ctype.o		\
735	isascii.o		\
736	toascii.o
737
738PORTI18N_COND=			\
739	wcstol_longlong.o	\
740	wcstoul_longlong.o
741
742PORTLOCALE=			\
743	big5.o			\
744	btowc.o			\
745	collate.o		\
746	collcmp.o		\
747	euc.o			\
748	fnmatch.o		\
749	fgetwc.o		\
750	fgetws.o		\
751	fix_grouping.o		\
752	fputwc.o		\
753	fputws.o		\
754	fwide.o			\
755	gb18030.o		\
756	gb2312.o		\
757	gbk.o			\
758	getdate.o		\
759	isdigit.o		\
760	iswctype.o		\
761	ldpart.o		\
762	lmessages.o		\
763	lnumeric.o		\
764	lmonetary.o		\
765	localeconv.o		\
766	localeimpl.o		\
767	mbftowc.o		\
768	mblen.o			\
769	mbrlen.o		\
770	mbrtowc.o		\
771	mbsinit.o		\
772	mbsnrtowcs.o		\
773	mbsrtowcs.o		\
774	mbstowcs.o		\
775	mbtowc.o		\
776	mskanji.o		\
777	nextwctype.o		\
778	nl_langinfo.o		\
779	none.o			\
780	regcomp.o		\
781	regfree.o		\
782	regerror.o		\
783	regexec.o		\
784	rune.o			\
785	runetype.o		\
786	setlocale.o		\
787	setrunelocale.o		\
788	strcasecmp.o		\
789	strcasestr.o		\
790	strcoll.o		\
791	strfmon.o		\
792	strftime.o		\
793	strncasecmp.o		\
794	strptime.o		\
795	strxfrm.o		\
796	table.o			\
797	timelocal.o		\
798	tolower.o		\
799	towlower.o		\
800	ungetwc.o		\
801	utf8.o			\
802	wcrtomb.o		\
803	wcscasecmp.o		\
804	wcscoll.o		\
805	wcsftime.o		\
806	wcsnrtombs.o		\
807	wcsrtombs.o		\
808	wcstombs.o		\
809	wcswidth.o		\
810	wcsxfrm.o		\
811	wctob.o			\
812	wctomb.o		\
813	wctrans.o		\
814	wctype.o		\
815	wcwidth.o		\
816	wscol.o
817
818AIOOBJS=			\
819	aio.o			\
820	aio_alloc.o		\
821	posix_aio.o
822
823RTOBJS=				\
824	clock_timer.o		\
825	mqueue.o		\
826	pos4obj.o		\
827	sched.o			\
828	sem.o			\
829	shm.o			\
830	sigev_thread.o
831
832TPOOLOBJS=			\
833	thread_pool.o
834
835THREADSOBJS=			\
836	alloc.o			\
837	assfail.o		\
838	cancel.o		\
839	door_calls.o		\
840	tmem.o			\
841	pthr_attr.o		\
842	pthr_barrier.o		\
843	pthr_cond.o		\
844	pthr_mutex.o		\
845	pthr_rwlock.o		\
846	pthread.o		\
847	rwlock.o		\
848	scalls.o		\
849	sema.o			\
850	sigaction.o		\
851	spawn.o			\
852	synch.o			\
853	tdb_agent.o		\
854	thr.o			\
855	thread_interface.o	\
856	tls.o			\
857	tsd.o
858
859THREADSMACHOBJS=		\
860	machdep.o
861
862THREADSASMOBJS=			\
863	asm_subr.o
864
865UNICODEOBJS=			\
866	u8_textprep.o		\
867	uconv.o
868
869UNWINDMACHOBJS=			\
870	unwind.o
871
872UNWINDASMOBJS=			\
873	unwind_frame.o
874
875# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
876# This macro should ALWAYS be empty; native APIs are already 'large file'.
877PORTSYS64=
878
879PORTSYS=			\
880	_autofssys.o		\
881	access.o		\
882	acctctl.o		\
883	bsd_signal.o		\
884	chmod.o			\
885	chown.o			\
886	corectl.o		\
887	eventfd.o		\
888	epoll.o			\
889	exacctsys.o		\
890	execl.o			\
891	execle.o		\
892	execv.o			\
893	fcntl.o			\
894	getpagesizes.o		\
895	getpeerucred.o		\
896	inst_sync.o		\
897	issetugid.o		\
898	label.o			\
899	link.o			\
900	lockf.o			\
901	lwp.o			\
902	lwp_cond.o		\
903	lwp_rwlock.o		\
904	lwp_sigmask.o		\
905	meminfosys.o		\
906	mkdir.o			\
907	mknod.o			\
908	msgsys.o		\
909	nfssys.o		\
910	open.o			\
911	pgrpsys.o		\
912	posix_sigwait.o		\
913	ppriv.o			\
914	psetsys.o		\
915	rctlsys.o		\
916	readlink.o		\
917	rename.o		\
918	sbrk.o			\
919	semsys.o		\
920	set_errno.o		\
921	sharefs.o		\
922	shmsys.o		\
923	sidsys.o		\
924	siginterrupt.o		\
925	signal.o		\
926	signalfd.o		\
927	sigpending.o		\
928	sigstack.o		\
929	stat.o			\
930	symlink.o		\
931	tasksys.o		\
932	time.o			\
933	time_util.o		\
934	timerfd.o		\
935	ucontext.o		\
936	unlink.o		\
937	ustat.o			\
938	utimesys.o		\
939	zone.o
940
941PORTREGEX=			\
942	glob.o			\
943	regcmp.o		\
944	regex.o			\
945	wordexp.o
946
947VALUES=	values-Xa.o
948
949MOSTOBJS=			\
950	$(STRETS)		\
951	$(CRTOBJS)		\
952	$(DYNOBJS)		\
953	$(FPOBJS)		\
954	$(FPOBJS64)		\
955	$(FPASMOBJS)		\
956	$(ATOMICOBJS)		\
957	$(CHACHAOBJS)		\
958	$(XATTROBJS)		\
959	$(COMOBJS)		\
960	$(GENOBJS)		\
961	$(PRFOBJS)		\
962	$(PORTFP)		\
963	$(PORTGEN)		\
964	$(PORTGEN64)		\
965	$(PORTI18N)		\
966	$(PORTI18N_COND)	\
967	$(PORTLOCALE)		\
968	$(PORTPRINT)		\
969	$(PORTPRINT_W)		\
970	$(PORTREGEX)		\
971	$(PORTSTDIO)		\
972	$(PORTSTDIO64)		\
973	$(PORTSTDIO_W)		\
974	$(PORTSYS)		\
975	$(PORTSYS64)		\
976	$(AIOOBJS)		\
977	$(RTOBJS)		\
978	$(TPOOLOBJS)		\
979	$(THREADSOBJS)		\
980	$(THREADSMACHOBJS)	\
981	$(THREADSASMOBJS)	\
982	$(UNICODEOBJS)		\
983	$(UNWINDMACHOBJS)	\
984	$(UNWINDASMOBJS)	\
985	$(COMSYSOBJS)		\
986	$(SYSOBJS)		\
987	$(COMSYSOBJS64)		\
988	$(SYSOBJS64)		\
989	$(VALUES)
990
991TRACEOBJS=			\
992	plockstat.o
993
994# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
995# modules whose source is provided in the $(SRC)/lib/common directory.
996# This must be done because otherwise the Sun C compiler would insert
997# its own versions of these modules and those versions contain code
998# to call out to C++ initialization functions.  Such C++ initialization
999# functions can call back into libc before thread initialization is
1000# complete and this leads to segmentation violations and other problems.
1001# Since libc contains no C++ code, linking with the minimal crti.o and
1002# crtn.o modules is safe and avoids the problems described above.
1003OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1004CRTSRCS= ../../common/sparcv9
1005
1006# include common library definitions
1007include $(SRC)/lib/Makefile.lib
1008include $(SRC)/lib/Makefile.lib.64
1009
1010# we need to override the default SONAME here because we might
1011# be building a variant object (still libc.so.1, but different filename)
1012SONAME = libc.so.1
1013
1014CFLAGS64 += $(CCVERBOSE)
1015
1016# This is necessary to avoid problems with calling _ex_unwind().
1017# We probably don't want any inlining anyway.
1018CFLAGS64 += -xinline=
1019
1020CERRWARN += -_gcc=-Wno-parentheses
1021CERRWARN += -_gcc=-Wno-switch
1022CERRWARN += -_gcc=-Wno-uninitialized
1023CERRWARN += -_gcc=-Wno-unused-value
1024CERRWARN += -_gcc=-Wno-unused-label
1025CERRWARN += -_gcc=-Wno-unused-variable
1026CERRWARN += -_gcc=-Wno-type-limits
1027CERRWARN += -_gcc=-Wno-char-subscripts
1028CERRWARN += -_gcc=-Wno-clobbered
1029CERRWARN += -_gcc=-Wno-unused-function
1030CERRWARN += -_gcc=-Wno-address
1031
1032# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1033# enables ASSERT() checking in the threads portion of the library.
1034# This is automatically enabled for DEBUG builds, not for non-debug builds.
1035THREAD_DEBUG =
1036$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1037
1038# Make string literals read-only to save memory.
1039CFLAGS64 += $(XSTRCONST)
1040
1041ALTPICS= $(TRACEOBJS:%=pics/%)
1042
1043$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1044
1045MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1046
1047sparcv9_C_PICFLAGS= -K PIC
1048CFLAGS64 +=	$(EXTN_CFLAGS)
1049CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
1050		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1051ASFLAGS=	$(EXTN_ASFLAGS) -K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
1052		$(sparcv9_AS_XARCH)
1053
1054# As a favor to the dtrace syscall provider, libc still calls the
1055# old syscall traps that have been obsoleted by the *at() interfaces.
1056# Delete this to compile libc using only the new *at() system call traps
1057CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1058
1059# Inform the run-time linker about libc specialized initialization
1060RTLDINFO =	-z rtldinfo=tls_rtldinfo
1061DYNFLAGS +=	$(RTLDINFO)
1062
1063# Force libc's internal references to be resolved immediately upon loading
1064# in order to avoid critical region problems.  Since almost all libc symbols
1065# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1066DYNFLAGS +=	-znow
1067
1068DYNFLAGS +=	$(EXTN_DYNFLAGS)
1069
1070BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1071
1072# Override this top level flag so the compiler builds in its native
1073# C99 mode.  This has been enabled to support the complex arithmetic
1074# added to libc.
1075C99MODE=	$(C99_ENABLE)
1076
1077# libc method of building an archive
1078# The "$(GREP) -v ' L '" part is necessary only until
1079# lorder is fixed to ignore thread-local variables.
1080BUILD.AR= $(RM) $@ ; \
1081	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1082
1083# extra files for the clean target
1084CLEANFILES=			\
1085	$(LIBCDIR)/port/gen/errlst.c	\
1086	$(LIBCDIR)/port/gen/new_list.c	\
1087	assym.h			\
1088	genassym		\
1089	pics/crti.o		\
1090	pics/crtn.o		\
1091	$(ALTPICS)
1092
1093CLOBBERFILES +=	$(LIB_PIC)
1094
1095# list of C source for lint
1096SRCS=							\
1097	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1098	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1099	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1100	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
1101	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
1102	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
1103	$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)		\
1104	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
1105	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
1106	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
1107	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
1108	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
1109	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
1110	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
1111	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1112	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
1113	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1114	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
1115	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
1116	$(FPOBJS64:%.o=$(LIBCBASE)/fp/%.c)		\
1117	$(LIBCBASE)/crt/_ftou.c				\
1118	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1119	$(LIBCBASE)/gen/byteorder.c			\
1120	$(LIBCBASE)/gen/endian.c			\
1121	$(LIBCBASE)/gen/ecvt.c				\
1122	$(LIBCBASE)/gen/getctxt.c			\
1123	$(LIBCBASE)/gen/makectxt.c			\
1124	$(LIBCBASE)/gen/siginfolst.c			\
1125	$(LIBCBASE)/gen/siglongjmp.c			\
1126	$(LIBCBASE)/gen/swapctxt.c
1127
1128# conditional assignments
1129$(DYNLIB) := CRTI = crti.o
1130$(DYNLIB) := CRTN = crtn.o
1131
1132# Files which need the threads .il inline template
1133TIL=				\
1134	aio.o			\
1135	alloc.o			\
1136	assfail.o		\
1137	atexit.o		\
1138	atfork.o		\
1139	cancel.o		\
1140	door_calls.o		\
1141	err.o			\
1142	errno.o			\
1143	getctxt.o		\
1144	lwp.o			\
1145	ma.o			\
1146	machdep.o		\
1147	posix_aio.o		\
1148	pthr_attr.o		\
1149	pthr_barrier.o		\
1150	pthr_cond.o		\
1151	pthr_mutex.o		\
1152	pthr_rwlock.o		\
1153	pthread.o		\
1154	rand.o			\
1155	rwlock.o		\
1156	scalls.o		\
1157	sched.o			\
1158	sema.o			\
1159	sigaction.o		\
1160	sigev_thread.o		\
1161	spawn.o			\
1162	stack.o			\
1163	swapctxt.o		\
1164	synch.o			\
1165	tdb_agent.o		\
1166	thr.o			\
1167	thread_interface.o	\
1168	thread_pool.o		\
1169	tls.o			\
1170	tsd.o			\
1171	unwind.o
1172
1173$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1174
1175# Files in fp, port/fp subdirectories that need base.il inline template
1176IL=				\
1177	__flt_decim.o		\
1178	decimal_bin.o
1179
1180$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1181
1182# Files in fp subdirectory which need __quad.il inline template
1183QIL=				\
1184	_Q_add.o		\
1185	_Q_cmp.o		\
1186	_Q_cmpe.o		\
1187	_Q_div.o		\
1188	_Q_dtoq.o		\
1189	_Q_fcc.o		\
1190	_Q_mul.o		\
1191	_Q_qtod.o		\
1192	_Q_qtoi.o		\
1193	_Q_qtos.o		\
1194	_Q_qtou.o		\
1195	_Q_sqrt.o		\
1196	_Q_stoq.o		\
1197	_Q_sub.o		\
1198	_Qp_qtox.o		\
1199	_Qp_qtoux.o
1200
1201$(QIL:%=pics/%) := CFLAGS64 += $(LIBCDIR)/$(MACH)/fp/__quad.il
1202pics/_Qp%.o := CFLAGS64 += -I$(LIBCDIR)/$(MACH)/fp
1203pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1204
1205# Files in crt subdirectory which need muldiv64.il inline template
1206#CIL=	mul64.o divrem64.o
1207#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
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#$(PORTSTDIO64:%=pics/%) := \
1221#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1222
1223#$(PORTSYS64:%=pics/%) := \
1224#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1225
1226$(PORTSTDIO_W:%=pics/%) := \
1227	CPPFLAGS += -D_WIDE
1228
1229$(PORTPRINT_W:%=pics/%) := \
1230	CPPFLAGS += -D_WIDE
1231
1232$(PORTI18N_COND:%=pics/%) := \
1233	CPPFLAGS += -D_WCS_LONGLONG
1234
1235pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1236
1237# Files which need extra optimization
1238pics/getenv.o := sparcv9_COPTFLAG = -xO4
1239
1240.KEEP_STATE:
1241
1242all: $(LIBS) $(LIB_PIC)
1243
1244lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1245lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1246lint	:=	LINTFLAGS64 += -mn
1247
1248lint:
1249	@echo $(LINT.c) ... $(LDLIBS)
1250	@$(LINT.c) $(SRCS) $(LDLIBS)
1251
1252$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1253$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1254$(LINTLIB):= LINTFLAGS64=-nvx -m64
1255
1256# object files that depend on inline template
1257$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1258$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1259$(QIL:%=pics/%): $(LIBCDIR)/$(MACH)/fp/__quad.il
1260#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
1261
1262# include common libc targets
1263include $(LIBCDIR)/Makefile.targ
1264
1265# We need to strip out all CTF and DOF data from the static library
1266$(LIB_PIC) := DIR = pics
1267$(LIB_PIC): pics $$(PICS)
1268	$(BUILD.AR)
1269	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1270	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1271	$(AR) -ts $@ > /dev/null
1272	$(POST_PROCESS_A)
1273
1274# special cases
1275#$(STRETS:%=pics/%): crt/stret.s
1276#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1277#	$(POST_PROCESS_O)
1278
1279#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1280#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1281#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1282#	$(RM) crt/_rtld.s
1283
1284ASSYMDEP_OBJS=			\
1285	_lwp_mutex_unlock.o	\
1286	_stack_grow.o		\
1287	asm_subr.o		\
1288	setjmp.o		\
1289	smt_pause.o		\
1290	tls_get_addr.o		\
1291	unwind_frame.o		\
1292	vforkx.o
1293
1294$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1295
1296$(ASSYMDEP_OBJS:%=pics/%): assym.h
1297
1298# assym.h build rules
1299
1300assym.h := CFLAGS64 += -g
1301
1302GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1303
1304genassym: $(GENASSYM_C)
1305	$(NATIVECC) $(NATIVE_CFLAGS) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc \
1306		$(CPPFLAGS.native) -o $@ $(GENASSYM_C)
1307
1308OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1309
1310assym.h: $(OFFSETS) genassym
1311	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1312	./genassym >>$@
1313
1314# derived C source and related explicit dependencies
1315$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1316	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1317
1318pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1319