xref: /titanic_51/usr/src/lib/libc/sparcv9/Makefile (revision 53a7b6b6763f5865522a76e5e887390a8f4777d7)
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
26LIBCBASE=.
27
28LIBRARY= libc.a
29LIB_PIC= libc_pic.a
30VERS=	.1
31CPP=	/usr/lib/cpp
32TARGET_ARCH=	sparc
33
34# objects are grouped by source directory
35
36# local objects
37STRETS=
38
39CRTOBJS=			\
40	__align_cpy_2.o		\
41	__align_cpy_4.o		\
42	__align_cpy_8.o		\
43	_ftou.o			\
44	cerror.o
45
46DYNOBJS=
47
48FPOBJS=				\
49	_D_cplx_div.o		\
50	_D_cplx_div_ix.o	\
51	_D_cplx_div_rx.o	\
52	_D_cplx_mul.o		\
53	_F_cplx_div.o		\
54	_F_cplx_div_ix.o	\
55	_F_cplx_div_rx.o	\
56	_F_cplx_mul.o		\
57	_Q_add.o		\
58	_Q_cmp.o		\
59	_Q_cmpe.o		\
60	_Q_cplx_div.o		\
61	_Q_cplx_div_ix.o	\
62	_Q_cplx_div_rx.o	\
63	_Q_cplx_lr_div.o	\
64	_Q_cplx_lr_div_ix.o	\
65	_Q_cplx_lr_div_rx.o	\
66	_Q_cplx_lr_mul.o	\
67	_Q_cplx_mul.o		\
68	_Q_div.o		\
69	_Q_dtoq.o		\
70	_Q_fcc.o		\
71	_Q_itoq.o		\
72	_Q_mul.o		\
73	_Q_neg.o		\
74	_Q_qtod.o		\
75	_Q_qtoi.o		\
76	_Q_qtos.o		\
77	_Q_qtou.o		\
78	_Q_scl.o		\
79	_Q_sqrt.o		\
80	_Q_stoq.o		\
81	_Q_sub.o		\
82	_Q_utoq.o
83
84FPOBJS64=			\
85	_Qp_qtox.o		\
86	_Qp_qtoux.o		\
87	_Qp_xtoq.o		\
88	_Qp_uxtoq.o		\
89	__dtoul.o		\
90	__ftoul.o
91
92FPASMOBJS=			\
93	_Q_get_rp_rd.o		\
94	__quad_mag64.o		\
95	fpgetmask.o		\
96	fpgetrnd.o		\
97	fpgetsticky.o		\
98	fpsetmask.o		\
99	fpsetrnd.o		\
100	fpsetsticky.o
101
102$(__GNUC)FPASMOBJS +=		\
103	__quad.o
104
105ATOMICOBJS=			\
106	atomic.o
107
108XATTROBJS=			\
109	xattr_common.o
110
111COMOBJS=			\
112	bcmp.o			\
113	bcopy.o			\
114	bsearch.o		\
115	bzero.o			\
116	ffs.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	byteorder.o		\
128	cuexit.o		\
129	ecvt.o			\
130	getctxt.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	strnlen.o		\
152	swapctxt.o		\
153	sync_instruction_memory.o
154
155# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
156# This macro should ALWAYS be empty; native APIs are already 'large file'.
157COMSYSOBJS64=
158
159SYSOBJS64=
160
161COMSYSOBJS=			\
162	__clock_timer.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	_rpcsys.o		\
174	_sigaction.o		\
175	_so_accept.o		\
176	_so_bind.o		\
177	_so_connect.o		\
178	_so_getpeername.o	\
179	_so_getsockname.o	\
180	_so_getsockopt.o	\
181	_so_listen.o		\
182	_so_recv.o		\
183	_so_recvfrom.o		\
184	_so_recvmsg.o		\
185	_so_send.o		\
186	_so_sendmsg.o		\
187	_so_sendto.o		\
188	_so_setsockopt.o	\
189	_so_shutdown.o		\
190	_so_socket.o		\
191	_so_socketpair.o	\
192	_sockconfig.o		\
193	access.o		\
194	acct.o			\
195	acl.o			\
196	adjtime.o		\
197	alarm.o			\
198	brk.o			\
199	chdir.o			\
200	chmod.o			\
201	chown.o			\
202	chroot.o		\
203	cladm.o			\
204	close.o			\
205	creat.o			\
206	dup.o			\
207	execve.o		\
208	exit.o			\
209	facl.o			\
210	fchdir.o		\
211	fchmod.o		\
212	fchown.o		\
213	fchroot.o		\
214	fcntl.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	getpid.o		\
230	getpmsg.o		\
231	getppid.o		\
232	getrlimit.o		\
233	getuid.o		\
234	gtty.o			\
235	install_utrap.o		\
236	ioctl.o			\
237	kaio.o			\
238	kill.o			\
239	lchown.o		\
240	link.o			\
241	llseek.o		\
242	lseek.o			\
243	lstat.o			\
244	memcntl.o		\
245	mincore.o		\
246	mkdir.o			\
247	mknod.o			\
248	mmap.o			\
249	mmapobjsys.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	rename.o		\
275	resolvepath.o		\
276	rmdir.o			\
277	seteguid.o		\
278	setgid.o		\
279	setgroups.o		\
280	setitimer.o		\
281	setreid.o		\
282	setrlimit.o		\
283	setuid.o		\
284	sigaltstk.o		\
285	sigprocmsk.o		\
286	sigsendset.o		\
287	sigsuspend.o		\
288	stat.o			\
289	statfs.o		\
290	statvfs.o		\
291	stty.o			\
292	symlink.o		\
293	sync.o			\
294	sysconfig.o		\
295	sysfs.o			\
296	sysinfo.o		\
297	syslwp.o		\
298	times.o			\
299	ulimit.o		\
300	umask.o			\
301	umount2.o		\
302	unlink.o		\
303	utime.o			\
304	utimes.o		\
305	utssys.o		\
306	uucopy.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	forkx.o			\
320	forkallx.o		\
321	gettimeofday.o		\
322	pipe.o			\
323	sparc_utrap_install.o	\
324	syscall.o		\
325	tls_get_addr.o		\
326	uadmin.o		\
327	umount.o		\
328	uname.o			\
329	vforkx.o
330
331# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
332# This macro should ALWAYS be empty; native APIs are already 'large file'.
333PORTGEN64=
334
335# objects from source under ../port
336PORTFP=				\
337	__flt_decim.o		\
338	__flt_rounds.o		\
339	__tbl_10_b.o		\
340	__tbl_10_h.o		\
341	__tbl_10_s.o		\
342	__tbl_2_b.o		\
343	__tbl_2_h.o		\
344	__tbl_2_s.o		\
345	__tbl_fdq.o		\
346	__tbl_tens.o		\
347	__x_power.o		\
348	_base_sup.o		\
349	aconvert.o		\
350	decimal_bin.o		\
351	double_decim.o		\
352	econvert.o		\
353	fconvert.o		\
354	file_decim.o		\
355	finite.o		\
356	fp_data.o		\
357	func_decim.o		\
358	gconvert.o		\
359	hex_bin.o		\
360	ieee_globals.o		\
361	pack_float.o		\
362	sigfpe.o		\
363	string_decim.o
364
365PORTGEN=			\
366	_env_data.o		\
367	_xftw.o			\
368	a64l.o			\
369	abort.o			\
370	addsev.o		\
371	assert.o		\
372	attrat.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	deflt.o			\
399	directio.o		\
400	dirname.o		\
401	div.o			\
402	drand48.o		\
403	dup2.o			\
404	env_data.o		\
405	err.o			\
406	errno.o			\
407	euclen.o		\
408	event_port.o		\
409	execvp.o		\
410	fattach.o		\
411	fdetach.o		\
412	fdopendir.o		\
413	fmtmsg.o		\
414	ftime.o			\
415	ftok.o			\
416	ftw.o			\
417	gcvt.o			\
418	getauxv.o		\
419	getcwd.o		\
420	getdate_err.o		\
421	getdtblsize.o		\
422	getenv.o		\
423	getexecname.o		\
424	getgrnam.o		\
425	getgrnam_r.o		\
426	gethostid.o		\
427	gethostname.o		\
428	gethz.o			\
429	getisax.o		\
430	getloadavg.o		\
431	getlogin.o		\
432	getmntent.o		\
433	getnetgrent.o		\
434	getopt.o		\
435	getopt_long.o		\
436	getpagesize.o		\
437	getpw.o			\
438	getpwnam.o		\
439	getpwnam_r.o		\
440	getrusage.o		\
441	getspent.o		\
442	getspent_r.o		\
443	getsubopt.o		\
444	gettxt.o		\
445	getusershell.o		\
446	getut.o			\
447	getutx.o		\
448	getvfsent.o		\
449	getwd.o			\
450	getwidth.o		\
451	getxby_door.o		\
452	gtxt.o			\
453	hsearch.o		\
454	iconv.o			\
455	imaxabs.o		\
456	imaxdiv.o		\
457	index.o			\
458	initgroups.o		\
459	insque.o		\
460	isaexec.o		\
461	isastream.o		\
462	isatty.o		\
463	killpg.o		\
464	klpdlib.o		\
465	l64a.o			\
466	lckpwdf.o		\
467	lconstants.o		\
468	ldivide.o		\
469	lexp10.o		\
470	lfind.o			\
471	lfmt.o			\
472	lfmt_log.o		\
473	lldiv.o			\
474	llog10.o		\
475	lltostr.o		\
476	lmath.o			\
477	localtime.o		\
478	lsearch.o		\
479	madvise.o		\
480	malloc.o		\
481	memalign.o		\
482	mkdev.o			\
483	mkdtemp.o		\
484	mkfifo.o		\
485	mkstemp.o		\
486	mktemp.o		\
487	mlock.o			\
488	mlockall.o		\
489	mon.o			\
490	msync.o			\
491	munlock.o		\
492	munlockall.o		\
493	ndbm.o			\
494	nftw.o			\
495	nlspath_checks.o	\
496	nsparse.o		\
497	nss_common.o		\
498	nss_dbdefs.o		\
499	nss_deffinder.o		\
500	opendir.o		\
501	opt_data.o		\
502	perror.o		\
503	pfmt.o			\
504	pfmt_data.o		\
505	pfmt_print.o		\
506	plock.o			\
507	poll.o			\
508	posix_fadvise.o		\
509	posix_fallocate.o	\
510	posix_madvise.o		\
511	posix_memalign.o	\
512	priocntl.o		\
513	privlib.o		\
514	priv_str_xlate.o	\
515	psiginfo.o		\
516	psignal.o		\
517	pt.o			\
518	putpwent.o		\
519	putspent.o		\
520	raise.o			\
521	rand.o			\
522	random.o		\
523	rctlops.o		\
524	readdir.o		\
525	readdir_r.o		\
526	realpath.o		\
527	reboot.o		\
528	regexpr.o		\
529	remove.o		\
530	rewinddir.o		\
531	rindex.o		\
532	scandir.o		\
533	seekdir.o		\
534	select.o		\
535	setlabel.o		\
536	setpriority.o		\
537	settimeofday.o		\
538	sh_locks.o		\
539	sigflag.o		\
540	siglist.o		\
541	sigsend.o		\
542	sigsetops.o		\
543	ssignal.o		\
544	stack.o			\
545	str2sig.o		\
546	strcase_charmap.o	\
547	strcat.o		\
548	strcspn.o		\
549	strdup.o		\
550	strerror.o		\
551	strncat.o		\
552	strlcat.o		\
553	strncasecmp.o		\
554	strpbrk.o		\
555	strrchr.o		\
556	strsep.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 -m64
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