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