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