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