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