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