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