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