xref: /titanic_41/usr/src/lib/libc/sparc/Makefile.com (revision ce0bfb39c0479ba97372eb0e5bf2ef4275d0876e)
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	__uadmin.o		\
333	door.o			\
334	forkx.o			\
335	forkallx.o		\
336	gettimeofday.o		\
337	pipe.o			\
338	ptrace.o		\
339	syscall.o		\
340	tls_get_addr.o		\
341	uadmin.o		\
342	umount.o		\
343	uname.o			\
344	vforkx.o
345
346# objects under $(LIBCDIR)/port which contain transitional large file interfaces
347PORTGEN64=			\
348	_xftw64.o		\
349	attropen64.o		\
350	ftw64.o			\
351	mkstemp64.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	mon.o			\
526	msync.o			\
527	munlock.o		\
528	munlockall.o		\
529	ndbm.o			\
530	nftw.o			\
531	nlspath_checks.o	\
532	nsparse.o		\
533	nss_common.o		\
534	nss_dbdefs.o		\
535	nss_deffinder.o		\
536	opendir.o		\
537	opt_data.o		\
538	perror.o		\
539	pfmt.o			\
540	pfmt_data.o		\
541	pfmt_print.o		\
542	plock.o			\
543	poll.o			\
544	posix_fadvise.o		\
545	posix_fallocate.o	\
546	posix_madvise.o		\
547	posix_memalign.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	strsep.o		\
594	strsignal.o		\
595	strspn.o		\
596	strstr.o		\
597	strtod.o		\
598	strtoimax.o		\
599	strtok.o		\
600	strtok_r.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	waitpid.o		\
631	walkstack.o		\
632	wdata.o			\
633	xgetwidth.o		\
634	xpg4.o			\
635	xpg6.o
636
637PORTPRINT_W=			\
638	doprnt_w.o
639
640PORTPRINT=			\
641	asprintf.o		\
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	mqueue.o		\
795	pos4obj.o		\
796	sched.o			\
797	sem.o			\
798	shm.o			\
799	sigev_thread.o
800
801TPOOLOBJS=			\
802	thread_pool.o
803
804THREADSOBJS=			\
805	alloc.o			\
806	assfail.o		\
807	cancel.o		\
808	door_calls.o		\
809	pthr_attr.o		\
810	pthr_barrier.o		\
811	pthr_cond.o		\
812	pthr_mutex.o		\
813	pthr_rwlock.o		\
814	pthread.o		\
815	rwlock.o		\
816	scalls.o		\
817	sema.o			\
818	sigaction.o		\
819	spawn.o			\
820	synch.o			\
821	tdb_agent.o		\
822	thr.o			\
823	thread_interface.o	\
824	tls.o			\
825	tsd.o
826
827THREADSMACHOBJS=		\
828	machdep.o
829
830THREADSASMOBJS=			\
831	asm_subr.o
832
833UNICODEOBJS=			\
834	u8_textprep.o		\
835	uconv.o
836
837UNWINDMACHOBJS=			\
838	unwind.o
839
840UNWINDASMOBJS=			\
841	unwind_frame.o
842
843# objects that implement the transitional large file API
844PORTSYS64=			\
845	fstatat64.o		\
846	lockf64.o		\
847	openat64.o
848
849PORTSYS=			\
850	_autofssys.o		\
851	acctctl.o		\
852	bsd_signal.o		\
853	corectl.o		\
854	exacctsys.o		\
855	execl.o			\
856	execle.o		\
857	execv.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	$(LIBCBASE)/sys/uadmin.c
1084
1085# conditional assignments
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	rwlock.o		\
1112	scalls.o		\
1113	sched.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 += $(LIBCDIR)/$(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$(LIBCDIR)/$(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=$(LIBCDIR)/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/%): $(LIBCDIR)/$(MACH)/fp/__quad.il
1218
1219# include common libc targets
1220include $(LIBCDIR)/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/%): $(LIBCBASE)/crt/stret.s
1233	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) $(LIBCBASE)/crt/stret.s -o $@
1234	$(POST_PROCESS_O)
1235
1236$(LIBCBASE)/crt/_rtbootld.s:	$(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1237	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S -K pic \
1238	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1239	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1240	$(RM) $(LIBCBASE)/crt/_rtld.s
1241
1242# partially built from C source
1243pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1244	$(AS) $(ASFLAGS) $(LIBCBASE)/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 = $(LIBCDIR)/$(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$(LIBCDIR)/inc \
1271		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1272
1273OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1274
1275assym.h: $(OFFSETS) genassym
1276	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1277	./genassym >>$@
1278
1279# derived C source and related explicit dependencies
1280$(LIBCDIR)/port/gen/errlst.c + \
1281$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1282	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1283
1284pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1285
1286pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1287