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