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