xref: /illumos-gate/usr/src/lib/libc/sparc/Makefile.com (revision ce5e7d21f9e2e48a2f9b5a23ffec805e334d513e)
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 2016 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	recallocarray.o		\
584	realpath.o		\
585	reboot.o		\
586	regexpr.o		\
587	remove.o		\
588	rewinddir.o		\
589	rindex.o		\
590	scandir.o		\
591	seekdir.o		\
592	select.o		\
593	set_constraint_handler_s.o \
594	setlabel.o		\
595	setpriority.o		\
596	settimeofday.o		\
597	sh_locks.o		\
598	sigflag.o		\
599	siglist.o		\
600	sigsend.o		\
601	sigsetops.o		\
602	ssignal.o		\
603	stack.o			\
604	stpcpy.o		\
605	stpncpy.o		\
606	str2sig.o		\
607	strcase_charmap.o	\
608	strcat.o		\
609	strchrnul.o		\
610	strcspn.o		\
611	strdup.o		\
612	strerror.o		\
613	strlcat.o		\
614	strncat.o		\
615	strndup.o		\
616	strpbrk.o		\
617	strrchr.o		\
618	strsep.o		\
619	strsignal.o		\
620	strspn.o		\
621	strstr.o		\
622	strtod.o		\
623	strtoimax.o		\
624	strtok.o		\
625	strtok_r.o		\
626	strtonum.o		\
627	strtoumax.o		\
628	swab.o			\
629	swapctl.o		\
630	sysconf.o		\
631	syslog.o		\
632	tcdrain.o		\
633	tcflow.o		\
634	tcflush.o		\
635	tcgetattr.o		\
636	tcgetpgrp.o		\
637	tcgetsid.o		\
638	tcsendbreak.o		\
639	tcsetattr.o		\
640	tcsetpgrp.o		\
641	tell.o			\
642	telldir.o		\
643	tfind.o			\
644	time_data.o		\
645	time_gdata.o		\
646	timespec_get.o		\
647	tls_data.o		\
648	truncate.o		\
649	tsdalloc.o		\
650	tsearch.o		\
651	ttyname.o		\
652	ttyslot.o		\
653	ualarm.o		\
654	ucred.o			\
655	valloc.o		\
656	vlfmt.o			\
657	vpfmt.o			\
658	waitpid.o		\
659	walkstack.o		\
660	wdata.o			\
661	xgetwidth.o		\
662	xpg4.o			\
663	xpg6.o
664
665PORTINET=			\
666	inet_lnaof.o		\
667	inet_makeaddr.o		\
668	inet_network.o		\
669	inet_ntoa.o		\
670	inet_ntop.o		\
671	inet_pton.o
672
673PORTPRINT_W=			\
674	doprnt_w.o
675
676PORTPRINT=			\
677	asprintf.o		\
678	doprnt.o		\
679	fprintf.o		\
680	printf.o		\
681	snprintf.o		\
682	sprintf.o		\
683	vfprintf.o		\
684	vprintf.o		\
685	vsnprintf.o		\
686	vsprintf.o		\
687	vwprintf.o		\
688	wprintf.o
689
690# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
691PORTPRINT_C89=			\
692	vfprintf_c89.o		\
693	vprintf_c89.o		\
694	vsnprintf_c89.o		\
695	vsprintf_c89.o		\
696	vwprintf_c89.o
697
698PORTSTDIO_C89=			\
699	vscanf_c89.o		\
700	vwscanf_c89.o
701
702# portable stdio objects that contain large file interfaces.
703# Note: fopen64 is a special case, as we build it small.
704PORTSTDIO64=			\
705	fopen64.o		\
706	fpos64.o
707
708PORTSTDIO_W=			\
709	doscan_w.o
710
711PORTSTDIO=			\
712	__extensions.o		\
713	_endopen.o		\
714	_filbuf.o		\
715	_findbuf.o		\
716	_flsbuf.o		\
717	_wrtchk.o		\
718	clearerr.o		\
719	ctermid.o		\
720	ctermid_r.o		\
721	cuserid.o		\
722	data.o			\
723	doscan.o		\
724	fdopen.o		\
725	feof.o			\
726	ferror.o		\
727	fgetc.o			\
728	fgets.o			\
729	fileno.o		\
730	flockf.o		\
731	flush.o			\
732	fopen.o			\
733	fpos.o			\
734	fputc.o			\
735	fputs.o			\
736	fread.o			\
737	fseek.o			\
738	fseeko.o		\
739	ftell.o			\
740	ftello.o		\
741	fwrite.o		\
742	getc.o			\
743	getchar.o		\
744	getline.o		\
745	getpass.o		\
746	gets.o			\
747	getw.o			\
748	popen.o			\
749	putc.o			\
750	putchar.o		\
751	puts.o			\
752	putw.o			\
753	rewind.o		\
754	scanf.o			\
755	setbuf.o		\
756	setbuffer.o		\
757	setvbuf.o		\
758	system.o		\
759	tempnam.o		\
760	tmpfile.o		\
761	tmpnam_r.o		\
762	ungetc.o		\
763	mse.o			\
764	vscanf.o		\
765	vwscanf.o		\
766	wscanf.o
767
768PORTI18N=			\
769	getwchar.o		\
770	putwchar.o		\
771	putws.o			\
772	strtows.o		\
773	wcsnlen.o		\
774	wcstoimax.o		\
775	wcstol.o		\
776	wcstoul.o		\
777	wcswcs.o		\
778	wscat.o			\
779	wschr.o			\
780	wscmp.o			\
781	wscpy.o			\
782	wscspn.o		\
783	wsdup.o			\
784	wslen.o			\
785	wsncat.o		\
786	wsncmp.o		\
787	wsncpy.o		\
788	wspbrk.o		\
789	wsprintf.o		\
790	wsrchr.o		\
791	wsscanf.o		\
792	wsspn.o			\
793	wstod.o			\
794	wstok.o			\
795	wstol.o			\
796	wstoll.o		\
797	wsxfrm.o		\
798	wmemchr.o		\
799	wmemcmp.o		\
800	wmemcpy.o		\
801	wmemmove.o		\
802	wmemset.o		\
803	wcsstr.o		\
804	gettext.o		\
805	gettext_real.o		\
806	gettext_util.o		\
807	gettext_gnu.o		\
808	plural_parser.o		\
809	wdresolve.o		\
810	_ctype.o		\
811	isascii.o		\
812	toascii.o
813
814PORTI18N_COND=			\
815	wcstol_longlong.o	\
816	wcstoul_longlong.o
817
818PORTLOCALE=			\
819	big5.o			\
820	btowc.o			\
821	collate.o		\
822	collcmp.o		\
823	euc.o			\
824	fnmatch.o		\
825	fgetwc.o		\
826	fgetws.o		\
827	fix_grouping.o		\
828	fputwc.o		\
829	fputws.o		\
830	fwide.o			\
831	gb18030.o		\
832	gb2312.o		\
833	gbk.o			\
834	getdate.o		\
835	isdigit.o		\
836	iswctype.o		\
837	ldpart.o		\
838	lmessages.o		\
839	lnumeric.o		\
840	lmonetary.o		\
841	localeimpl.o		\
842	localeconv.o		\
843	mbftowc.o		\
844	mblen.o			\
845	mbrlen.o		\
846	mbrtowc.o		\
847	mbsinit.o		\
848	mbsnrtowcs.o		\
849	mbsrtowcs.o		\
850	mbstowcs.o		\
851	mbtowc.o		\
852	mskanji.o		\
853	nextwctype.o		\
854	nl_langinfo.o		\
855	none.o			\
856	rune.o			\
857	runetype.o		\
858	setlocale.o		\
859	setrunelocale.o		\
860	strcasecmp.o		\
861	strcasestr.o		\
862	strcoll.o		\
863	strfmon.o		\
864	strftime.o		\
865	strncasecmp.o		\
866	strptime.o		\
867	strxfrm.o		\
868	table.o			\
869	timelocal.o		\
870	tolower.o		\
871	towlower.o		\
872	ungetwc.o		\
873	utf8.o			\
874	wcrtomb.o		\
875	wcscasecmp.o		\
876	wcscoll.o		\
877	wcsftime.o		\
878	wcsnrtombs.o		\
879	wcsrtombs.o		\
880	wcstombs.o		\
881	wcswidth.o		\
882	wcsxfrm.o		\
883	wctob.o			\
884	wctomb.o		\
885	wctrans.o		\
886	wctype.o		\
887	wcwidth.o		\
888	wscol.o
889
890AIOOBJS=			\
891	aio.o			\
892	aio_alloc.o		\
893	posix_aio.o
894
895RTOBJS=				\
896	clock_timer.o		\
897	mqueue.o		\
898	pos4obj.o		\
899	sched.o			\
900	sem.o			\
901	shm.o			\
902	sigev_thread.o
903
904TPOOLOBJS=			\
905	thread_pool.o
906
907THREADSOBJS=			\
908	alloc.o			\
909	assfail.o		\
910	cancel.o		\
911	c11_thr.o		\
912	door_calls.o		\
913	tmem.o			\
914	pthr_attr.o		\
915	pthr_barrier.o		\
916	pthr_cond.o		\
917	pthr_mutex.o		\
918	pthr_rwlock.o		\
919	pthread.o		\
920	rwlock.o		\
921	scalls.o		\
922	sema.o			\
923	sigaction.o		\
924	spawn.o			\
925	synch.o			\
926	tdb_agent.o		\
927	thr.o			\
928	thread_interface.o	\
929	tls.o			\
930	tsd.o
931
932THREADSMACHOBJS=		\
933	machdep.o
934
935THREADSASMOBJS=			\
936	asm_subr.o
937
938UNICODEOBJS=			\
939	u8_textprep.o		\
940	uconv.o
941
942UNWINDMACHOBJS=			\
943	unwind.o
944
945UNWINDASMOBJS=			\
946	unwind_frame.o
947
948# objects that implement the transitional large file API
949PORTSYS64=			\
950	lockf64.o		\
951	stat64.o
952
953PORTSYS=			\
954	_autofssys.o		\
955	access.o		\
956	acctctl.o		\
957	bsd_signal.o		\
958	chmod.o			\
959	chown.o			\
960	corectl.o		\
961	epoll.o			\
962	eventfd.o		\
963	exacctsys.o		\
964	execl.o			\
965	execle.o		\
966	execv.o			\
967	fcntl.o			\
968	getpagesizes.o		\
969	getpeerucred.o		\
970	inst_sync.o		\
971	issetugid.o		\
972	label.o			\
973	link.o			\
974	lockf.o			\
975	lwp.o			\
976	lwp_cond.o		\
977	lwp_rwlock.o		\
978	lwp_sigmask.o		\
979	meminfosys.o		\
980	mkdir.o			\
981	mknod.o			\
982	msgsys.o		\
983	nfssys.o		\
984	open.o			\
985	pgrpsys.o		\
986	posix_sigwait.o		\
987	ppriv.o			\
988	psetsys.o		\
989	rctlsys.o		\
990	readlink.o		\
991	rename.o		\
992	sbrk.o			\
993	semsys.o		\
994	set_errno.o		\
995	sharefs.o		\
996	shmsys.o		\
997	sidsys.o		\
998	siginterrupt.o		\
999	signal.o		\
1000	signalfd.o		\
1001	sigpending.o		\
1002	sigstack.o		\
1003	stat.o			\
1004	symlink.o		\
1005	tasksys.o		\
1006	time.o			\
1007	time_util.o		\
1008	timerfd.o		\
1009	ucontext.o		\
1010	unlink.o		\
1011	ustat.o			\
1012	utimesys.o		\
1013	zone.o
1014
1015PORTREGEX=			\
1016	glob.o			\
1017	regcmp.o		\
1018	regcomp.o		\
1019	regerror.o		\
1020	regex.o			\
1021	regexec.o		\
1022	regfree.o		\
1023	wordexp.o
1024
1025PORTREGEX64=			\
1026	glob64.o
1027
1028VALUES=	values-Xa.o
1029
1030MOSTOBJS=			\
1031	$(STRETS)		\
1032	$(CRTOBJS)		\
1033	$(DYNOBJS)		\
1034	$(FPOBJS)		\
1035	$(FPASMOBJS)		\
1036	$(ATOMICOBJS)		\
1037	$(CHACHAOBJS)		\
1038	$(XATTROBJS)		\
1039	$(COMOBJS)		\
1040	$(DTRACEOBJS)		\
1041	$(GENOBJS)		\
1042	$(PRFOBJS)		\
1043	$(PORTFP)		\
1044	$(PORTGEN)		\
1045	$(PORTGEN64)		\
1046	$(PORTI18N)		\
1047	$(PORTI18N_COND)	\
1048	$(PORTINET)		\
1049	$(PORTLOCALE)		\
1050	$(PORTPRINT)		\
1051	$(PORTPRINT_C89)	\
1052	$(PORTPRINT_W)		\
1053	$(PORTREGEX)		\
1054	$(PORTREGEX64)		\
1055	$(PORTSTDIO)		\
1056	$(PORTSTDIO64)		\
1057	$(PORTSTDIO_C89)	\
1058	$(PORTSTDIO_W)		\
1059	$(PORTSYS)		\
1060	$(PORTSYS64)		\
1061	$(AIOOBJS)		\
1062	$(RTOBJS)		\
1063	$(SECFLAGSOBJS)		\
1064	$(TPOOLOBJS)		\
1065	$(THREADSOBJS)		\
1066	$(THREADSMACHOBJS)	\
1067	$(THREADSASMOBJS)	\
1068	$(UNICODEOBJS)		\
1069	$(UNWINDMACHOBJS)	\
1070	$(UNWINDASMOBJS)	\
1071	$(COMSYSOBJS)		\
1072	$(SYSOBJS)		\
1073	$(COMSYSOBJS64)		\
1074	$(SYSOBJS64)		\
1075	$(VALUES)
1076
1077TRACEOBJS=			\
1078	plockstat.o
1079
1080# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
1081# modules whose source is provided in the $(SRC)/lib/crt directory.
1082# This must be done because otherwise the Sun C compiler would insert
1083# its own versions of these modules and those versions contain code
1084# to call out to C++ initialization functions.  Such C++ initialization
1085# functions can call back into libc before thread initialization is
1086# complete and this leads to segmentation violations and other problems.
1087# Since libc contains no C++ code, linking with the minimal crti.o and
1088# crtn.o modules is safe and avoids the problems described above.
1089OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
1090CRTSRCS= ../../crt/sparc
1091
1092# include common library definitions
1093include $(SRC)/lib/Makefile.lib
1094
1095# we need to override the default SONAME here because we might
1096# be building a variant object (still libc.so.1, but different filename)
1097SONAME = libc.so.1
1098
1099CFLAGS += $(CCVERBOSE)
1100
1101# This is necessary to avoid problems with calling _ex_unwind().
1102# We probably don't want any inlining anyway.
1103CFLAGS += -xinline=
1104
1105CERRWARN += -_gcc=-Wno-parentheses
1106CERRWARN += -_gcc=-Wno-switch
1107CERRWARN += -_gcc=-Wno-uninitialized
1108CERRWARN += -_gcc=-Wno-unused-value
1109CERRWARN += -_gcc=-Wno-unused-label
1110CERRWARN += -_gcc=-Wno-unused-variable
1111CERRWARN += -_gcc=-Wno-type-limits
1112CERRWARN += -_gcc=-Wno-char-subscripts
1113CERRWARN += -_gcc=-Wno-clobbered
1114CERRWARN += -_gcc=-Wno-unused-function
1115CERRWARN += -_gcc=-Wno-address
1116
1117# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
1118# enables ASSERT() checking in the threads portion of the library.
1119# This is automatically enabled for DEBUG builds, not for non-debug builds.
1120THREAD_DEBUG =
1121$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
1122
1123# Make string literals read-only to save memory.
1124CFLAGS += $(XSTRCONST)
1125
1126ALTPICS= $(TRACEOBJS:%=pics/%)
1127
1128$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
1129
1130MAPFILES =	$(LIBCDIR)/port/mapfile-vers
1131
1132CFLAGS +=	$(EXTN_CFLAGS)
1133CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
1134		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
1135ASFLAGS=	$(EXTN_ASFLAGS) $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(sparc_AS_XARCH)
1136
1137# As a favor to the dtrace syscall provider, libc still calls the
1138# old syscall traps that have been obsoleted by the *at() interfaces.
1139# Delete this to compile libc using only the new *at() system call traps
1140CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
1141
1142# Inform the run-time linker about libc specialized initialization
1143RTLDINFO =	-z rtldinfo=tls_rtldinfo
1144DYNFLAGS +=	$(RTLDINFO)
1145
1146# Force libc's internal references to be resolved immediately upon loading
1147# in order to avoid critical region problems.  Since almost all libc symbols
1148# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
1149DYNFLAGS +=	-znow
1150
1151DYNFLAGS +=	-e __rtboot
1152DYNFLAGS +=	$(EXTN_DYNFLAGS)
1153
1154# Inform the kernel about the initial DTrace area (in case
1155# libc is being used as the interpreter / runtime linker).
1156DTRACE_DATA =	-zdtrace=dtrace_data
1157DYNFLAGS +=	$(DTRACE_DATA)
1158
1159# DTrace needs an executable data segment.
1160MAPFILE.NED=
1161
1162BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
1163
1164# Override this top level flag so the compiler builds in its native
1165# C99 mode.  This has been enabled to support the complex arithmetic
1166# added to libc.
1167CSTD=	$(CSTD_GNU99)
1168
1169# libc method of building an archive
1170# The "$(GREP) -v ' L '" part is necessary only until
1171# lorder is fixed to ignore thread-local variables.
1172BUILD.AR= $(RM) $@ ; \
1173	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
1174
1175# extra files for the clean target
1176CLEANFILES=			\
1177	$(LIBCDIR)/port/gen/errlst.c	\
1178	$(LIBCDIR)/port/gen/new_list.c	\
1179	assym.h			\
1180	genassym		\
1181	$(LIBCBASE)/crt/_rtld.s		\
1182	$(LIBCBASE)/crt/_rtbootld.s		\
1183	pics/_rtbootld.o	\
1184	pics/crti.o		\
1185	pics/crtn.o		\
1186	$(ALTPICS)
1187
1188CLOBBERFILES +=	$(LIB_PIC)
1189
1190# conditional assignments
1191$(DYNLIB) := CRTI = crti.o
1192$(DYNLIB) := CRTN = crtn.o
1193
1194# Files which need the threads .il inline template
1195TIL=				\
1196	aio.o			\
1197	alloc.o			\
1198	assfail.o		\
1199	atexit.o		\
1200	atfork.o		\
1201	cancel.o		\
1202	door_calls.o		\
1203	err.o			\
1204	errno.o			\
1205	getctxt.o		\
1206	lwp.o			\
1207	ma.o			\
1208	machdep.o		\
1209	posix_aio.o		\
1210	pthr_attr.o		\
1211	pthr_barrier.o		\
1212	pthr_cond.o		\
1213	pthr_mutex.o		\
1214	pthr_rwlock.o		\
1215	pthread.o		\
1216	rand.o			\
1217	rwlock.o		\
1218	scalls.o		\
1219	sched.o			\
1220	sema.o			\
1221	sigaction.o		\
1222	sigev_thread.o		\
1223	spawn.o			\
1224	stack.o			\
1225	swapctxt.o		\
1226	synch.o			\
1227	tdb_agent.o		\
1228	thr.o			\
1229	thread_interface.o	\
1230	thread_pool.o		\
1231	tls.o			\
1232	tsd.o			\
1233	unwind.o
1234
1235$(TIL:%=pics/%) := CFLAGS += $(LIBCBASE)/threads/sparc.il
1236
1237# special kludge for inlines with 'cas':
1238pics/rwlock.o pics/synch.o pics/lwp.o pics/door_calls.o := \
1239	sparc_CFLAGS += -_gcc=-Wa,-xarch=v8plus
1240
1241# Files in port/fp subdirectory that need base.il inline template
1242IL=				\
1243	__flt_decim.o		\
1244	decimal_bin.o
1245
1246$(IL:%=pics/%) := CFLAGS += $(LIBCBASE)/fp/base.il
1247
1248# Files in fp subdirectory which need __quad.il inline template
1249QIL=				\
1250	_Q_add.o		\
1251	_Q_cmp.o		\
1252	_Q_cmpe.o		\
1253	_Q_div.o		\
1254	_Q_dtoq.o		\
1255	_Q_fcc.o		\
1256	_Q_mul.o		\
1257	_Q_qtod.o		\
1258	_Q_qtoi.o		\
1259	_Q_qtos.o		\
1260	_Q_qtou.o		\
1261	_Q_sqrt.o		\
1262	_Q_stoq.o		\
1263	_Q_sub.o
1264
1265$(QIL:%=pics/%) := CFLAGS += $(LIBCDIR)/$(MACH)/fp/__quad.il
1266pics/_Q%.o := sparc_COPTFLAG = -xO4 -dalign
1267pics/__quad%.o := sparc_COPTFLAG = -xO4 -dalign
1268
1269# large-file-aware components that should be built large
1270
1271$(COMSYSOBJS64:%=pics/%) := \
1272	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1273
1274$(SYSOBJS64:%=pics/%) := \
1275	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1276
1277$(PORTGEN64:%=pics/%) := \
1278	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1279
1280$(PORTREGEX64:%=pics/%) := \
1281	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1282
1283$(PORTSTDIO64:%=pics/%) := \
1284	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1285
1286$(PORTSYS64:%=pics/%) := \
1287	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1288
1289$(PORTSTDIO_W:%=pics/%) := \
1290	CPPFLAGS += -D_WIDE
1291
1292$(PORTPRINT_W:%=pics/%) := \
1293	CPPFLAGS += -D_WIDE
1294
1295# printf/scanf functions to support c89-sized intmax_t variables
1296$(PORTPRINT_C89:%=pics/%) := \
1297	CPPFLAGS += -D_C89_INTMAX32
1298
1299$(PORTSTDIO_C89:%=pics/%) := \
1300	CPPFLAGS += -D_C89_INTMAX32
1301
1302$(PORTI18N_COND:%=pics/%) := \
1303	CPPFLAGS += -D_WCS_LONGLONG
1304
1305pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
1306
1307# Files which need extra optimization
1308pics/getenv.o := sparc_COPTFLAG = -xO4
1309
1310.KEEP_STATE:
1311
1312all: $(LIBS) $(LIB_PIC)
1313
1314# object files that depend on inline template
1315$(TIL:%=pics/%): $(LIBCBASE)/threads/sparc.il
1316$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1317$(QIL:%=pics/%): $(LIBCDIR)/$(MACH)/fp/__quad.il
1318
1319# include common libc targets
1320include $(LIBCDIR)/Makefile.targ
1321
1322# We need to strip out all CTF and DOF data from the static library
1323$(LIB_PIC) := DIR = pics
1324$(LIB_PIC): pics $$(PICS)
1325	$(BUILD.AR)
1326	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1327	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1328	$(AR) -ts $@ > /dev/null
1329	$(POST_PROCESS_A)
1330
1331# special cases
1332$(STRETS:%=pics/%): $(LIBCBASE)/crt/stret.s
1333	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) $(LIBCBASE)/crt/stret.s -o $@
1334	$(POST_PROCESS_S_O)
1335
1336$(LIBCBASE)/crt/_rtbootld.s:	$(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
1337	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
1338	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
1339	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
1340	$(RM) $(LIBCBASE)/crt/_rtld.s
1341
1342# partially built from C source
1343pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
1344	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
1345	$(CTFCONVERT_O)
1346
1347ASSYMDEP_OBJS=			\
1348	_lwp_mutex_unlock.o	\
1349	_stack_grow.o		\
1350	asm_subr.o		\
1351	setjmp.o		\
1352	smt_pause.o		\
1353	tls_get_addr.o		\
1354	unwind_frame.o		\
1355	vforkx.o
1356
1357$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1358
1359$(ASSYMDEP_OBJS:%=pics/%): assym.h
1360
1361# assym.h build rules
1362
1363assym.h := CFLAGS += $(CCGDEBUG)
1364
1365GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1366
1367genassym: $(GENASSYM_C)
1368	$(NATIVECC) $(NATIVE_CFLAGS) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc \
1369		$(CPPFLAGS.native) -o $@ $(GENASSYM_C)
1370
1371OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1372
1373assym.h: $(OFFSETS) genassym
1374	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1375	./genassym >>$@
1376
1377# derived C source and related explicit dependencies
1378$(LIBCDIR)/port/gen/errlst.c + \
1379$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1380	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1381
1382pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
1383
1384pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1385