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