xref: /illumos-gate/usr/src/lib/libc/sparc/Makefile (revision ddf7fe95b8ad67aa16deb427a0b78f4dd4ff22b1)
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# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28LIBCBASE=.
29
30LIBRARY= libc.a
31LIB_PIC= libc_pic.a
32VERS=	.1
33CPP=	/usr/lib/cpp
34TARGET_ARCH=	sparc
35
36# objects are grouped by source directory
37
38# local objects
39STRETS=				\
40	stret1.o		\
41	stret2.o		\
42	stret4.o
43
44CRTOBJS=			\
45	_ftou.o			\
46	cerror.o		\
47	cerror64.o		\
48	hwmuldiv.o
49
50DYNOBJS=			\
51	_rtbootld.o
52
53FPOBJS=				\
54	_D_cplx_div.o		\
55	_D_cplx_div_ix.o	\
56	_D_cplx_div_rx.o	\
57	_D_cplx_mul.o		\
58	_F_cplx_div.o		\
59	_F_cplx_div_ix.o	\
60	_F_cplx_div_rx.o	\
61	_F_cplx_mul.o		\
62	_Q_add.o		\
63	_Q_cmp.o		\
64	_Q_cmpe.o		\
65	_Q_cplx_div.o		\
66	_Q_cplx_div_ix.o	\
67	_Q_cplx_div_rx.o	\
68	_Q_cplx_lr_div.o	\
69	_Q_cplx_lr_div_ix.o	\
70	_Q_cplx_lr_div_rx.o	\
71	_Q_cplx_lr_mul.o	\
72	_Q_cplx_mul.o		\
73	_Q_div.o		\
74	_Q_dtoq.o		\
75	_Q_fcc.o		\
76	_Q_itoq.o		\
77	_Q_lltoq.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_set_except.o		\
86	_Q_sqrt.o		\
87	_Q_stoq.o		\
88	_Q_sub.o		\
89	_Q_ulltoq.o		\
90	_Q_utoq.o		\
91	__quad_mag.o
92
93FPASMOBJS=			\
94	_Q_get_rp_rd.o		\
95	fpgetmask.o		\
96	fpgetrnd.o		\
97	fpgetsticky.o		\
98	fpsetmask.o		\
99	fpsetrnd.o		\
100	fpsetsticky.o		\
101	__quad.o
102
103ATOMICOBJS=			\
104	atomic.o
105
106XATTROBJS=			\
107	xattr_common.o
108
109COMOBJS=			\
110	bcmp.o			\
111	bcopy.o			\
112	bzero.o			\
113	bsearch.o		\
114	ffs.o			\
115	memccpy.o		\
116	qsort.o			\
117	strtol.o		\
118	strtoul.o
119
120DTRACEOBJS=			\
121	dtrace_data.o
122
123GENOBJS=			\
124	_getsp.o		\
125	_xregs_clrptr.o		\
126	abs.o			\
127	alloca.o		\
128	byteorder.o		\
129	cuexit.o		\
130	ecvt.o			\
131	errlst.o		\
132	getctxt.o		\
133	ladd.o			\
134	lexp10.o		\
135	llog10.o		\
136	lmul.o			\
137	lock.o			\
138	lshiftl.o		\
139	lsign.o			\
140	lsub.o			\
141	makectxt.o		\
142	memchr.o		\
143	memcmp.o		\
144	memcpy.o		\
145	memmove.o		\
146	memset.o		\
147	new_list.o		\
148	setjmp.o		\
149	siginfolst.o		\
150	siglongjmp.o		\
151	sparc_data.o		\
152	strcasecmp.o		\
153	strchr.o		\
154	strcmp.o		\
155	strcpy.o		\
156	strlcpy.o		\
157	strlen.o		\
158	strncmp.o		\
159	strncpy.o		\
160	strnlen.o		\
161	swapctxt.o		\
162	sync_instruction_memory.o
163
164# sysobjs that contain large-file interfaces
165COMSYSOBJS64=			\
166	creat64.o		\
167	fstat64.o		\
168	fstatvfs64.o		\
169	getdents64.o		\
170	getrlimit64.o		\
171	lseek64.o		\
172	lstat64.o		\
173	open64.o		\
174	pread64.o		\
175	pwrite64.o		\
176	setrlimit64.o		\
177	stat64.o		\
178	statvfs64.o
179
180SYSOBJS64=			\
181	mmap64.o
182
183COMSYSOBJS=			\
184	__clock_timer.o		\
185	__getloadavg.o		\
186	__rusagesys.o		\
187	__signotify.o		\
188	__sigrt.o		\
189	__time.o		\
190	_lgrp_home_fast.o	\
191	_lgrpsys.o		\
192	_nfssys.o		\
193	_portfs.o		\
194	_pset.o			\
195	_rpcsys.o		\
196	_sigaction.o		\
197	_so_accept.o		\
198	_so_bind.o		\
199	_so_connect.o		\
200	_so_getpeername.o	\
201	_so_getsockname.o	\
202	_so_getsockopt.o	\
203	_so_listen.o		\
204	_so_recv.o		\
205	_so_recvfrom.o		\
206	_so_recvmsg.o		\
207	_so_send.o		\
208	_so_sendmsg.o		\
209	_so_sendto.o		\
210	_so_setsockopt.o	\
211	_so_shutdown.o		\
212	_so_socket.o		\
213	_so_socketpair.o	\
214	_sockconfig.o		\
215	access.o		\
216	acct.o			\
217	acl.o			\
218	adjtime.o		\
219	alarm.o			\
220	brk.o			\
221	chdir.o			\
222	chmod.o			\
223	chown.o			\
224	chroot.o		\
225	cladm.o			\
226	close.o			\
227	creat.o			\
228	dup.o			\
229	execve.o		\
230	exit.o			\
231	facl.o			\
232	fchdir.o		\
233	fchmod.o		\
234	fchown.o		\
235	fchroot.o		\
236	fcntl.o			\
237	fdsync.o		\
238	fpathconf.o		\
239	fstat.o			\
240	fstatfs.o		\
241	fstatvfs.o		\
242	getcpuid.o		\
243	getdents.o		\
244	getegid.o		\
245	geteuid.o		\
246	getgid.o		\
247	getgroups.o		\
248	gethrtime.o		\
249	getitimer.o		\
250	getmsg.o		\
251	getpid.o		\
252	getpmsg.o		\
253	getppid.o		\
254	getrlimit.o		\
255	getuid.o		\
256	gtty.o			\
257	install_utrap.o		\
258	ioctl.o			\
259	kaio.o			\
260	kill.o			\
261	lchown.o		\
262	link.o			\
263	llseek.o		\
264	lseek.o			\
265	lstat.o			\
266	memcntl.o		\
267	mincore.o		\
268	mkdir.o			\
269	mknod.o			\
270	mmap.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	lfind.o			\
512	lfmt.o			\
513	lfmt_log.o		\
514	llabs.o			\
515	lldiv.o			\
516	lltostr.o		\
517	localtime.o		\
518	lsearch.o		\
519	madvise.o		\
520	malloc.o		\
521	memalign.o		\
522	mkdev.o			\
523	mkdtemp.o		\
524	mkfifo.o		\
525	mkstemp.o		\
526	mktemp.o		\
527	mlock.o			\
528	mlockall.o		\
529	mon.o			\
530	msync.o			\
531	munlock.o		\
532	munlockall.o		\
533	ndbm.o			\
534	nftw.o			\
535	nlspath_checks.o	\
536	nsparse.o		\
537	nss_common.o		\
538	nss_dbdefs.o		\
539	nss_deffinder.o		\
540	opendir.o		\
541	opt_data.o		\
542	perror.o		\
543	pfmt.o			\
544	pfmt_data.o		\
545	pfmt_print.o		\
546	plock.o			\
547	poll.o			\
548	priocntl.o		\
549	privlib.o		\
550	priv_str_xlate.o	\
551	psiginfo.o		\
552	psignal.o		\
553	pt.o			\
554	putpwent.o		\
555	putspent.o		\
556	raise.o			\
557	rand.o			\
558	random.o		\
559	rctlops.o		\
560	readdir.o		\
561	readdir_r.o		\
562	realpath.o		\
563	reboot.o		\
564	regexpr.o		\
565	remove.o		\
566	rewinddir.o		\
567	rindex.o		\
568	scandir.o		\
569	seekdir.o		\
570	select.o		\
571	select_large_fdset.o	\
572	setlabel.o		\
573	setpriority.o		\
574	settimeofday.o		\
575	sh_locks.o		\
576	sigflag.o		\
577	siglist.o		\
578	sigsend.o		\
579	sigsetops.o		\
580	ssignal.o		\
581	stack.o			\
582	str2sig.o		\
583	strcase_charmap.o	\
584	strcat.o		\
585	strcspn.o		\
586	strdup.o		\
587	strerror.o		\
588	strncat.o		\
589	strlcat.o		\
590	strncasecmp.o		\
591	strpbrk.o		\
592	strrchr.o		\
593	strsignal.o		\
594	strspn.o		\
595	strstr.o		\
596	strtod.o		\
597	strtoimax.o		\
598	strtok.o		\
599	strtok_r.o		\
600	strtoll.o		\
601	strtoull.o		\
602	strtoumax.o		\
603	swab.o			\
604	swapctl.o		\
605	sysconf.o		\
606	syslog.o		\
607	tcdrain.o		\
608	tcflow.o		\
609	tcflush.o		\
610	tcgetattr.o		\
611	tcgetpgrp.o		\
612	tcgetsid.o		\
613	tcsendbreak.o		\
614	tcsetattr.o		\
615	tcsetpgrp.o		\
616	tell.o			\
617	telldir.o		\
618	tfind.o			\
619	time_data.o		\
620	time_gdata.o		\
621	truncate.o		\
622	tsdalloc.o		\
623	tsearch.o		\
624	ttyname.o		\
625	ttyslot.o		\
626	ualarm.o		\
627	ucred.o			\
628	valloc.o		\
629	vlfmt.o			\
630	vpfmt.o			\
631	waitpid.o		\
632	walkstack.o		\
633	wdata.o			\
634	xgetwidth.o		\
635	xpg4.o			\
636	xpg6.o
637
638PORTPRINT_W=			\
639	doprnt_w.o
640
641PORTPRINT=			\
642	doprnt.o		\
643	fprintf.o		\
644	printf.o		\
645	snprintf.o		\
646	sprintf.o		\
647	vfprintf.o		\
648	vprintf.o		\
649	vsnprintf.o		\
650	vsprintf.o		\
651	vwprintf.o		\
652	wprintf.o
653
654# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
655PORTPRINT_C89=			\
656	vfprintf_c89.o		\
657	vprintf_c89.o		\
658	vsnprintf_c89.o		\
659	vsprintf_c89.o		\
660	vwprintf_c89.o
661
662PORTSTDIO_C89=			\
663	vscanf_c89.o		\
664	vwscanf_c89.o
665
666# portable stdio objects that contain large file interfaces.
667# Note: fopen64 is a special case, as we build it small.
668PORTSTDIO64=			\
669	fopen64.o		\
670	fpos64.o
671
672PORTSTDIO_W=			\
673	doscan_w.o
674
675PORTSTDIO=			\
676	__extensions.o		\
677	_endopen.o		\
678	_filbuf.o		\
679	_findbuf.o		\
680	_flsbuf.o		\
681	_wrtchk.o		\
682	clearerr.o		\
683	ctermid.o		\
684	ctermid_r.o		\
685	cuserid.o		\
686	data.o			\
687	doscan.o		\
688	fdopen.o		\
689	feof.o			\
690	ferror.o		\
691	fgetc.o			\
692	fgets.o			\
693	fileno.o		\
694	flockf.o		\
695	flush.o			\
696	fopen.o			\
697	fpos.o			\
698	fputc.o			\
699	fputs.o			\
700	fread.o			\
701	fseek.o			\
702	fseeko.o		\
703	ftell.o			\
704	ftello.o		\
705	fwrite.o		\
706	getc.o			\
707	getchar.o		\
708	getpass.o		\
709	gets.o			\
710	getw.o			\
711	popen.o			\
712	putc.o			\
713	putchar.o		\
714	puts.o			\
715	putw.o			\
716	rewind.o		\
717	scanf.o			\
718	setbuf.o		\
719	setbuffer.o		\
720	setvbuf.o		\
721	system.o		\
722	tempnam.o		\
723	tmpfile.o		\
724	tmpnam_r.o		\
725	ungetc.o		\
726	mse.o			\
727	vscanf.o		\
728	vwscanf.o		\
729	wscanf.o
730
731PORTI18N=			\
732	__fgetwc_xpg5.o		\
733	__fgetws_xpg5.o		\
734	__fputwc_xpg5.o		\
735	__fputws_xpg5.o		\
736	__ungetwc_xpg5.o	\
737	getwchar.o		\
738	putwchar.o		\
739	putws.o			\
740	strtows.o		\
741	wcstoimax.o		\
742	wcstol.o		\
743	wcstoul.o		\
744	wcswcs.o		\
745	wscasecmp.o		\
746	wscat.o			\
747	wschr.o			\
748	wscmp.o			\
749	wscpy.o			\
750	wscspn.o		\
751	wsdup.o			\
752	wslen.o			\
753	wsncasecmp.o		\
754	wsncat.o		\
755	wsncmp.o		\
756	wsncpy.o		\
757	wspbrk.o		\
758	wsprintf.o		\
759	wsrchr.o		\
760	wsscanf.o		\
761	wsspn.o			\
762	wstod.o			\
763	wstok.o			\
764	wstol.o			\
765	wstoll.o		\
766	wsxfrm.o		\
767	wmemchr.o		\
768	wmemcmp.o		\
769	wmemcpy.o		\
770	wmemmove.o		\
771	wmemset.o		\
772	wcsstr.o		\
773	gettext.o		\
774	gettext_real.o		\
775	gettext_util.o		\
776	gettext_gnu.o		\
777	plural_parser.o		\
778	wdresolve.o		\
779	_ctype.o		\
780	isascii.o		\
781	toascii.o
782
783PORTI18N_COND=			\
784	wcstol_longlong.o	\
785	wcstoul_longlong.o
786
787AIOOBJS=			\
788	aio.o			\
789	aio_alloc.o		\
790	posix_aio.o
791
792RTOBJS=				\
793	clock_timer.o		\
794	fallocate.o		\
795	mqueue.o		\
796	pos4obj.o		\
797	sched.o			\
798	sem.o			\
799	shm.o			\
800	sigev_thread.o
801
802TPOOLOBJS=			\
803	thread_pool.o
804
805THREADSOBJS=			\
806	alloc.o			\
807	assfail.o		\
808	cancel.o		\
809	door_calls.o		\
810	pthr_attr.o		\
811	pthr_barrier.o		\
812	pthr_cond.o		\
813	pthr_mutex.o		\
814	pthr_rwlock.o		\
815	pthread.o		\
816	rtsched.o		\
817	rwlock.o		\
818	scalls.o		\
819	sema.o			\
820	sigaction.o		\
821	spawn.o			\
822	synch.o			\
823	tdb_agent.o		\
824	thr.o			\
825	thread_interface.o	\
826	tls.o			\
827	tsd.o
828
829THREADSMACHOBJS=		\
830	machdep.o
831
832THREADSASMOBJS=			\
833	asm_subr.o
834
835UNICODEOBJS=			\
836	u8_textprep.o		\
837	uconv.o
838
839UNWINDMACHOBJS=			\
840	unwind.o
841
842UNWINDASMOBJS=			\
843	unwind_frame.o
844
845# objects that implement the transitional large file API
846PORTSYS64=			\
847	fstatat64.o		\
848	lockf64.o		\
849	openat64.o
850
851PORTSYS=			\
852	_autofssys.o		\
853	acctctl.o		\
854	bsd_signal.o		\
855	corectl.o		\
856	exacctsys.o		\
857	execl.o			\
858	execle.o		\
859	execv.o			\
860	faccessat.o		\
861	fsmisc.o		\
862	fstatat.o		\
863	getpagesizes.o		\
864	getpeerucred.o		\
865	inst_sync.o		\
866	issetugid.o		\
867	label.o			\
868	libc_fcntl.o		\
869	libc_link.o		\
870	libc_open.o		\
871	lockf.o			\
872	lwp.o			\
873	lwp_cond.o		\
874	lwp_rwlock.o		\
875	lwp_sigmask.o		\
876	meminfosys.o		\
877	msgsys.o		\
878	nfssys.o		\
879	openat.o		\
880	pgrpsys.o		\
881	posix_sigwait.o		\
882	ppriv.o			\
883	psetsys.o		\
884	rctlsys.o		\
885	sbrk.o			\
886	semsys.o		\
887	set_errno.o		\
888	sharefs.o		\
889	shmsys.o		\
890	sidsys.o		\
891	siginterrupt.o		\
892	signal.o		\
893	sigpending.o		\
894	sigstack.o		\
895	tasksys.o		\
896	time.o			\
897	time_util.o		\
898	ucontext.o		\
899	ustat.o			\
900	zone.o
901
902PORTREGEX=			\
903	glob.o			\
904	regcmp.o		\
905	regex.o			\
906	wordexp.o
907
908VALUES=	values-Xa.o
909
910MOSTOBJS=			\
911	$(STRETS)		\
912	$(CRTOBJS)		\
913	$(DYNOBJS)		\
914	$(FPOBJS)		\
915	$(FPASMOBJS)		\
916	$(ATOMICOBJS)		\
917	$(XATTROBJS)		\
918	$(COMOBJS)		\
919	$(DTRACEOBJS)		\
920	$(GENOBJS)		\
921	$(PORTFP)		\
922	$(PORTGEN)		\
923	$(PORTGEN64)		\
924	$(PORTI18N)		\
925	$(PORTI18N_COND)	\
926	$(PORTPRINT)		\
927	$(PORTPRINT_C89)	\
928	$(PORTPRINT_W)		\
929	$(PORTREGEX)		\
930	$(PORTSTDIO)		\
931	$(PORTSTDIO64)		\
932	$(PORTSTDIO_C89)	\
933	$(PORTSTDIO_W)		\
934	$(PORTSYS)		\
935	$(PORTSYS64)		\
936	$(AIOOBJS)		\
937	$(RTOBJS)		\
938	$(TPOOLOBJS)		\
939	$(THREADSOBJS)		\
940	$(THREADSMACHOBJS)	\
941	$(THREADSASMOBJS)	\
942	$(UNICODEOBJS)		\
943	$(UNWINDMACHOBJS)	\
944	$(UNWINDASMOBJS)	\
945	$(COMSYSOBJS)		\
946	$(SYSOBJS)		\
947	$(COMSYSOBJS64)		\
948	$(SYSOBJS64)		\
949	$(VALUES)
950
951TRACEOBJS=			\
952	plockstat.o
953
954# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
955# modules whose source is provided in the $(SRC)/lib/common directory.
956# This must be done because otherwise the Sun C compiler would insert
957# its own versions of these modules and those versions contain code
958# to call out to C++ initialization functions.  Such C++ initialization
959# functions can call back into libc before thread initialization is
960# complete and this leads to segmentation violations and other problems.
961# Since libc contains no C++ code, linking with the minimal crti.o and
962# crtn.o modules is safe and avoids the problems described above.
963OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
964CRTSRCS= ../../common/sparc
965
966# include common library definitions
967include ../../Makefile.lib
968
969# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
970# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
971# need to be compatible with the ones for the libc stuff.  Whenever the changes
972# that affect the compilation conditions of libc happened, those for libc_i18n
973# also need to be updated.
974
975CFLAGS += $(CCVERBOSE)
976
977# This is necessary to avoid problems with calling _ex_unwind().
978# We probably don't want any inlining anyway.
979CFLAGS += -xinline=
980
981# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
982# enables ASSERT() checking in the threads portion of the library.
983# This is automatically enabled for DEBUG builds, not for non-debug builds.
984THREAD_DEBUG =
985$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
986
987CFLAGS += $(THREAD_DEBUG)
988
989ALTPICS= $(TRACEOBJS:%=pics/%)
990
991$(DYNLIB) := PICS += $(ROOTFS_LIBDIR)/libc_i18n.a
992$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
993
994MAPFILES =	../port/mapfile-vers mapfile-vers
995
996CFLAGS +=	$(EXTN_CFLAGS)
997CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) \
998		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
999ASFLAGS=	-K pic -P -D__STDC__ -D_ASM $(CPPFLAGS) $(sparc_AS_XARCH)
1000
1001# Conditionally add support for making |wordexp()| check whether
1002# /usr/bin/ksh is ksh93 or not
1003include ../../../Makefile.ksh93switch
1004CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
1005
1006# Inform the run-time linker about libc specialized initialization
1007RTLDINFO =	-z rtldinfo=tls_rtldinfo
1008DYNFLAGS +=	$(RTLDINFO)
1009
1010DYNFLAGS +=	-e __rtboot
1011DYNFLAGS +=	$(EXTN_DYNFLAGS)
1012
1013# Inform the kernel about the initial DTrace area (in case
1014# libc is being used as the interpreter / runtime linker).
1015DTRACE_DATA =	-zdtrace=dtrace_data
1016DYNFLAGS +=	$(DTRACE_DATA)
1017
1018# DTrace needs an executable data segment.
1019MAPFILE.NED=
1020
1021BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1022
1023# Override this top level flag so the compiler builds in its native
1024# C99 mode.  This has been enabled to support the complex arithmetic
1025# added to libc.
1026C99MODE=	$(C99_ENABLE)
1027
1028# libc method of building an archive
1029BUILD.AR= $(RM) $@ ; \
1030	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
1031
1032# extra files for the clean target
1033CLEANFILES=			\
1034	../port/gen/errlst.c	\
1035	../port/gen/new_list.c	\
1036	assym.h			\
1037	genassym		\
1038	crt/_rtld.s		\
1039	crt/_rtbootld.s		\
1040	pics/_rtbootld.o	\
1041	pics/crti.o		\
1042	pics/crtn.o		\
1043	$(ALTPICS)
1044
1045CLOBBERFILES +=	$(LIB_PIC)
1046
1047# list of C source for lint
1048SRCS=							\
1049	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
1050	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
1051	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
1052	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
1053	$(PORTFP:%.o=../port/fp/%.c)			\
1054	$(PORTGEN:%.o=../port/gen/%.c)			\
1055	$(PORTI18N:%.o=../port/i18n/%.c)		\
1056	$(PORTPRINT:%.o=../port/print/%.c)		\
1057	$(PORTREGEX:%.o=../port/regex/%.c)		\
1058	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
1059	$(PORTSYS:%.o=../port/sys/%.c)			\
1060	$(AIOOBJS:%.o=../port/aio/%.c)			\
1061	$(RTOBJS:%.o=../port/rt/%.c)			\
1062	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
1063	$(THREADSOBJS:%.o=../port/threads/%.c)		\
1064	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
1065	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1066	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
1067	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1068	$(LIBCBASE)/crt/_ftou.c				\
1069	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1070	$(LIBCBASE)/gen/byteorder.c			\
1071	$(LIBCBASE)/gen/ecvt.c				\
1072	$(LIBCBASE)/gen/getctxt.c			\
1073	$(LIBCBASE)/gen/lexp10.c			\
1074	$(LIBCBASE)/gen/llog10.c			\
1075	$(LIBCBASE)/gen/lmul.c				\
1076	$(LIBCBASE)/gen/makectxt.c			\
1077	$(LIBCBASE)/gen/siginfolst.c			\
1078	$(LIBCBASE)/gen/siglongjmp.c			\
1079	$(LIBCBASE)/gen/swapctxt.c			\
1080	$(LIBCBASE)/sys/ptrace.c
1081
1082# conditional assignments
1083$(DYNLIB) := CRTI = crti.o
1084$(DYNLIB) := CRTN = crtn.o
1085
1086# Files which need the threads .il inline template
1087TIL=				\
1088	aio.o			\
1089	alloc.o			\
1090	assfail.o		\
1091	atexit.o		\
1092	atfork.o		\
1093	cancel.o		\
1094	door_calls.o		\
1095	errno.o			\
1096	getctxt.o		\
1097	lwp.o			\
1098	ma.o			\
1099	machdep.o		\
1100	posix_aio.o		\
1101	pthr_attr.o		\
1102	pthr_barrier.o		\
1103	pthr_cond.o		\
1104	pthr_mutex.o		\
1105	pthr_rwlock.o		\
1106	pthread.o		\
1107	rand.o			\
1108	rtsched.o		\
1109	rwlock.o		\
1110	scalls.o		\
1111	sema.o			\
1112	sigaction.o		\
1113	sigev_thread.o		\
1114	spawn.o			\
1115	stack.o			\
1116	swapctxt.o		\
1117	synch.o			\
1118	tdb_agent.o		\
1119	thr.o			\
1120	thread_interface.o	\
1121	thread_pool.o		\
1122	tls.o			\
1123	tsd.o			\
1124	unwind.o
1125
1126$(TIL:%=pics/%) := CFLAGS += $(LIBCBASE)/threads/sparc.il
1127
1128# special kludge for inlines with 'cas':
1129pics/rwlock.o pics/synch.o pics/lwp.o := sparc_CFLAGS += -_gcc=-Wa,-xarch=v8plus
1130
1131# Files in port/fp subdirectory that need base.il inline template
1132IL=				\
1133	__flt_decim.o		\
1134	decimal_bin.o
1135
1136$(IL:%=pics/%) := CFLAGS += $(LIBCBASE)/fp/base.il
1137
1138# Files in fp subdirectory which need __quad.il inline template
1139QIL=				\
1140	_Q_add.o		\
1141	_Q_cmp.o		\
1142	_Q_cmpe.o		\
1143	_Q_div.o		\
1144	_Q_dtoq.o		\
1145	_Q_fcc.o		\
1146	_Q_mul.o		\
1147	_Q_qtod.o		\
1148	_Q_qtoi.o		\
1149	_Q_qtos.o		\
1150	_Q_qtou.o		\
1151	_Q_sqrt.o		\
1152	_Q_stoq.o		\
1153	_Q_sub.o
1154
1155$(QIL:%=pics/%) := CFLAGS += ../$(MACH)/fp/__quad.il
1156pics/_Q%.o := sparc_COPTFLAG = -xO4 -dalign
1157pics/__quad%.o := sparc_COPTFLAG = -xO4 -dalign
1158
1159# large-file-aware components that should be built large
1160
1161$(COMSYSOBJS64:%=pics/%) := \
1162	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1163
1164$(SYSOBJS64:%=pics/%) := \
1165	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1166
1167$(PORTGEN64:%=pics/%) := \
1168	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1169
1170$(PORTSTDIO64:%=pics/%) := \
1171	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1172
1173$(PORTSYS64:%=pics/%) := \
1174	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1175
1176$(PORTSTDIO_W:%=pics/%) := \
1177	CPPFLAGS += -D_WIDE
1178
1179$(PORTPRINT_W:%=pics/%) := \
1180	CPPFLAGS += -D_WIDE
1181
1182# printf/scanf functions to support c89-sized intmax_t variables
1183$(PORTPRINT_C89:%=pics/%) := \
1184	CPPFLAGS += -D_C89_INTMAX32
1185
1186$(PORTSTDIO_C89:%=pics/%) := \
1187	CPPFLAGS += -D_C89_INTMAX32
1188
1189$(PORTI18N_COND:%=pics/%) := \
1190	CPPFLAGS += -D_WCS_LONGLONG
1191
1192# Files which need extra optimization
1193pics/getenv.o := sparc_COPTFLAG = -xO4
1194
1195.KEEP_STATE:
1196
1197all: $(LIBS) $(LIB_PIC)
1198
1199lint	:=	CPPFLAGS += -I../$(MACH)/fp
1200lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1201lint	:=	LINTFLAGS += -mn
1202
1203lint:
1204	@echo $(LINT.c) ... $(LDLIBS)
1205	@$(LINT.c) $(SRCS) $(LDLIBS)
1206
1207$(LINTLIB):= SRCS=../port/llib-lc
1208$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1209$(LINTLIB):= LINTFLAGS=-nvx
1210
1211# object files that depend on inline template
1212$(TIL:%=pics/%): $(LIBCBASE)/threads/sparc.il
1213$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1214$(QIL:%=pics/%): ../$(MACH)/fp/__quad.il
1215
1216# include common libc targets
1217include ../Makefile.targ
1218
1219# We need to strip out all CTF and DOF data from the static library
1220$(LIB_PIC) := DIR = pics
1221$(LIB_PIC): pics $$(PICS)
1222	$(BUILD.AR)
1223	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1224	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1225	$(AR) -ts $@ > /dev/null
1226	$(POST_PROCESS_A)
1227
1228# special cases
1229$(STRETS:%=pics/%): crt/stret.s
1230	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1231	$(POST_PROCESS_O)
1232
1233crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1234	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S -K pic \
1235	    crt/_rtld.c -o crt/_rtld.s
1236	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1237	$(RM) crt/_rtld.s
1238
1239# partially built from C source
1240pics/_rtbootld.o: crt/_rtbootld.s
1241	$(AS) $(ASFLAGS) crt/_rtbootld.s -o $@
1242	$(CTFCONVERT_O)
1243
1244ASSYMDEP_OBJS=			\
1245	_lwp_mutex_unlock.o	\
1246	_stack_grow.o		\
1247	asm_subr.o		\
1248	tls_get_addr.o		\
1249	unwind_frame.o		\
1250	vforkx.o
1251
1252$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1253
1254$(ASSYMDEP_OBJS:%=pics/%): assym.h
1255
1256# assym.h build rules
1257
1258GENASSYM_C = ../$(MACH)/genassym.c
1259
1260# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1261#	live in Makefile.master
1262
1263CPPFLAGS.genassym = \
1264	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1265
1266genassym: $(GENASSYM_C)
1267	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc \
1268		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1269
1270OFFSETS = ../$(MACH)/offsets.in
1271
1272assym.h: $(OFFSETS) genassym
1273	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1274	./genassym >>$@
1275
1276# derived C source and related explicit dependencies
1277../port/gen/errlst.c + \
1278../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1279	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1280
1281pics/errlst.o: ../port/gen/errlst.c
1282
1283pics/new_list.o: ../port/gen/new_list.c
1284