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