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