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