xref: /titanic_51/usr/src/lib/libc/sparcv9/Makefile.com (revision 613a2f6ba31e891e3d947a356daf5e563d43c1ce)
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	__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	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	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	zone.o
841
842PORTREGEX=			\
843	glob.o			\
844	regcmp.o		\
845	regex.o			\
846	wordexp.o
847
848VALUES=	values-Xa.o
849
850MOSTOBJS=			\
851	$(STRETS)		\
852	$(CRTOBJS)		\
853	$(DYNOBJS)		\
854	$(FPOBJS)		\
855	$(FPOBJS64)		\
856	$(FPASMOBJS)		\
857	$(ATOMICOBJS)		\
858	$(XATTROBJS)		\
859	$(COMOBJS)		\
860	$(GENOBJS)		\
861	$(PRFOBJS)		\
862	$(PORTFP)		\
863	$(PORTGEN)		\
864	$(PORTGEN64)		\
865	$(PORTI18N)		\
866	$(PORTI18N_COND)	\
867	$(PORTPRINT)		\
868	$(PORTPRINT_W)		\
869	$(PORTREGEX)		\
870	$(PORTSTDIO)		\
871	$(PORTSTDIO64)		\
872	$(PORTSTDIO_W)		\
873	$(PORTSYS)		\
874	$(PORTSYS64)		\
875	$(AIOOBJS)		\
876	$(RTOBJS)		\
877	$(TPOOLOBJS)		\
878	$(THREADSOBJS)		\
879	$(THREADSMACHOBJS)	\
880	$(THREADSASMOBJS)	\
881	$(UNICODEOBJS)		\
882	$(UNWINDMACHOBJS)	\
883	$(UNWINDASMOBJS)	\
884	$(COMSYSOBJS)		\
885	$(SYSOBJS)		\
886	$(COMSYSOBJS64)		\
887	$(SYSOBJS64)		\
888	$(VALUES)
889
890TRACEOBJS=			\
891	plockstat.o
892
893# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
894# modules whose source is provided in the $(SRC)/lib/common directory.
895# This must be done because otherwise the Sun C compiler would insert
896# its own versions of these modules and those versions contain code
897# to call out to C++ initialization functions.  Such C++ initialization
898# functions can call back into libc before thread initialization is
899# complete and this leads to segmentation violations and other problems.
900# Since libc contains no C++ code, linking with the minimal crti.o and
901# crtn.o modules is safe and avoids the problems described above.
902OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
903CRTSRCS= ../../common/sparcv9
904
905# include common library definitions
906include $(SRC)/lib/Makefile.lib
907include $(SRC)/lib/Makefile.lib.64
908
909# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
910# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
911# need to be compatible with the ones for the libc stuff.  Whenever the changes
912# that affect the compilation conditions of libc happened, those for libc_i18n
913# also need to be updated.
914
915# we need to override the default SONAME here because we might
916# be building a variant object (still libc.so.1, but different filename)
917SONAME = libc.so.1
918
919CFLAGS64 += $(CCVERBOSE)
920
921# This is necessary to avoid problems with calling _ex_unwind().
922# We probably don't want any inlining anyway.
923CFLAGS64 += -xinline=
924
925# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
926# enables ASSERT() checking in the threads portion of the library.
927# This is automatically enabled for DEBUG builds, not for non-debug builds.
928THREAD_DEBUG =
929$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
930
931# Make string literals read-only to save memory.
932CFLAGS64 += $(XSTRCONST)
933
934ALTPICS= $(TRACEOBJS:%=pics/%)
935
936$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
937$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
938
939MAPFILES =	$(LIBCDIR)/port/mapfile-vers $(LIBCDIR)/sparcv9/mapfile-vers \
940		$(MAPFILE_AUX)
941
942sparcv9_C_PICFLAGS= -K PIC
943CFLAGS64 +=	$(EXTN_CFLAGS)
944CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
945		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
946ASFLAGS=	$(EXTN_ASFLAGS) -K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
947		$(sparcv9_AS_XARCH)
948
949# Conditionally add support for making |wordexp()| check whether
950# /usr/bin/ksh is ksh93 or not
951include $(LIBCDIR)/../../Makefile.ksh93switch
952CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
953
954# Inform the run-time linker about libc specialized initialization
955RTLDINFO =	-z rtldinfo=tls_rtldinfo
956DYNFLAGS +=	$(RTLDINFO)
957
958DYNFLAGS +=	$(EXTN_DYNFLAGS)
959
960BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
961
962# Override this top level flag so the compiler builds in its native
963# C99 mode.  This has been enabled to support the complex arithmetic
964# added to libc.
965C99MODE=	$(C99_ENABLE)
966
967# libc method of building an archive
968BUILD.AR= $(RM) $@ ; \
969	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
970
971# extra files for the clean target
972CLEANFILES=			\
973	$(LIBCDIR)/port/gen/errlst.c	\
974	$(LIBCDIR)/port/gen/new_list.c	\
975	assym.h			\
976	genassym		\
977	pics/crti.o		\
978	pics/crtn.o		\
979	$(ALTPICS)
980
981CLOBBERFILES +=	$(LIB_PIC)
982
983# list of C source for lint
984SRCS=							\
985	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
986	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
987	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
988	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
989	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
990	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
991	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
992	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
993	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
994	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
995	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
996	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
997	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
998	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
999	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
1000	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1001	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
1002	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
1003	$(FPOBJS64:%.o=$(LIBCBASE)/fp/%.c)		\
1004	$(LIBCBASE)/crt/_ftou.c				\
1005	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1006	$(LIBCBASE)/gen/byteorder.c			\
1007	$(LIBCBASE)/gen/ecvt.c				\
1008	$(LIBCBASE)/gen/getctxt.c			\
1009	$(LIBCBASE)/gen/makectxt.c			\
1010	$(LIBCBASE)/gen/siginfolst.c			\
1011	$(LIBCBASE)/gen/siglongjmp.c			\
1012	$(LIBCBASE)/gen/swapctxt.c
1013
1014# conditional assignments
1015$(DYNLIB) := CRTI = crti.o
1016$(DYNLIB) := CRTN = crtn.o
1017
1018# Files which need the threads .il inline template
1019TIL=				\
1020	aio.o			\
1021	alloc.o			\
1022	assfail.o		\
1023	atexit.o		\
1024	atfork.o		\
1025	cancel.o		\
1026	door_calls.o		\
1027	errno.o			\
1028	getctxt.o		\
1029	lwp.o			\
1030	ma.o			\
1031	machdep.o		\
1032	posix_aio.o		\
1033	pthr_attr.o		\
1034	pthr_barrier.o		\
1035	pthr_cond.o		\
1036	pthr_mutex.o		\
1037	pthr_rwlock.o		\
1038	pthread.o		\
1039	rand.o			\
1040	rwlock.o		\
1041	scalls.o		\
1042	sched.o			\
1043	sema.o			\
1044	sigaction.o		\
1045	sigev_thread.o		\
1046	spawn.o			\
1047	stack.o			\
1048	swapctxt.o		\
1049	synch.o			\
1050	tdb_agent.o		\
1051	thr.o			\
1052	thread_interface.o	\
1053	thread_pool.o		\
1054	tls.o			\
1055	tsd.o			\
1056	unwind.o
1057
1058$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1059
1060# Files in fp, port/fp subdirectories that need base.il inline template
1061IL=				\
1062	__flt_decim.o		\
1063	decimal_bin.o
1064
1065$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1066
1067# Files in fp subdirectory which need __quad.il inline template
1068QIL=				\
1069	_Q_add.o		\
1070	_Q_cmp.o		\
1071	_Q_cmpe.o		\
1072	_Q_div.o		\
1073	_Q_dtoq.o		\
1074	_Q_fcc.o		\
1075	_Q_mul.o		\
1076	_Q_qtod.o		\
1077	_Q_qtoi.o		\
1078	_Q_qtos.o		\
1079	_Q_qtou.o		\
1080	_Q_sqrt.o		\
1081	_Q_stoq.o		\
1082	_Q_sub.o		\
1083	_Qp_qtox.o		\
1084	_Qp_qtoux.o
1085
1086$(QIL:%=pics/%) := CFLAGS64 += $(LIBCDIR)/$(MACH)/fp/__quad.il
1087pics/_Qp%.o := CFLAGS64 += -I$(LIBCDIR)/$(MACH)/fp
1088pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1089
1090# Files in crt subdirectory which need muldiv64.il inline template
1091#CIL=	mul64.o divrem64.o
1092#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
1093
1094# large-file-aware components that should be built large
1095
1096#$(COMSYSOBJS64:%=pics/%) := \
1097#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1098
1099#$(SYSOBJS64:%=pics/%) := \
1100#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1101
1102#$(PORTGEN64:%=pics/%) := \
1103#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1104
1105#$(PORTSTDIO64:%=pics/%) := \
1106#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1107
1108#$(PORTSYS64:%=pics/%) := \
1109#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1110
1111$(PORTSTDIO_W:%=pics/%) := \
1112	CPPFLAGS += -D_WIDE
1113
1114$(PORTPRINT_W:%=pics/%) := \
1115	CPPFLAGS += -D_WIDE
1116
1117$(PORTI18N_COND:%=pics/%) := \
1118	CPPFLAGS += -D_WCS_LONGLONG
1119
1120# Files which need extra optimization
1121pics/getenv.o := sparcv9_COPTFLAG = -xO4
1122
1123.KEEP_STATE:
1124
1125all: $(LIBS) $(LIB_PIC)
1126
1127lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1128lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1129lint	:=	LINTFLAGS64 += -mn
1130
1131lint:
1132	@echo $(LINT.c) ... $(LDLIBS)
1133	@$(LINT.c) $(SRCS) $(LDLIBS)
1134
1135$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1136$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1137$(LINTLIB):= LINTFLAGS64=-nvx -m64
1138
1139# object files that depend on inline template
1140$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1141$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1142$(QIL:%=pics/%): $(LIBCDIR)/$(MACH)/fp/__quad.il
1143#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
1144
1145# include common libc targets
1146include $(LIBCDIR)/Makefile.targ
1147
1148# We need to strip out all CTF and DOF data from the static library
1149$(LIB_PIC) := DIR = pics
1150$(LIB_PIC): pics $$(PICS)
1151	$(BUILD.AR)
1152	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1153	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1154	$(AR) -ts $@ > /dev/null
1155	$(POST_PROCESS_A)
1156
1157# special cases
1158#$(STRETS:%=pics/%): crt/stret.s
1159#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1160#	$(POST_PROCESS_O)
1161
1162#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1163#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1164#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1165#	$(RM) crt/_rtld.s
1166
1167ASSYMDEP_OBJS=			\
1168	_lwp_mutex_unlock.o	\
1169	_stack_grow.o		\
1170	asm_subr.o		\
1171	tls_get_addr.o		\
1172	unwind_frame.o		\
1173	vforkx.o
1174
1175$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1176
1177$(ASSYMDEP_OBJS:%=pics/%): assym.h
1178
1179# assym.h build rules
1180
1181GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1182
1183# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1184#	live in Makefile.master
1185
1186CPPFLAGS.genassym = \
1187	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1188
1189genassym: $(GENASSYM_C)
1190	$(NATIVECC) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc \
1191		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1192
1193OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1194
1195assym.h: $(OFFSETS) genassym
1196	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1197	./genassym >>$@
1198
1199# derived C source and related explicit dependencies
1200$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1201	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1202
1203pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1204