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