xref: /illumos-gate/usr/src/lib/libc/sparc/Makefile.com (revision 9d0d62ad2e60e8f742a2e723d06e88352ee6a1f3)
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
1014# Force libc's internal references to be resolved immediately upon loading
1015# in order to avoid critical region problems.  Since almost all libc symbols
1016# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1017DYNFLAGS +=	-znow
1018
1019DYNFLAGS +=	-e __rtboot
1020DYNFLAGS +=	$(EXTN_DYNFLAGS)
1021
1022# Inform the kernel about the initial DTrace area (in case
1023# libc is being used as the interpreter / runtime linker).
1024DTRACE_DATA =	-zdtrace=dtrace_data
1025DYNFLAGS +=	$(DTRACE_DATA)
1026
1027# DTrace needs an executable data segment.
1028MAPFILE.NED=
1029
1030BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1031
1032# Override this top level flag so the compiler builds in its native
1033# C99 mode.  This has been enabled to support the complex arithmetic
1034# added to libc.
1035C99MODE=	$(C99_ENABLE)
1036
1037# libc method of building an archive
1038BUILD.AR= $(RM) $@ ; \
1039	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
1040
1041# extra files for the clean target
1042CLEANFILES=			\
1043	$(LIBCDIR)/port/gen/errlst.c	\
1044	$(LIBCDIR)/port/gen/new_list.c	\
1045	assym.h			\
1046	genassym		\
1047	$(LIBCBASE)/crt/_rtld.s		\
1048	$(LIBCBASE)/crt/_rtbootld.s		\
1049	pics/_rtbootld.o	\
1050	pics/crti.o		\
1051	pics/crtn.o		\
1052	$(ALTPICS)
1053
1054CLOBBERFILES +=	$(LIB_PIC)
1055
1056# list of C source for lint
1057SRCS=							\
1058	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1059	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1060	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1061	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1062	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
1063	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
1064	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
1065	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
1066	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
1067	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
1068	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
1069	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
1070	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
1071	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
1072	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1073	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
1074	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1075	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
1076	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
1077	$(LIBCBASE)/crt/_ftou.c				\
1078	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1079	$(LIBCBASE)/gen/byteorder.c			\
1080	$(LIBCBASE)/gen/ecvt.c				\
1081	$(LIBCBASE)/gen/getctxt.c			\
1082	$(LIBCBASE)/gen/lmul.c				\
1083	$(LIBCBASE)/gen/makectxt.c			\
1084	$(LIBCBASE)/gen/siginfolst.c			\
1085	$(LIBCBASE)/gen/siglongjmp.c			\
1086	$(LIBCBASE)/gen/swapctxt.c			\
1087	$(LIBCBASE)/sys/ptrace.c			\
1088	$(LIBCBASE)/sys/uadmin.c
1089
1090# conditional assignments
1091$(DYNLIB) := CRTI = crti.o
1092$(DYNLIB) := CRTN = crtn.o
1093
1094# Files which need the threads .il inline template
1095TIL=				\
1096	aio.o			\
1097	alloc.o			\
1098	assfail.o		\
1099	atexit.o		\
1100	atfork.o		\
1101	cancel.o		\
1102	door_calls.o		\
1103	errno.o			\
1104	getctxt.o		\
1105	lwp.o			\
1106	ma.o			\
1107	machdep.o		\
1108	posix_aio.o		\
1109	pthr_attr.o		\
1110	pthr_barrier.o		\
1111	pthr_cond.o		\
1112	pthr_mutex.o		\
1113	pthr_rwlock.o		\
1114	pthread.o		\
1115	rand.o			\
1116	rwlock.o		\
1117	scalls.o		\
1118	sched.o			\
1119	sema.o			\
1120	sigaction.o		\
1121	sigev_thread.o		\
1122	spawn.o			\
1123	stack.o			\
1124	swapctxt.o		\
1125	synch.o			\
1126	tdb_agent.o		\
1127	thr.o			\
1128	thread_interface.o	\
1129	thread_pool.o		\
1130	tls.o			\
1131	tsd.o			\
1132	unwind.o
1133
1134$(TIL:%=pics/%) := CFLAGS += $(LIBCBASE)/threads/sparc.il
1135
1136# special kludge for inlines with 'cas':
1137pics/rwlock.o pics/synch.o pics/lwp.o := sparc_CFLAGS += -_gcc=-Wa,-xarch=v8plus
1138
1139# Files in port/fp subdirectory that need base.il inline template
1140IL=				\
1141	__flt_decim.o		\
1142	decimal_bin.o
1143
1144$(IL:%=pics/%) := CFLAGS += $(LIBCBASE)/fp/base.il
1145
1146# Files in fp subdirectory which need __quad.il inline template
1147QIL=				\
1148	_Q_add.o		\
1149	_Q_cmp.o		\
1150	_Q_cmpe.o		\
1151	_Q_div.o		\
1152	_Q_dtoq.o		\
1153	_Q_fcc.o		\
1154	_Q_mul.o		\
1155	_Q_qtod.o		\
1156	_Q_qtoi.o		\
1157	_Q_qtos.o		\
1158	_Q_qtou.o		\
1159	_Q_sqrt.o		\
1160	_Q_stoq.o		\
1161	_Q_sub.o
1162
1163$(QIL:%=pics/%) := CFLAGS += $(LIBCDIR)/$(MACH)/fp/__quad.il
1164pics/_Q%.o := sparc_COPTFLAG = -xO4 -dalign
1165pics/__quad%.o := sparc_COPTFLAG = -xO4 -dalign
1166
1167# large-file-aware components that should be built large
1168
1169$(COMSYSOBJS64:%=pics/%) := \
1170	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1171
1172$(SYSOBJS64:%=pics/%) := \
1173	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1174
1175$(PORTGEN64:%=pics/%) := \
1176	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1177
1178$(PORTSTDIO64:%=pics/%) := \
1179	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1180
1181$(PORTSYS64:%=pics/%) := \
1182	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1183
1184$(PORTSTDIO_W:%=pics/%) := \
1185	CPPFLAGS += -D_WIDE
1186
1187$(PORTPRINT_W:%=pics/%) := \
1188	CPPFLAGS += -D_WIDE
1189
1190# printf/scanf functions to support c89-sized intmax_t variables
1191$(PORTPRINT_C89:%=pics/%) := \
1192	CPPFLAGS += -D_C89_INTMAX32
1193
1194$(PORTSTDIO_C89:%=pics/%) := \
1195	CPPFLAGS += -D_C89_INTMAX32
1196
1197$(PORTI18N_COND:%=pics/%) := \
1198	CPPFLAGS += -D_WCS_LONGLONG
1199
1200# Files which need extra optimization
1201pics/getenv.o := sparc_COPTFLAG = -xO4
1202
1203.KEEP_STATE:
1204
1205all: $(LIBS) $(LIB_PIC)
1206
1207lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1208lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1209lint	:=	LINTFLAGS += -mn
1210
1211lint:
1212	@echo $(LINT.c) ... $(LDLIBS)
1213	@$(LINT.c) $(SRCS) $(LDLIBS)
1214
1215$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1216$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1217$(LINTLIB):= LINTFLAGS=-nvx
1218
1219# object files that depend on inline template
1220$(TIL:%=pics/%): $(LIBCBASE)/threads/sparc.il
1221$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1222$(QIL:%=pics/%): $(LIBCDIR)/$(MACH)/fp/__quad.il
1223
1224# include common libc targets
1225include $(LIBCDIR)/Makefile.targ
1226
1227# We need to strip out all CTF and DOF data from the static library
1228$(LIB_PIC) := DIR = pics
1229$(LIB_PIC): pics $$(PICS)
1230	$(BUILD.AR)
1231	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1232	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1233	$(AR) -ts $@ > /dev/null
1234	$(POST_PROCESS_A)
1235
1236# special cases
1237$(STRETS:%=pics/%): $(LIBCBASE)/crt/stret.s
1238	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) $(LIBCBASE)/crt/stret.s -o $@
1239	$(POST_PROCESS_O)
1240
1241$(LIBCBASE)/crt/_rtbootld.s:	$(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1242	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S -K pic \
1243	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1244	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1245	$(RM) $(LIBCBASE)/crt/_rtld.s
1246
1247# partially built from C source
1248pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1249	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1250	$(CTFCONVERT_O)
1251
1252ASSYMDEP_OBJS=			\
1253	_lwp_mutex_unlock.o	\
1254	_stack_grow.o		\
1255	asm_subr.o		\
1256	tls_get_addr.o		\
1257	unwind_frame.o		\
1258	vforkx.o
1259
1260$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1261
1262$(ASSYMDEP_OBJS:%=pics/%): assym.h
1263
1264# assym.h build rules
1265
1266GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1267
1268# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1269#	live in Makefile.master
1270
1271CPPFLAGS.genassym = \
1272	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1273
1274genassym: $(GENASSYM_C)
1275	$(NATIVECC) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc \
1276		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1277
1278OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1279
1280assym.h: $(OFFSETS) genassym
1281	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1282	./genassym >>$@
1283
1284# derived C source and related explicit dependencies
1285$(LIBCDIR)/port/gen/errlst.c + \
1286$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1287	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1288
1289pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1290
1291pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1292