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