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