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