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