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