xref: /titanic_50/usr/src/lib/libc/sparc/Makefile (revision 1d53067866b073ea6710000ba4dd448441361988)
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	shmsys.o		\
881	siginterrupt.o		\
882	signal.o		\
883	sigpending.o		\
884	sigstack.o		\
885	tasksys.o		\
886	time.o			\
887	time_util.o		\
888	ucontext.o		\
889	ustat.o			\
890	zone.o
891
892PORTREGEX=			\
893	glob.o			\
894	regcmp.o		\
895	regex.o			\
896	wordexp.o
897
898VALUES=	values-Xa.o
899
900MOSTOBJS=			\
901	$(STRETS)		\
902	$(CRTOBJS)		\
903	$(DYNOBJS)		\
904	$(FPOBJS)		\
905	$(FPASMOBJS)		\
906	$(ATOMICOBJS)		\
907	$(COMOBJS)		\
908	$(DTRACEOBJS)		\
909	$(GENOBJS)		\
910	$(PORTFP)		\
911	$(PORTGEN)		\
912	$(PORTGEN64)		\
913	$(PORTI18N)		\
914	$(PORTI18N_COND)	\
915	$(PORTPRINT)		\
916	$(PORTPRINT_C89)	\
917	$(PORTPRINT_W)		\
918	$(PORTREGEX)		\
919	$(PORTSTDIO)		\
920	$(PORTSTDIO64)		\
921	$(PORTSTDIO_C89)	\
922	$(PORTSTDIO_W)		\
923	$(PORTSYS)		\
924	$(PORTSYS64)		\
925	$(AIOOBJS)		\
926	$(RTOBJS)		\
927	$(TPOOLOBJS)		\
928	$(THREADSOBJS)		\
929	$(THREADSMACHOBJS)	\
930	$(THREADSASMOBJS)	\
931	$(UNWINDMACHOBJS)	\
932	$(UNWINDASMOBJS)	\
933	$(COMSYSOBJS)		\
934	$(SYSOBJS)		\
935	$(COMSYSOBJS64)		\
936	$(SYSOBJS64)		\
937	$(VALUES)
938
939TRACEOBJS=			\
940	plockstat.o
941
942# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
943# modules whose source is provided in the $(SRC)/lib/common directory.
944# This must be done because otherwise the Sun C compiler would insert
945# its own versions of these modules and those versions contain code
946# to call out to C++ initialization functions.  Such C++ initialization
947# functions can call back into libc before thread initialization is
948# complete and this leads to segmentation violations and other problems.
949# Since libc contains no C++ code, linking with the minimal crti.o and
950# crtn.o modules is safe and avoids the problems described above.
951OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
952CRTSRCS= ../../common/sparc
953
954# include common library definitions
955include ../../Makefile.lib
956
957# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
958# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
959# need to be compatible with the ones for the libc stuff.  Whenever the changes
960# that affect the compilation conditions of libc happened, those for libc_i18n
961# also need to be updated.
962
963CFLAGS += $(CCVERBOSE)
964
965# This is necessary to avoid problems with calling _ex_unwind().
966# We probably don't want any inlining anyway.
967CFLAGS += -xinline=
968
969# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
970# enables ASSERT() checking in the threads portion of the library.
971# This is automatically enabled for DEBUG builds, not for non-debug builds.
972THREAD_DEBUG =
973$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
974
975CFLAGS += $(THREAD_DEBUG)
976
977ALTPICS= $(TRACEOBJS:%=pics/%)
978
979$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
980$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
981
982MAPFILES =	../port/mapfile-vers mapfile-vers
983
984CFLAGS +=	$(EXTN_CFLAGS)
985CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) \
986		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
987ASFLAGS=	-K pic -P -D__STDC__ -D_ASM $(CPPFLAGS) $(sparc_AS_XARCH)
988
989# Inform the run-time linker about libc specialized initialization
990RTLDINFO =	-z rtldinfo=tls_rtldinfo
991DYNFLAGS +=	$(RTLDINFO)
992
993DYNFLAGS +=	-e __rtboot
994DYNFLAGS +=	$(EXTN_DYNFLAGS)
995
996# Inform the kernel about the initial DTrace area (in case
997# libc is being used as the interpreter / runtime linker).
998DTRACE_DATA =	-zdtrace=dtrace_data
999DYNFLAGS +=	$(DTRACE_DATA)
1000
1001# DTrace needs an executable data segment.
1002NX_MAP=
1003
1004BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1005
1006# Override this top level flag so the compiler builds in its native
1007# C99 mode.  This has been enabled to support the complex arithmetic
1008# added to libc.
1009C99MODE=	$(C99_ENABLE)
1010
1011# libc method of building an archive
1012BUILD.AR= $(RM) $@ ; \
1013	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
1014
1015# extra files for the clean target
1016CLEANFILES=			\
1017	../port/gen/errlst.c	\
1018	../port/gen/new_list.c	\
1019	assym.h			\
1020	genassym		\
1021	crt/_rtld.s		\
1022	crt/_rtbootld.s		\
1023	pics/_rtbootld.o	\
1024	pics/crti.o		\
1025	pics/crtn.o		\
1026	$(ALTPICS)
1027
1028CLOBBERFILES +=	$(LIB_PIC)
1029
1030# list of C source for lint
1031SRCS=							\
1032	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1033	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1034	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1035	$(PORTFP:%.o=../port/fp/%.c)			\
1036	$(PORTGEN:%.o=../port/gen/%.c)			\
1037	$(PORTI18N:%.o=../port/i18n/%.c)		\
1038	$(PORTPRINT:%.o=../port/print/%.c)		\
1039	$(PORTREGEX:%.o=../port/regex/%.c)		\
1040	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1041	$(PORTSYS:%.o=../port/sys/%.c)			\
1042	$(AIOOBJS:%.o=../port/aio/%.c)			\
1043	$(RTOBJS:%.o=../port/rt/%.c)			\
1044	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
1045	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1046	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1047	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1048	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1049	$(LIBCBASE)/crt/_ftou.c				\
1050	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1051	$(LIBCBASE)/gen/ecvt.c				\
1052	$(LIBCBASE)/gen/getctxt.c			\
1053	$(LIBCBASE)/gen/lexp10.c			\
1054	$(LIBCBASE)/gen/llog10.c			\
1055	$(LIBCBASE)/gen/lmul.c				\
1056	$(LIBCBASE)/gen/makectxt.c			\
1057	$(LIBCBASE)/gen/siginfolst.c			\
1058	$(LIBCBASE)/gen/siglongjmp.c			\
1059	$(LIBCBASE)/gen/swapctxt.c			\
1060	$(LIBCBASE)/sys/ptrace.c
1061
1062# conditional assignments
1063$(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1064$(DYNLIB) := CRTI = crti.o
1065$(DYNLIB) := CRTN = crtn.o
1066
1067# Files which need the threads .il inline template
1068TIL=				\
1069	aio.o			\
1070	alloc.o			\
1071	assfail.o		\
1072	atexit.o		\
1073	atfork.o		\
1074	cancel.o		\
1075	door_calls.o		\
1076	errno.o			\
1077	getctxt.o		\
1078	lwp.o			\
1079	ma.o			\
1080	machdep.o		\
1081	posix_aio.o		\
1082	pthr_attr.o		\
1083	pthr_barrier.o		\
1084	pthr_cond.o		\
1085	pthr_mutex.o		\
1086	pthr_rwlock.o		\
1087	pthread.o		\
1088	rand.o			\
1089	rtsched.o		\
1090	rwlock.o		\
1091	scalls.o		\
1092	sema.o			\
1093	sigaction.o		\
1094	sigev_thread.o		\
1095	spawn.o			\
1096	stack.o			\
1097	swapctxt.o		\
1098	synch.o			\
1099	tdb_agent.o		\
1100	thr.o			\
1101	thread_interface.o	\
1102	thread_pool.o		\
1103	tls.o			\
1104	tsd.o			\
1105	unwind.o
1106
1107$(TIL:%=pics/%) := CFLAGS += $(LIBCBASE)/threads/sparc.il
1108
1109# special kludge for inlines with 'cas':
1110pics/synch.o pics/lwp.o := sparc_CFLAGS += -_gcc=-Wa,-xarch=v8plus
1111
1112# Files in port/fp subdirectory that need base.il inline template
1113IL=				\
1114	__flt_decim.o		\
1115	decimal_bin.o
1116
1117$(IL:%=pics/%) := CFLAGS += $(LIBCBASE)/fp/base.il
1118
1119# Files in fp subdirectory which need __quad.il inline template
1120QIL=				\
1121	_Q_add.o		\
1122	_Q_cmp.o		\
1123	_Q_cmpe.o		\
1124	_Q_div.o		\
1125	_Q_dtoq.o		\
1126	_Q_fcc.o		\
1127	_Q_mul.o		\
1128	_Q_qtod.o		\
1129	_Q_qtoi.o		\
1130	_Q_qtos.o		\
1131	_Q_qtou.o		\
1132	_Q_sqrt.o		\
1133	_Q_stoq.o		\
1134	_Q_sub.o
1135
1136$(QIL:%=pics/%) := CFLAGS += ../$(MACH)/fp/__quad.il
1137pics/_Q%.o := sparc_COPTFLAG = -xO4 -dalign
1138pics/__quad%.o := sparc_COPTFLAG = -xO4 -dalign
1139
1140# large-file-aware components that should be built large
1141
1142$(COMSYSOBJS64:%=pics/%) := \
1143	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1144
1145$(SYSOBJS64:%=pics/%) := \
1146	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1147
1148$(PORTGEN64:%=pics/%) := \
1149	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1150
1151$(PORTSTDIO64:%=pics/%) := \
1152	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1153
1154$(PORTSYS64:%=pics/%) := \
1155	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1156
1157$(PORTSTDIO_W:%=pics/%) := \
1158	CPPFLAGS += -D_WIDE
1159
1160$(PORTPRINT_W:%=pics/%) := \
1161	CPPFLAGS += -D_WIDE
1162
1163# printf/scanf functions to support c89-sized intmax_t variables
1164$(PORTPRINT_C89:%=pics/%) := \
1165	CPPFLAGS += -D_C89_INTMAX32
1166
1167$(PORTSTDIO_C89:%=pics/%) := \
1168	CPPFLAGS += -D_C89_INTMAX32
1169
1170$(PORTI18N_COND:%=pics/%) := \
1171	CPPFLAGS += -D_WCS_LONGLONG
1172
1173# Files which need extra optimization
1174pics/getenv.o := sparc_COPTFLAG = -xO4
1175
1176.KEEP_STATE:
1177
1178all: $(LIBS) $(LIB_PIC)
1179
1180lint	:=	CPPFLAGS += -I../$(MACH)/fp
1181lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1182lint	:=	LINTFLAGS += -mn
1183
1184lint:
1185	@echo $(LINT.c) ... $(LDLIBS)
1186	@$(LINT.c) $(SRCS) $(LDLIBS)
1187
1188$(LINTLIB):= SRCS=../port/llib-lc
1189$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1190$(LINTLIB):= LINTFLAGS=-nvx
1191
1192# object files that depend on inline template
1193$(TIL:%=pics/%): $(LIBCBASE)/threads/sparc.il
1194$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1195$(QIL:%=pics/%): ../$(MACH)/fp/__quad.il
1196
1197# include common libc targets
1198include ../Makefile.targ
1199
1200# We need to strip out all CTF and DOF data from the static library
1201$(LIB_PIC) := DIR = pics
1202$(LIB_PIC): pics $$(PICS)
1203	$(BUILD.AR)
1204	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1205	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1206	$(AR) -ts $@ > /dev/null
1207	$(POST_PROCESS_A)
1208
1209# special cases
1210$(STRETS:%=pics/%): crt/stret.s
1211	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1212	$(POST_PROCESS_O)
1213
1214crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1215	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S -K pic \
1216	    crt/_rtld.c -o crt/_rtld.s
1217	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1218	$(RM) crt/_rtld.s
1219
1220# partially built from C source
1221pics/_rtbootld.o: crt/_rtbootld.s
1222	$(AS) $(ASFLAGS) crt/_rtbootld.s -o $@
1223	$(CTFCONVERT_O)
1224
1225ASSYMDEP_OBJS=			\
1226	_lwp_mutex_unlock.o	\
1227	_stack_grow.o		\
1228	asm_subr.o		\
1229	tls_get_addr.o		\
1230	unwind_frame.o		\
1231	vforkx.o
1232
1233$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1234
1235$(ASSYMDEP_OBJS:%=pics/%): assym.h
1236
1237# assym.h build rules
1238
1239GENASSYM_C = ../$(MACH)/genassym.c
1240
1241# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1242#	live in Makefile.master
1243
1244CPPFLAGS.genassym = \
1245	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1246
1247genassym: $(GENASSYM_C)
1248	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc \
1249		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1250
1251OFFSETS = ../$(MACH)/offsets.in
1252
1253assym.h: $(OFFSETS) genassym
1254	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1255	./genassym >>$@
1256
1257# derived C source and related explicit dependencies
1258../port/gen/errlst.c + \
1259../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1260	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1261
1262pics/errlst.o: ../port/gen/errlst.c
1263
1264pics/new_list.o: ../port/gen/new_list.c
1265