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