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