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