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