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