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