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