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