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