xref: /titanic_52/usr/src/lib/libc/sparcv9/Makefile (revision ff17c8bf86c3e567734be83f90267edee20f580f)
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 2008 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	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	strnlen.o		\
154	swapctxt.o		\
155	sync_instruction_memory.o
156
157# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
158# This macro should ALWAYS be empty; native APIs are already 'large file'.
159COMSYSOBJS64=
160
161SYSOBJS64=
162
163COMSYSOBJS=			\
164	__clock_timer.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	_rpcsys.o		\
176	_sigaction.o		\
177	_so_accept.o		\
178	_so_bind.o		\
179	_so_connect.o		\
180	_so_getpeername.o	\
181	_so_getsockname.o	\
182	_so_getsockopt.o	\
183	_so_listen.o		\
184	_so_recv.o		\
185	_so_recvfrom.o		\
186	_so_recvmsg.o		\
187	_so_send.o		\
188	_so_sendmsg.o		\
189	_so_sendto.o		\
190	_so_setsockopt.o	\
191	_so_shutdown.o		\
192	_so_socket.o		\
193	_so_socketpair.o	\
194	_sockconfig.o		\
195	access.o		\
196	acct.o			\
197	acl.o			\
198	adjtime.o		\
199	alarm.o			\
200	brk.o			\
201	chdir.o			\
202	chmod.o			\
203	chown.o			\
204	chroot.o		\
205	cladm.o			\
206	close.o			\
207	creat.o			\
208	dup.o			\
209	execve.o		\
210	exit.o			\
211	facl.o			\
212	fchdir.o		\
213	fchmod.o		\
214	fchown.o		\
215	fchroot.o		\
216	fcntl.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	getpid.o		\
232	getpmsg.o		\
233	getppid.o		\
234	getrlimit.o		\
235	getuid.o		\
236	gtty.o			\
237	install_utrap.o		\
238	ioctl.o			\
239	kaio.o			\
240	kill.o			\
241	lchown.o		\
242	link.o			\
243	llseek.o		\
244	lseek.o			\
245	lstat.o			\
246	memcntl.o		\
247	mincore.o		\
248	mkdir.o			\
249	mknod.o			\
250	mmap.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	strsignal.o		\
558	strspn.o		\
559	strstr.o		\
560	strtod.o		\
561	strtoimax.o		\
562	strtok.o		\
563	strtok_r.o		\
564	strtoll.o		\
565	strtoull.o		\
566	strtoumax.o		\
567	swab.o			\
568	swapctl.o		\
569	sysconf.o		\
570	syslog.o		\
571	tcdrain.o		\
572	tcflow.o		\
573	tcflush.o		\
574	tcgetattr.o		\
575	tcgetpgrp.o		\
576	tcgetsid.o		\
577	tcsendbreak.o		\
578	tcsetattr.o		\
579	tcsetpgrp.o		\
580	tell.o			\
581	telldir.o		\
582	tfind.o			\
583	time_data.o		\
584	time_gdata.o		\
585	truncate.o		\
586	tsdalloc.o		\
587	tsearch.o		\
588	ttyname.o		\
589	ttyslot.o		\
590	ualarm.o		\
591	ucred.o			\
592	valloc.o		\
593	vlfmt.o			\
594	vpfmt.o			\
595	waitpid.o		\
596	walkstack.o		\
597	wdata.o			\
598	xgetwidth.o		\
599	xpg4.o			\
600	xpg6.o
601
602PORTPRINT_W=			\
603	doprnt_w.o
604
605PORTPRINT=			\
606	doprnt.o		\
607	fprintf.o		\
608	printf.o		\
609	snprintf.o		\
610	sprintf.o		\
611	vfprintf.o		\
612	vprintf.o		\
613	vsnprintf.o		\
614	vsprintf.o		\
615	vwprintf.o		\
616	wprintf.o
617
618# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
619# This macro should ALWAYS be empty; native APIs are already 'large file'.
620PORTSTDIO64=
621
622PORTSTDIO_W=			\
623	doscan_w.o
624
625PORTSTDIO=			\
626	__extensions.o		\
627	_endopen.o		\
628	_filbuf.o		\
629	_findbuf.o		\
630	_flsbuf.o		\
631	_wrtchk.o		\
632	clearerr.o		\
633	ctermid.o		\
634	ctermid_r.o		\
635	cuserid.o		\
636	data.o			\
637	doscan.o		\
638	fdopen.o		\
639	feof.o			\
640	ferror.o		\
641	fgetc.o			\
642	fgets.o			\
643	fileno.o		\
644	flockf.o		\
645	flush.o			\
646	fopen.o			\
647	fpos.o			\
648	fputc.o			\
649	fputs.o			\
650	fread.o			\
651	fseek.o			\
652	fseeko.o		\
653	ftell.o			\
654	ftello.o		\
655	fwrite.o		\
656	getc.o			\
657	getchar.o		\
658	getpass.o		\
659	gets.o			\
660	getw.o			\
661	popen.o			\
662	putc.o			\
663	putchar.o		\
664	puts.o			\
665	putw.o			\
666	rewind.o		\
667	scanf.o			\
668	setbuf.o		\
669	setbuffer.o		\
670	setvbuf.o		\
671	system.o		\
672	tempnam.o		\
673	tmpfile.o		\
674	tmpnam_r.o		\
675	ungetc.o		\
676	mse.o			\
677	vscanf.o		\
678	vwscanf.o		\
679	wscanf.o
680
681PORTI18N=			\
682	__fgetwc_xpg5.o		\
683	__fgetws_xpg5.o		\
684	__fputwc_xpg5.o		\
685	__fputws_xpg5.o		\
686	__ungetwc_xpg5.o	\
687	getwchar.o		\
688	putwchar.o		\
689	putws.o			\
690	strtows.o		\
691	wcstoimax.o		\
692	wcstol.o		\
693	wcstoul.o		\
694	wcswcs.o		\
695	wscasecmp.o		\
696	wscat.o			\
697	wschr.o			\
698	wscmp.o			\
699	wscpy.o			\
700	wscspn.o		\
701	wsdup.o			\
702	wslen.o			\
703	wsncasecmp.o		\
704	wsncat.o		\
705	wsncmp.o		\
706	wsncpy.o		\
707	wspbrk.o		\
708	wsprintf.o		\
709	wsrchr.o		\
710	wsscanf.o		\
711	wsspn.o			\
712	wstod.o			\
713	wstok.o			\
714	wstol.o			\
715	wstoll.o		\
716	wsxfrm.o		\
717	wmemchr.o		\
718	wmemcmp.o		\
719	wmemcpy.o		\
720	wmemmove.o		\
721	wmemset.o		\
722	wcsstr.o		\
723	gettext.o		\
724	gettext_real.o		\
725	gettext_util.o		\
726	gettext_gnu.o		\
727	plural_parser.o		\
728	wdresolve.o		\
729	_ctype.o		\
730	isascii.o		\
731	toascii.o
732
733PORTI18N_COND=			\
734	wcstol_longlong.o	\
735	wcstoul_longlong.o
736
737AIOOBJS=			\
738	aio.o			\
739	aio_alloc.o		\
740	posix_aio.o
741
742RTOBJS=				\
743	clock_timer.o		\
744	mqueue.o		\
745	pos4obj.o		\
746	sched.o			\
747	sem.o			\
748	shm.o			\
749	sigev_thread.o
750
751TPOOLOBJS=			\
752	thread_pool.o
753
754THREADSOBJS=			\
755	alloc.o			\
756	assfail.o		\
757	cancel.o		\
758	door_calls.o		\
759	pthr_attr.o		\
760	pthr_barrier.o		\
761	pthr_cond.o		\
762	pthr_mutex.o		\
763	pthr_rwlock.o		\
764	pthread.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	fsmisc.o		\
808	fstatat.o		\
809	getpagesizes.o		\
810	getpeerucred.o		\
811	inst_sync.o		\
812	issetugid.o		\
813	label.o			\
814	libc_fcntl.o		\
815	libc_link.o		\
816	libc_open.o		\
817	lockf.o			\
818	lwp.o			\
819	lwp_cond.o		\
820	lwp_rwlock.o		\
821	lwp_sigmask.o		\
822	meminfosys.o		\
823	msgsys.o		\
824	nfssys.o		\
825	openat.o		\
826	pgrpsys.o		\
827	posix_sigwait.o		\
828	ppriv.o			\
829	psetsys.o		\
830	rctlsys.o		\
831	sbrk.o			\
832	semsys.o		\
833	set_errno.o		\
834	sharefs.o		\
835	shmsys.o		\
836	sidsys.o		\
837	siginterrupt.o		\
838	signal.o		\
839	sigpending.o		\
840	sigstack.o		\
841	tasksys.o		\
842	time.o			\
843	time_util.o		\
844	ucontext.o		\
845	ustat.o			\
846	zone.o
847
848PORTREGEX=			\
849	glob.o			\
850	regcmp.o		\
851	regex.o			\
852	wordexp.o
853
854VALUES=	values-Xa.o
855
856MOSTOBJS=			\
857	$(STRETS)		\
858	$(CRTOBJS)		\
859	$(DYNOBJS)		\
860	$(FPOBJS)		\
861	$(FPOBJS64)		\
862	$(FPASMOBJS)		\
863	$(ATOMICOBJS)		\
864	$(XATTROBJS)		\
865	$(COMOBJS)		\
866	$(GENOBJS)		\
867	$(PORTFP)		\
868	$(PORTGEN)		\
869	$(PORTGEN64)		\
870	$(PORTI18N)		\
871	$(PORTI18N_COND)	\
872	$(PORTPRINT)		\
873	$(PORTPRINT_W)		\
874	$(PORTREGEX)		\
875	$(PORTSTDIO)		\
876	$(PORTSTDIO64)		\
877	$(PORTSTDIO_W)		\
878	$(PORTSYS)		\
879	$(PORTSYS64)		\
880	$(AIOOBJS)		\
881	$(RTOBJS)		\
882	$(TPOOLOBJS)		\
883	$(THREADSOBJS)		\
884	$(THREADSMACHOBJS)	\
885	$(THREADSASMOBJS)	\
886	$(UNICODEOBJS)		\
887	$(UNWINDMACHOBJS)	\
888	$(UNWINDASMOBJS)	\
889	$(COMSYSOBJS)		\
890	$(SYSOBJS)		\
891	$(COMSYSOBJS64)		\
892	$(SYSOBJS64)		\
893	$(VALUES)
894
895TRACEOBJS=			\
896	plockstat.o
897
898# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
899# modules whose source is provided in the $(SRC)/lib/common directory.
900# This must be done because otherwise the Sun C compiler would insert
901# its own versions of these modules and those versions contain code
902# to call out to C++ initialization functions.  Such C++ initialization
903# functions can call back into libc before thread initialization is
904# complete and this leads to segmentation violations and other problems.
905# Since libc contains no C++ code, linking with the minimal crti.o and
906# crtn.o modules is safe and avoids the problems described above.
907OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
908CRTSRCS= ../../common/sparcv9
909
910# include common library definitions
911include ../../Makefile.lib
912include ../../Makefile.lib.64
913
914# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
915# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
916# need to be compatible with the ones for the libc stuff.  Whenever the changes
917# that affect the compilation conditions of libc happened, those for libc_i18n
918# also need to be updated.
919
920CFLAGS64 += $(CCVERBOSE)
921
922# This is necessary to avoid problems with calling _ex_unwind().
923# We probably don't want any inlining anyway.
924CFLAGS64 += -xinline=
925
926# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
927# enables ASSERT() checking in the threads portion of the library.
928# This is automatically enabled for DEBUG builds, not for non-debug builds.
929THREAD_DEBUG =
930$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
931
932ALTPICS= $(TRACEOBJS:%=pics/%)
933
934$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
935$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
936
937MAPFILES =	../port/mapfile-vers mapfile-vers
938
939sparcv9_C_PICFLAGS= -K PIC
940CFLAGS64 +=	$(EXTN_CFLAGS)
941CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
942		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
943ASFLAGS=	-K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
944		$(sparcv9_AS_XARCH)
945
946# Conditionally add support for making |wordexp()| check whether
947# /usr/bin/ksh is ksh93 or not
948include ../../../Makefile.ksh93switch
949CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
950
951# Inform the run-time linker about libc specialized initialization
952RTLDINFO =	-z rtldinfo=tls_rtldinfo
953DYNFLAGS +=	$(RTLDINFO)
954
955DYNFLAGS +=	$(EXTN_DYNFLAGS)
956
957BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
958
959# Override this top level flag so the compiler builds in its native
960# C99 mode.  This has been enabled to support the complex arithmetic
961# added to libc.
962C99MODE=	$(C99_ENABLE)
963
964# libc method of building an archive
965BUILD.AR= $(RM) $@ ; \
966	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
967
968# extra files for the clean target
969CLEANFILES=			\
970	../port/gen/errlst.c	\
971	../port/gen/new_list.c	\
972	assym.h			\
973	genassym		\
974	pics/crti.o		\
975	pics/crtn.o		\
976	$(ALTPICS)
977
978CLOBBERFILES +=	$(LIB_PIC)
979
980# list of C source for lint
981SRCS=							\
982	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
983	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
984	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
985	$(PORTFP:%.o=../port/fp/%.c)			\
986	$(PORTGEN:%.o=../port/gen/%.c)			\
987	$(PORTI18N:%.o=../port/i18n/%.c)		\
988	$(PORTPRINT:%.o=../port/print/%.c)		\
989	$(PORTREGEX:%.o=../port/regex/%.c)		\
990	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
991	$(PORTSYS:%.o=../port/sys/%.c)			\
992	$(AIOOBJS:%.o=../port/aio/%.c)			\
993	$(RTOBJS:%.o=../port/rt/%.c)			\
994	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
995	$(THREADSOBJS:%.o=../port/threads/%.c)		\
996	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
997	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
998	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
999	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
1000	$(FPOBJS64:%.o=$(LIBCBASE)/fp/%.c)		\
1001	$(LIBCBASE)/crt/_ftou.c				\
1002	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1003	$(LIBCBASE)/gen/byteorder.c			\
1004	$(LIBCBASE)/gen/ecvt.c				\
1005	$(LIBCBASE)/gen/getctxt.c			\
1006	$(LIBCBASE)/gen/makectxt.c			\
1007	$(LIBCBASE)/gen/siginfolst.c			\
1008	$(LIBCBASE)/gen/siglongjmp.c			\
1009	$(LIBCBASE)/gen/swapctxt.c
1010
1011# conditional assignments
1012$(DYNLIB) := CRTI = crti.o
1013$(DYNLIB) := CRTN = crtn.o
1014
1015# Files which need the threads .il inline template
1016TIL=				\
1017	aio.o			\
1018	alloc.o			\
1019	assfail.o		\
1020	atexit.o		\
1021	atfork.o		\
1022	cancel.o		\
1023	door_calls.o		\
1024	errno.o			\
1025	getctxt.o		\
1026	lwp.o			\
1027	ma.o			\
1028	machdep.o		\
1029	posix_aio.o		\
1030	pthr_attr.o		\
1031	pthr_barrier.o		\
1032	pthr_cond.o		\
1033	pthr_mutex.o		\
1034	pthr_rwlock.o		\
1035	pthread.o		\
1036	rand.o			\
1037	rwlock.o		\
1038	scalls.o		\
1039	sched.o			\
1040	sema.o			\
1041	sigaction.o		\
1042	sigev_thread.o		\
1043	spawn.o			\
1044	stack.o			\
1045	swapctxt.o		\
1046	synch.o			\
1047	tdb_agent.o		\
1048	thr.o			\
1049	thread_interface.o	\
1050	thread_pool.o		\
1051	tls.o			\
1052	tsd.o			\
1053	unwind.o
1054
1055$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1056
1057# Files in fp, port/fp subdirectories that need base.il inline template
1058IL=				\
1059	__flt_decim.o		\
1060	decimal_bin.o
1061
1062$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1063
1064# Files in fp subdirectory which need __quad.il inline template
1065QIL=				\
1066	_Q_add.o		\
1067	_Q_cmp.o		\
1068	_Q_cmpe.o		\
1069	_Q_div.o		\
1070	_Q_dtoq.o		\
1071	_Q_fcc.o		\
1072	_Q_mul.o		\
1073	_Q_qtod.o		\
1074	_Q_qtoi.o		\
1075	_Q_qtos.o		\
1076	_Q_qtou.o		\
1077	_Q_sqrt.o		\
1078	_Q_stoq.o		\
1079	_Q_sub.o		\
1080	_Qp_qtox.o		\
1081	_Qp_qtoux.o
1082
1083$(QIL:%=pics/%) := CFLAGS64 += ../$(MACH)/fp/__quad.il
1084pics/_Qp%.o := CFLAGS64 += -I../$(MACH)/fp
1085pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1086
1087# Files in crt subdirectory which need muldiv64.il inline template
1088#CIL=	mul64.o divrem64.o
1089#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
1090
1091# large-file-aware components that should be built large
1092
1093#$(COMSYSOBJS64:%=pics/%) := \
1094#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1095
1096#$(SYSOBJS64:%=pics/%) := \
1097#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1098
1099#$(PORTGEN64:%=pics/%) := \
1100#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1101
1102#$(PORTSTDIO64:%=pics/%) := \
1103#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1104
1105#$(PORTSYS64:%=pics/%) := \
1106#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1107
1108$(PORTSTDIO_W:%=pics/%) := \
1109	CPPFLAGS += -D_WIDE
1110
1111$(PORTPRINT_W:%=pics/%) := \
1112	CPPFLAGS += -D_WIDE
1113
1114$(PORTI18N_COND:%=pics/%) := \
1115	CPPFLAGS += -D_WCS_LONGLONG
1116
1117# Files which need extra optimization
1118pics/getenv.o := sparcv9_COPTFLAG = -xO4
1119
1120.KEEP_STATE:
1121
1122all: $(LIBS) $(LIB_PIC)
1123
1124lint	:=	CPPFLAGS += -I../$(MACH)/fp
1125lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1126lint	:=	LINTFLAGS64 += -mn
1127
1128lint:
1129	@echo $(LINT.c) ... $(LDLIBS)
1130	@$(LINT.c) $(SRCS) $(LDLIBS)
1131
1132$(LINTLIB):= SRCS=../port/llib-lc
1133$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1134$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=v9
1135
1136# object files that depend on inline template
1137$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1138$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1139$(QIL:%=pics/%): ../$(MACH)/fp/__quad.il
1140#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
1141
1142# include common libc targets
1143include ../Makefile.targ
1144
1145# We need to strip out all CTF and DOF data from the static library
1146$(LIB_PIC) := DIR = pics
1147$(LIB_PIC): pics $$(PICS)
1148	$(BUILD.AR)
1149	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1150	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1151	$(AR) -ts $@ > /dev/null
1152	$(POST_PROCESS_A)
1153
1154# special cases
1155#$(STRETS:%=pics/%): crt/stret.s
1156#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1157#	$(POST_PROCESS_O)
1158
1159#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1160#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1161#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1162#	$(RM) crt/_rtld.s
1163
1164ASSYMDEP_OBJS=			\
1165	_lwp_mutex_unlock.o	\
1166	_stack_grow.o		\
1167	asm_subr.o		\
1168	tls_get_addr.o		\
1169	unwind_frame.o		\
1170	vforkx.o
1171
1172$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1173
1174$(ASSYMDEP_OBJS:%=pics/%): assym.h
1175
1176# assym.h build rules
1177
1178GENASSYM_C = ../$(MACH)/genassym.c
1179
1180# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1181#	live in Makefile.master
1182
1183CPPFLAGS.genassym = \
1184	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1185
1186genassym: $(GENASSYM_C)
1187	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc \
1188		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1189
1190OFFSETS = ../$(MACH)/offsets.in
1191
1192assym.h: $(OFFSETS) genassym
1193	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1194	./genassym >>$@
1195
1196# derived C source and related explicit dependencies
1197../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1198	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1199
1200pics/new_list.o: ../port/gen/new_list.c
1201