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