xref: /titanic_52/usr/src/lib/libc/sparcv9/Makefile.com (revision 1eee170a5f6cf875d905524fea524c7c5c870aa0)
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	memccpy.o		\
123	qsort.o			\
124	strtol.o		\
125	strtoul.o		\
126	strtoll.o		\
127	strtoull.o
128
129GENOBJS=			\
130	_getsp.o		\
131	_xregs_clrptr.o		\
132	abs.o			\
133	alloca.o		\
134	ascii_strcasecmp.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	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	ascii_strncasecmp.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	ffs.o			\
397	fls.o			\
398	fmtmsg.o		\
399	ftime.o			\
400	ftok.o			\
401	ftw.o			\
402	gcvt.o			\
403	getauxv.o		\
404	getcwd.o		\
405	getdate_err.o		\
406	getdtblsize.o		\
407	getenv.o		\
408	getexecname.o		\
409	getgrnam.o		\
410	getgrnam_r.o		\
411	gethostid.o		\
412	gethostname.o		\
413	gethz.o			\
414	getisax.o		\
415	getloadavg.o		\
416	getlogin.o		\
417	getmntent.o		\
418	getnetgrent.o		\
419	get_nprocs.o		\
420	getopt.o		\
421	getopt_long.o		\
422	getpagesize.o		\
423	getpw.o			\
424	getpwnam.o		\
425	getpwnam_r.o		\
426	getrusage.o		\
427	getspent.o		\
428	getspent_r.o		\
429	getsubopt.o		\
430	gettxt.o		\
431	getusershell.o		\
432	getut.o			\
433	getutx.o		\
434	getvfsent.o		\
435	getwd.o			\
436	getwidth.o		\
437	getxby_door.o		\
438	gtxt.o			\
439	hsearch.o		\
440	iconv.o			\
441	imaxabs.o		\
442	imaxdiv.o		\
443	index.o			\
444	initgroups.o		\
445	insque.o		\
446	isaexec.o		\
447	isastream.o		\
448	isatty.o		\
449	killpg.o		\
450	klpdlib.o		\
451	l64a.o			\
452	lckpwdf.o		\
453	lconstants.o		\
454	ldivide.o		\
455	lexp10.o		\
456	lfind.o			\
457	lfmt.o			\
458	lfmt_log.o		\
459	lldiv.o			\
460	llog10.o		\
461	lltostr.o		\
462	lmath.o			\
463	localtime.o		\
464	lsearch.o		\
465	madvise.o		\
466	malloc.o		\
467	memalign.o		\
468	memmem.o		\
469	mkdev.o			\
470	mkdtemp.o		\
471	mkfifo.o		\
472	mkstemp.o		\
473	mktemp.o		\
474	mlock.o			\
475	mlockall.o		\
476	mon.o			\
477	msync.o			\
478	munlock.o		\
479	munlockall.o		\
480	ndbm.o			\
481	nftw.o			\
482	nlspath_checks.o	\
483	nsparse.o		\
484	nss_common.o		\
485	nss_dbdefs.o		\
486	nss_deffinder.o		\
487	opendir.o		\
488	opt_data.o		\
489	perror.o		\
490	pfmt.o			\
491	pfmt_data.o		\
492	pfmt_print.o		\
493	plock.o			\
494	poll.o			\
495	posix_fadvise.o		\
496	posix_fallocate.o	\
497	posix_madvise.o		\
498	posix_memalign.o	\
499	priocntl.o		\
500	privlib.o		\
501	priv_str_xlate.o	\
502	psiginfo.o		\
503	psignal.o		\
504	pt.o			\
505	putpwent.o		\
506	putspent.o		\
507	raise.o			\
508	rand.o			\
509	random.o		\
510	rctlops.o		\
511	readdir.o		\
512	readdir_r.o		\
513	realpath.o		\
514	reboot.o		\
515	regexpr.o		\
516	remove.o		\
517	rewinddir.o		\
518	rindex.o		\
519	scandir.o		\
520	seekdir.o		\
521	select.o		\
522	setlabel.o		\
523	setpriority.o		\
524	settimeofday.o		\
525	sh_locks.o		\
526	sigflag.o		\
527	siglist.o		\
528	sigsend.o		\
529	sigsetops.o		\
530	ssignal.o		\
531	stack.o			\
532	stpcpy.o		\
533	stpncpy.o		\
534	str2sig.o		\
535	strcase_charmap.o	\
536	strcat.o		\
537	strchrnul.o		\
538	strcspn.o		\
539	strdup.o		\
540	strerror.o		\
541	strlcat.o		\
542	strncat.o		\
543	strndup.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	tls_data.o		\
574	truncate.o		\
575	tsdalloc.o		\
576	tsearch.o		\
577	ttyname.o		\
578	ttyslot.o		\
579	ualarm.o		\
580	ucred.o			\
581	valloc.o		\
582	vlfmt.o			\
583	vpfmt.o			\
584	waitpid.o		\
585	walkstack.o		\
586	wdata.o			\
587	xgetwidth.o		\
588	xpg4.o			\
589	xpg6.o
590
591PORTPRINT_W=			\
592	doprnt_w.o
593
594PORTPRINT=			\
595	asprintf.o		\
596	doprnt.o		\
597	fprintf.o		\
598	printf.o		\
599	snprintf.o		\
600	sprintf.o		\
601	vfprintf.o		\
602	vprintf.o		\
603	vsnprintf.o		\
604	vsprintf.o		\
605	vwprintf.o		\
606	wprintf.o
607
608# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
609# This macro should ALWAYS be empty; native APIs are already 'large file'.
610PORTSTDIO64=
611
612PORTSTDIO_W=			\
613	doscan_w.o
614
615PORTSTDIO=			\
616	__extensions.o		\
617	_endopen.o		\
618	_filbuf.o		\
619	_findbuf.o		\
620	_flsbuf.o		\
621	_wrtchk.o		\
622	clearerr.o		\
623	ctermid.o		\
624	ctermid_r.o		\
625	cuserid.o		\
626	data.o			\
627	doscan.o		\
628	fdopen.o		\
629	feof.o			\
630	ferror.o		\
631	fgetc.o			\
632	fgets.o			\
633	fileno.o		\
634	flockf.o		\
635	flush.o			\
636	fopen.o			\
637	fpos.o			\
638	fputc.o			\
639	fputs.o			\
640	fread.o			\
641	fseek.o			\
642	fseeko.o		\
643	ftell.o			\
644	ftello.o		\
645	fwrite.o		\
646	getc.o			\
647	getchar.o		\
648	getline.o		\
649	getpass.o		\
650	gets.o			\
651	getw.o			\
652	popen.o			\
653	putc.o			\
654	putchar.o		\
655	puts.o			\
656	putw.o			\
657	rewind.o		\
658	scanf.o			\
659	setbuf.o		\
660	setbuffer.o		\
661	setvbuf.o		\
662	system.o		\
663	tempnam.o		\
664	tmpfile.o		\
665	tmpnam_r.o		\
666	ungetc.o		\
667	mse.o			\
668	vscanf.o		\
669	vwscanf.o		\
670	wscanf.o
671
672PORTI18N=			\
673	__fgetwc_xpg5.o		\
674	__fgetws_xpg5.o		\
675	__fputwc_xpg5.o		\
676	__fputws_xpg5.o		\
677	__ungetwc_xpg5.o	\
678	getwchar.o		\
679	putwchar.o		\
680	putws.o			\
681	strcasecmp.o		\
682	strcasestr.o		\
683	strncasecmp.o		\
684	strtows.o		\
685	wcsnlen.o		\
686	wcstoimax.o		\
687	wcstol.o		\
688	wcstoul.o		\
689	wcswcs.o		\
690	wscasecmp.o		\
691	wscat.o			\
692	wschr.o			\
693	wscmp.o			\
694	wscpy.o			\
695	wscspn.o		\
696	wsdup.o			\
697	wslen.o			\
698	wsncasecmp.o		\
699	wsncat.o		\
700	wsncmp.o		\
701	wsncpy.o		\
702	wspbrk.o		\
703	wsprintf.o		\
704	wsrchr.o		\
705	wsscanf.o		\
706	wsspn.o			\
707	wstod.o			\
708	wstok.o			\
709	wstol.o			\
710	wstoll.o		\
711	wsxfrm.o		\
712	wmemchr.o		\
713	wmemcmp.o		\
714	wmemcpy.o		\
715	wmemmove.o		\
716	wmemset.o		\
717	wcsstr.o		\
718	gettext.o		\
719	gettext_real.o		\
720	gettext_util.o		\
721	gettext_gnu.o		\
722	plural_parser.o		\
723	wdresolve.o		\
724	_ctype.o		\
725	isascii.o		\
726	toascii.o
727
728PORTI18N_COND=			\
729	wcstol_longlong.o	\
730	wcstoul_longlong.o
731
732AIOOBJS=			\
733	aio.o			\
734	aio_alloc.o		\
735	posix_aio.o
736
737RTOBJS=				\
738	clock_timer.o		\
739	mqueue.o		\
740	pos4obj.o		\
741	sched.o			\
742	sem.o			\
743	shm.o			\
744	sigev_thread.o
745
746TPOOLOBJS=			\
747	thread_pool.o
748
749THREADSOBJS=			\
750	alloc.o			\
751	assfail.o		\
752	cancel.o		\
753	door_calls.o		\
754	pthr_attr.o		\
755	pthr_barrier.o		\
756	pthr_cond.o		\
757	pthr_mutex.o		\
758	pthr_rwlock.o		\
759	pthread.o		\
760	rwlock.o		\
761	scalls.o		\
762	sema.o			\
763	sigaction.o		\
764	spawn.o			\
765	synch.o			\
766	tdb_agent.o		\
767	thr.o			\
768	thread_interface.o	\
769	tls.o			\
770	tsd.o
771
772THREADSMACHOBJS=		\
773	machdep.o
774
775THREADSASMOBJS=			\
776	asm_subr.o
777
778UNICODEOBJS=			\
779	u8_textprep.o		\
780	uconv.o
781
782UNWINDMACHOBJS=			\
783	unwind.o
784
785UNWINDASMOBJS=			\
786	unwind_frame.o
787
788# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
789# This macro should ALWAYS be empty; native APIs are already 'large file'.
790PORTSYS64=
791
792PORTSYS=			\
793	_autofssys.o		\
794	access.o		\
795	acctctl.o		\
796	bsd_signal.o		\
797	chmod.o			\
798	chown.o			\
799	corectl.o		\
800	exacctsys.o		\
801	execl.o			\
802	execle.o		\
803	execv.o			\
804	fcntl.o			\
805	getpagesizes.o		\
806	getpeerucred.o		\
807	inst_sync.o		\
808	issetugid.o		\
809	label.o			\
810	link.o			\
811	lockf.o			\
812	lwp.o			\
813	lwp_cond.o		\
814	lwp_rwlock.o		\
815	lwp_sigmask.o		\
816	meminfosys.o		\
817	mkdir.o			\
818	mknod.o			\
819	msgsys.o		\
820	nfssys.o		\
821	open.o			\
822	pgrpsys.o		\
823	posix_sigwait.o		\
824	ppriv.o			\
825	psetsys.o		\
826	rctlsys.o		\
827	readlink.o		\
828	rename.o		\
829	sbrk.o			\
830	semsys.o		\
831	set_errno.o		\
832	sharefs.o		\
833	shmsys.o		\
834	sidsys.o		\
835	siginterrupt.o		\
836	signal.o		\
837	sigpending.o		\
838	sigstack.o		\
839	stat.o			\
840	symlink.o		\
841	tasksys.o		\
842	time.o			\
843	time_util.o		\
844	ucontext.o		\
845	unlink.o		\
846	ustat.o			\
847	utimesys.o		\
848	zone.o
849
850PORTREGEX=			\
851	glob.o			\
852	regcmp.o		\
853	regex.o			\
854	wordexp.o
855
856VALUES=	values-Xa.o
857
858MOSTOBJS=			\
859	$(STRETS)		\
860	$(CRTOBJS)		\
861	$(DYNOBJS)		\
862	$(FPOBJS)		\
863	$(FPOBJS64)		\
864	$(FPASMOBJS)		\
865	$(ATOMICOBJS)		\
866	$(XATTROBJS)		\
867	$(COMOBJS)		\
868	$(GENOBJS)		\
869	$(PRFOBJS)		\
870	$(PORTFP)		\
871	$(PORTGEN)		\
872	$(PORTGEN64)		\
873	$(PORTI18N)		\
874	$(PORTI18N_COND)	\
875	$(PORTPRINT)		\
876	$(PORTPRINT_W)		\
877	$(PORTREGEX)		\
878	$(PORTSTDIO)		\
879	$(PORTSTDIO64)		\
880	$(PORTSTDIO_W)		\
881	$(PORTSYS)		\
882	$(PORTSYS64)		\
883	$(AIOOBJS)		\
884	$(RTOBJS)		\
885	$(TPOOLOBJS)		\
886	$(THREADSOBJS)		\
887	$(THREADSMACHOBJS)	\
888	$(THREADSASMOBJS)	\
889	$(UNICODEOBJS)		\
890	$(UNWINDMACHOBJS)	\
891	$(UNWINDASMOBJS)	\
892	$(COMSYSOBJS)		\
893	$(SYSOBJS)		\
894	$(COMSYSOBJS64)		\
895	$(SYSOBJS64)		\
896	$(VALUES)
897
898TRACEOBJS=			\
899	plockstat.o
900
901# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
902# modules whose source is provided in the $(SRC)/lib/common directory.
903# This must be done because otherwise the Sun C compiler would insert
904# its own versions of these modules and those versions contain code
905# to call out to C++ initialization functions.  Such C++ initialization
906# functions can call back into libc before thread initialization is
907# complete and this leads to segmentation violations and other problems.
908# Since libc contains no C++ code, linking with the minimal crti.o and
909# crtn.o modules is safe and avoids the problems described above.
910OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
911CRTSRCS= ../../common/sparcv9
912
913# include common library definitions
914include $(SRC)/lib/Makefile.lib
915include $(SRC)/lib/Makefile.lib.64
916
917# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
918# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
919# need to be compatible with the ones for the libc stuff.  Whenever the changes
920# that affect the compilation conditions of libc happened, those for libc_i18n
921# also need to be updated.
922
923# we need to override the default SONAME here because we might
924# be building a variant object (still libc.so.1, but different filename)
925SONAME = libc.so.1
926
927CFLAGS64 += $(CCVERBOSE)
928
929# This is necessary to avoid problems with calling _ex_unwind().
930# We probably don't want any inlining anyway.
931CFLAGS64 += -xinline=
932
933# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
934# enables ASSERT() checking in the threads portion of the library.
935# This is automatically enabled for DEBUG builds, not for non-debug builds.
936THREAD_DEBUG =
937$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
938
939# Make string literals read-only to save memory.
940CFLAGS64 += $(XSTRCONST)
941
942ALTPICS= $(TRACEOBJS:%=pics/%)
943
944$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
945$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
946
947MAPFILES =	$(LIBCDIR)/port/mapfile-vers
948
949sparcv9_C_PICFLAGS= -K PIC
950CFLAGS64 +=	$(EXTN_CFLAGS)
951CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
952		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
953ASFLAGS=	$(EXTN_ASFLAGS) -K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
954		$(sparcv9_AS_XARCH)
955
956# As a favor to the dtrace syscall provider, libc still calls the
957# old syscall traps that have been obsoleted by the *at() interfaces.
958# Delete this to compile libc using only the new *at() system call traps
959CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
960
961# Inform the run-time linker about libc specialized initialization
962RTLDINFO =	-z rtldinfo=tls_rtldinfo
963DYNFLAGS +=	$(RTLDINFO)
964
965# Force libc's internal references to be resolved immediately upon loading
966# in order to avoid critical region problems.  Since almost all libc symbols
967# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
968DYNFLAGS +=	-znow
969
970DYNFLAGS +=	$(EXTN_DYNFLAGS)
971
972BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
973
974# Override this top level flag so the compiler builds in its native
975# C99 mode.  This has been enabled to support the complex arithmetic
976# added to libc.
977C99MODE=	$(C99_ENABLE)
978
979# libc method of building an archive
980# The "$(GREP) -v ' L '" part is necessary only until
981# lorder is fixed to ignore thread-local variables.
982BUILD.AR= $(RM) $@ ; \
983	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
984
985# extra files for the clean target
986CLEANFILES=			\
987	$(LIBCDIR)/port/gen/errlst.c	\
988	$(LIBCDIR)/port/gen/new_list.c	\
989	assym.h			\
990	genassym		\
991	pics/crti.o		\
992	pics/crtn.o		\
993	$(ALTPICS)
994
995CLOBBERFILES +=	$(LIB_PIC)
996
997# list of C source for lint
998SRCS=							\
999	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1000	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1001	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1002	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
1003	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
1004	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
1005	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
1006	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
1007	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
1008	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
1009	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
1010	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
1011	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
1012	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1013	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
1014	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1015	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
1016	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
1017	$(FPOBJS64:%.o=$(LIBCBASE)/fp/%.c)		\
1018	$(LIBCBASE)/crt/_ftou.c				\
1019	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1020	$(LIBCBASE)/gen/byteorder.c			\
1021	$(LIBCBASE)/gen/ecvt.c				\
1022	$(LIBCBASE)/gen/getctxt.c			\
1023	$(LIBCBASE)/gen/makectxt.c			\
1024	$(LIBCBASE)/gen/siginfolst.c			\
1025	$(LIBCBASE)/gen/siglongjmp.c			\
1026	$(LIBCBASE)/gen/swapctxt.c
1027
1028# conditional assignments
1029$(DYNLIB) := CRTI = crti.o
1030$(DYNLIB) := CRTN = crtn.o
1031
1032# Files which need the threads .il inline template
1033TIL=				\
1034	aio.o			\
1035	alloc.o			\
1036	assfail.o		\
1037	atexit.o		\
1038	atfork.o		\
1039	cancel.o		\
1040	door_calls.o		\
1041	err.o			\
1042	errno.o			\
1043	getctxt.o		\
1044	lwp.o			\
1045	ma.o			\
1046	machdep.o		\
1047	posix_aio.o		\
1048	pthr_attr.o		\
1049	pthr_barrier.o		\
1050	pthr_cond.o		\
1051	pthr_mutex.o		\
1052	pthr_rwlock.o		\
1053	pthread.o		\
1054	rand.o			\
1055	rwlock.o		\
1056	scalls.o		\
1057	sched.o			\
1058	sema.o			\
1059	sigaction.o		\
1060	sigev_thread.o		\
1061	spawn.o			\
1062	stack.o			\
1063	swapctxt.o		\
1064	synch.o			\
1065	tdb_agent.o		\
1066	thr.o			\
1067	thread_interface.o	\
1068	thread_pool.o		\
1069	tls.o			\
1070	tsd.o			\
1071	unwind.o
1072
1073$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1074
1075# This hack is needed until the sparc gcc is fixed for TLS
1076pics/tls_data.o := CC = env 'CW_NO_SHADOW=1' $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc
1077
1078# Files in fp, port/fp subdirectories that need base.il inline template
1079IL=				\
1080	__flt_decim.o		\
1081	decimal_bin.o
1082
1083$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1084
1085# Files in fp subdirectory which need __quad.il inline template
1086QIL=				\
1087	_Q_add.o		\
1088	_Q_cmp.o		\
1089	_Q_cmpe.o		\
1090	_Q_div.o		\
1091	_Q_dtoq.o		\
1092	_Q_fcc.o		\
1093	_Q_mul.o		\
1094	_Q_qtod.o		\
1095	_Q_qtoi.o		\
1096	_Q_qtos.o		\
1097	_Q_qtou.o		\
1098	_Q_sqrt.o		\
1099	_Q_stoq.o		\
1100	_Q_sub.o		\
1101	_Qp_qtox.o		\
1102	_Qp_qtoux.o
1103
1104$(QIL:%=pics/%) := CFLAGS64 += $(LIBCDIR)/$(MACH)/fp/__quad.il
1105pics/_Qp%.o := CFLAGS64 += -I$(LIBCDIR)/$(MACH)/fp
1106pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1107
1108# Files in crt subdirectory which need muldiv64.il inline template
1109#CIL=	mul64.o divrem64.o
1110#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
1111
1112# large-file-aware components that should be built large
1113
1114#$(COMSYSOBJS64:%=pics/%) := \
1115#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1116
1117#$(SYSOBJS64:%=pics/%) := \
1118#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1119
1120#$(PORTGEN64:%=pics/%) := \
1121#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1122
1123#$(PORTSTDIO64:%=pics/%) := \
1124#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1125
1126#$(PORTSYS64:%=pics/%) := \
1127#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1128
1129$(PORTSTDIO_W:%=pics/%) := \
1130	CPPFLAGS += -D_WIDE
1131
1132$(PORTPRINT_W:%=pics/%) := \
1133	CPPFLAGS += -D_WIDE
1134
1135$(PORTI18N_COND:%=pics/%) := \
1136	CPPFLAGS += -D_WCS_LONGLONG
1137
1138# Files which need extra optimization
1139pics/getenv.o := sparcv9_COPTFLAG = -xO4
1140
1141.KEEP_STATE:
1142
1143all: $(LIBS) $(LIB_PIC)
1144
1145lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1146lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1147lint	:=	LINTFLAGS64 += -mn
1148
1149lint:
1150	@echo $(LINT.c) ... $(LDLIBS)
1151	@$(LINT.c) $(SRCS) $(LDLIBS)
1152
1153$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1154$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1155$(LINTLIB):= LINTFLAGS64=-nvx -m64
1156
1157# object files that depend on inline template
1158$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1159$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1160$(QIL:%=pics/%): $(LIBCDIR)/$(MACH)/fp/__quad.il
1161#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
1162
1163# include common libc targets
1164include $(LIBCDIR)/Makefile.targ
1165
1166# We need to strip out all CTF and DOF data from the static library
1167$(LIB_PIC) := DIR = pics
1168$(LIB_PIC): pics $$(PICS)
1169	$(BUILD.AR)
1170	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1171	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1172	$(AR) -ts $@ > /dev/null
1173	$(POST_PROCESS_A)
1174
1175# special cases
1176#$(STRETS:%=pics/%): crt/stret.s
1177#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1178#	$(POST_PROCESS_O)
1179
1180#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1181#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1182#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1183#	$(RM) crt/_rtld.s
1184
1185ASSYMDEP_OBJS=			\
1186	_lwp_mutex_unlock.o	\
1187	_stack_grow.o		\
1188	asm_subr.o		\
1189	setjmp.o		\
1190	smt_pause.o		\
1191	tls_get_addr.o		\
1192	unwind_frame.o		\
1193	vforkx.o
1194
1195$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1196
1197$(ASSYMDEP_OBJS:%=pics/%): assym.h
1198
1199# assym.h build rules
1200
1201GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1202
1203# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1204#	live in Makefile.master
1205
1206CPPFLAGS.genassym = \
1207	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1208
1209genassym: $(GENASSYM_C)
1210	$(NATIVECC) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc \
1211		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1212
1213OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1214
1215assym.h: $(OFFSETS) genassym
1216	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1217	./genassym >>$@
1218
1219# derived C source and related explicit dependencies
1220$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1221	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1222
1223pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1224