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