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