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