xref: /titanic_50/usr/src/lib/libc/sparcv9/Makefile.com (revision 9aa73b6813b3fd35e78fcc44fd17535e765e504c)
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	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	deflt.o			\
394	directio.o		\
395	dirname.o		\
396	div.o			\
397	drand48.o		\
398	dup2.o			\
399	env_data.o		\
400	err.o			\
401	errno.o			\
402	euclen.o		\
403	event_port.o		\
404	execvp.o		\
405	fattach.o		\
406	fdetach.o		\
407	fdopendir.o		\
408	fmtmsg.o		\
409	ftime.o			\
410	ftok.o			\
411	ftw.o			\
412	gcvt.o			\
413	getauxv.o		\
414	getcwd.o		\
415	getdate_err.o		\
416	getdtblsize.o		\
417	getenv.o		\
418	getexecname.o		\
419	getgrnam.o		\
420	getgrnam_r.o		\
421	gethostid.o		\
422	gethostname.o		\
423	gethz.o			\
424	getisax.o		\
425	getloadavg.o		\
426	getlogin.o		\
427	getmntent.o		\
428	getnetgrent.o		\
429	getopt.o		\
430	getopt_long.o		\
431	getpagesize.o		\
432	getpw.o			\
433	getpwnam.o		\
434	getpwnam_r.o		\
435	getrusage.o		\
436	getspent.o		\
437	getspent_r.o		\
438	getsubopt.o		\
439	gettxt.o		\
440	getusershell.o		\
441	getut.o			\
442	getutx.o		\
443	getvfsent.o		\
444	getwd.o			\
445	getwidth.o		\
446	getxby_door.o		\
447	gtxt.o			\
448	hsearch.o		\
449	iconv.o			\
450	imaxabs.o		\
451	imaxdiv.o		\
452	index.o			\
453	initgroups.o		\
454	insque.o		\
455	isaexec.o		\
456	isastream.o		\
457	isatty.o		\
458	killpg.o		\
459	klpdlib.o		\
460	l64a.o			\
461	lckpwdf.o		\
462	lconstants.o		\
463	ldivide.o		\
464	lexp10.o		\
465	lfind.o			\
466	lfmt.o			\
467	lfmt_log.o		\
468	lldiv.o			\
469	llog10.o		\
470	lltostr.o		\
471	lmath.o			\
472	localtime.o		\
473	lsearch.o		\
474	madvise.o		\
475	malloc.o		\
476	memalign.o		\
477	mkdev.o			\
478	mkdtemp.o		\
479	mkfifo.o		\
480	mkstemp.o		\
481	mktemp.o		\
482	mlock.o			\
483	mlockall.o		\
484	mon.o			\
485	msync.o			\
486	munlock.o		\
487	munlockall.o		\
488	ndbm.o			\
489	nftw.o			\
490	nlspath_checks.o	\
491	nsparse.o		\
492	nss_common.o		\
493	nss_dbdefs.o		\
494	nss_deffinder.o		\
495	opendir.o		\
496	opt_data.o		\
497	perror.o		\
498	pfmt.o			\
499	pfmt_data.o		\
500	pfmt_print.o		\
501	plock.o			\
502	poll.o			\
503	posix_fadvise.o		\
504	posix_fallocate.o	\
505	posix_madvise.o		\
506	posix_memalign.o	\
507	priocntl.o		\
508	privlib.o		\
509	priv_str_xlate.o	\
510	psiginfo.o		\
511	psignal.o		\
512	pt.o			\
513	putpwent.o		\
514	putspent.o		\
515	raise.o			\
516	rand.o			\
517	random.o		\
518	rctlops.o		\
519	readdir.o		\
520	readdir_r.o		\
521	realpath.o		\
522	reboot.o		\
523	regexpr.o		\
524	remove.o		\
525	rewinddir.o		\
526	rindex.o		\
527	scandir.o		\
528	seekdir.o		\
529	select.o		\
530	setlabel.o		\
531	setpriority.o		\
532	settimeofday.o		\
533	sh_locks.o		\
534	sigflag.o		\
535	siglist.o		\
536	sigsend.o		\
537	sigsetops.o		\
538	ssignal.o		\
539	stack.o			\
540	str2sig.o		\
541	strcase_charmap.o	\
542	strcat.o		\
543	strcspn.o		\
544	strdup.o		\
545	strerror.o		\
546	strncat.o		\
547	strlcat.o		\
548	strncasecmp.o		\
549	strpbrk.o		\
550	strrchr.o		\
551	strsep.o		\
552	strsignal.o		\
553	strspn.o		\
554	strstr.o		\
555	strtod.o		\
556	strtoimax.o		\
557	strtok.o		\
558	strtok_r.o		\
559	strtoumax.o		\
560	swab.o			\
561	swapctl.o		\
562	sysconf.o		\
563	syslog.o		\
564	tcdrain.o		\
565	tcflow.o		\
566	tcflush.o		\
567	tcgetattr.o		\
568	tcgetpgrp.o		\
569	tcgetsid.o		\
570	tcsendbreak.o		\
571	tcsetattr.o		\
572	tcsetpgrp.o		\
573	tell.o			\
574	telldir.o		\
575	tfind.o			\
576	time_data.o		\
577	time_gdata.o		\
578	truncate.o		\
579	tsdalloc.o		\
580	tsearch.o		\
581	ttyname.o		\
582	ttyslot.o		\
583	ualarm.o		\
584	ucred.o			\
585	valloc.o		\
586	vlfmt.o			\
587	vpfmt.o			\
588	waitpid.o		\
589	walkstack.o		\
590	wdata.o			\
591	xgetwidth.o		\
592	xpg4.o			\
593	xpg6.o
594
595PORTPRINT_W=			\
596	doprnt_w.o
597
598PORTPRINT=			\
599	asprintf.o		\
600	doprnt.o		\
601	fprintf.o		\
602	printf.o		\
603	snprintf.o		\
604	sprintf.o		\
605	vfprintf.o		\
606	vprintf.o		\
607	vsnprintf.o		\
608	vsprintf.o		\
609	vwprintf.o		\
610	wprintf.o
611
612# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
613# This macro should ALWAYS be empty; native APIs are already 'large file'.
614PORTSTDIO64=
615
616PORTSTDIO_W=			\
617	doscan_w.o
618
619PORTSTDIO=			\
620	__extensions.o		\
621	_endopen.o		\
622	_filbuf.o		\
623	_findbuf.o		\
624	_flsbuf.o		\
625	_wrtchk.o		\
626	clearerr.o		\
627	ctermid.o		\
628	ctermid_r.o		\
629	cuserid.o		\
630	data.o			\
631	doscan.o		\
632	fdopen.o		\
633	feof.o			\
634	ferror.o		\
635	fgetc.o			\
636	fgets.o			\
637	fileno.o		\
638	flockf.o		\
639	flush.o			\
640	fopen.o			\
641	fpos.o			\
642	fputc.o			\
643	fputs.o			\
644	fread.o			\
645	fseek.o			\
646	fseeko.o		\
647	ftell.o			\
648	ftello.o		\
649	fwrite.o		\
650	getc.o			\
651	getchar.o		\
652	getpass.o		\
653	gets.o			\
654	getw.o			\
655	popen.o			\
656	putc.o			\
657	putchar.o		\
658	puts.o			\
659	putw.o			\
660	rewind.o		\
661	scanf.o			\
662	setbuf.o		\
663	setbuffer.o		\
664	setvbuf.o		\
665	system.o		\
666	tempnam.o		\
667	tmpfile.o		\
668	tmpnam_r.o		\
669	ungetc.o		\
670	mse.o			\
671	vscanf.o		\
672	vwscanf.o		\
673	wscanf.o
674
675PORTI18N=			\
676	__fgetwc_xpg5.o		\
677	__fgetws_xpg5.o		\
678	__fputwc_xpg5.o		\
679	__fputws_xpg5.o		\
680	__ungetwc_xpg5.o	\
681	getwchar.o		\
682	putwchar.o		\
683	putws.o			\
684	strtows.o		\
685	wcstoimax.o		\
686	wcstol.o		\
687	wcstoul.o		\
688	wcswcs.o		\
689	wscasecmp.o		\
690	wscat.o			\
691	wschr.o			\
692	wscmp.o			\
693	wscpy.o			\
694	wscspn.o		\
695	wsdup.o			\
696	wslen.o			\
697	wsncasecmp.o		\
698	wsncat.o		\
699	wsncmp.o		\
700	wsncpy.o		\
701	wspbrk.o		\
702	wsprintf.o		\
703	wsrchr.o		\
704	wsscanf.o		\
705	wsspn.o			\
706	wstod.o			\
707	wstok.o			\
708	wstol.o			\
709	wstoll.o		\
710	wsxfrm.o		\
711	wmemchr.o		\
712	wmemcmp.o		\
713	wmemcpy.o		\
714	wmemmove.o		\
715	wmemset.o		\
716	wcsstr.o		\
717	gettext.o		\
718	gettext_real.o		\
719	gettext_util.o		\
720	gettext_gnu.o		\
721	plural_parser.o		\
722	wdresolve.o		\
723	_ctype.o		\
724	isascii.o		\
725	toascii.o
726
727PORTI18N_COND=			\
728	wcstol_longlong.o	\
729	wcstoul_longlong.o
730
731AIOOBJS=			\
732	aio.o			\
733	aio_alloc.o		\
734	posix_aio.o
735
736RTOBJS=				\
737	clock_timer.o		\
738	mqueue.o		\
739	pos4obj.o		\
740	sched.o			\
741	sem.o			\
742	shm.o			\
743	sigev_thread.o
744
745TPOOLOBJS=			\
746	thread_pool.o
747
748THREADSOBJS=			\
749	alloc.o			\
750	assfail.o		\
751	cancel.o		\
752	door_calls.o		\
753	pthr_attr.o		\
754	pthr_barrier.o		\
755	pthr_cond.o		\
756	pthr_mutex.o		\
757	pthr_rwlock.o		\
758	pthread.o		\
759	rwlock.o		\
760	scalls.o		\
761	sema.o			\
762	sigaction.o		\
763	spawn.o			\
764	synch.o			\
765	tdb_agent.o		\
766	thr.o			\
767	thread_interface.o	\
768	tls.o			\
769	tsd.o
770
771THREADSMACHOBJS=		\
772	machdep.o
773
774THREADSASMOBJS=			\
775	asm_subr.o
776
777UNICODEOBJS=			\
778	u8_textprep.o		\
779	uconv.o
780
781UNWINDMACHOBJS=			\
782	unwind.o
783
784UNWINDASMOBJS=			\
785	unwind_frame.o
786
787# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
788# This macro should ALWAYS be empty; native APIs are already 'large file'.
789PORTSYS64=
790
791PORTSYS=			\
792	_autofssys.o		\
793	acctctl.o		\
794	bsd_signal.o		\
795	corectl.o		\
796	exacctsys.o		\
797	execl.o			\
798	execle.o		\
799	execv.o			\
800	fsmisc.o		\
801	fstatat.o		\
802	getpagesizes.o		\
803	getpeerucred.o		\
804	inst_sync.o		\
805	issetugid.o		\
806	label.o			\
807	libc_fcntl.o		\
808	libc_link.o		\
809	libc_open.o		\
810	lockf.o			\
811	lwp.o			\
812	lwp_cond.o		\
813	lwp_rwlock.o		\
814	lwp_sigmask.o		\
815	meminfosys.o		\
816	msgsys.o		\
817	nfssys.o		\
818	openat.o		\
819	pgrpsys.o		\
820	posix_sigwait.o		\
821	ppriv.o			\
822	psetsys.o		\
823	rctlsys.o		\
824	sbrk.o			\
825	semsys.o		\
826	set_errno.o		\
827	sharefs.o		\
828	shmsys.o		\
829	sidsys.o		\
830	siginterrupt.o		\
831	signal.o		\
832	sigpending.o		\
833	sigstack.o		\
834	tasksys.o		\
835	time.o			\
836	time_util.o		\
837	ucontext.o		\
838	ustat.o			\
839	utimesys.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
958# Force libc's internal references to be resolved immediately upon loading
959# in order to avoid critical region problems.  Since almost all libc symbols
960# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
961DYNFLAGS +=	-znow
962
963DYNFLAGS +=	$(EXTN_DYNFLAGS)
964
965BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
966
967# Override this top level flag so the compiler builds in its native
968# C99 mode.  This has been enabled to support the complex arithmetic
969# added to libc.
970C99MODE=	$(C99_ENABLE)
971
972# libc method of building an archive
973BUILD.AR= $(RM) $@ ; \
974	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
975
976# extra files for the clean target
977CLEANFILES=			\
978	$(LIBCDIR)/port/gen/errlst.c	\
979	$(LIBCDIR)/port/gen/new_list.c	\
980	assym.h			\
981	genassym		\
982	pics/crti.o		\
983	pics/crtn.o		\
984	$(ALTPICS)
985
986CLOBBERFILES +=	$(LIB_PIC)
987
988# list of C source for lint
989SRCS=							\
990	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
991	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
992	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
993	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
994	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
995	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
996	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
997	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
998	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
999	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
1000	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
1001	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
1002	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
1003	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1004	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
1005	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1006	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
1007	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
1008	$(FPOBJS64:%.o=$(LIBCBASE)/fp/%.c)		\
1009	$(LIBCBASE)/crt/_ftou.c				\
1010	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1011	$(LIBCBASE)/gen/byteorder.c			\
1012	$(LIBCBASE)/gen/ecvt.c				\
1013	$(LIBCBASE)/gen/getctxt.c			\
1014	$(LIBCBASE)/gen/makectxt.c			\
1015	$(LIBCBASE)/gen/siginfolst.c			\
1016	$(LIBCBASE)/gen/siglongjmp.c			\
1017	$(LIBCBASE)/gen/swapctxt.c
1018
1019# conditional assignments
1020$(DYNLIB) := CRTI = crti.o
1021$(DYNLIB) := CRTN = crtn.o
1022
1023# Files which need the threads .il inline template
1024TIL=				\
1025	aio.o			\
1026	alloc.o			\
1027	assfail.o		\
1028	atexit.o		\
1029	atfork.o		\
1030	cancel.o		\
1031	door_calls.o		\
1032	errno.o			\
1033	getctxt.o		\
1034	lwp.o			\
1035	ma.o			\
1036	machdep.o		\
1037	posix_aio.o		\
1038	pthr_attr.o		\
1039	pthr_barrier.o		\
1040	pthr_cond.o		\
1041	pthr_mutex.o		\
1042	pthr_rwlock.o		\
1043	pthread.o		\
1044	rand.o			\
1045	rwlock.o		\
1046	scalls.o		\
1047	sched.o			\
1048	sema.o			\
1049	sigaction.o		\
1050	sigev_thread.o		\
1051	spawn.o			\
1052	stack.o			\
1053	swapctxt.o		\
1054	synch.o			\
1055	tdb_agent.o		\
1056	thr.o			\
1057	thread_interface.o	\
1058	thread_pool.o		\
1059	tls.o			\
1060	tsd.o			\
1061	unwind.o
1062
1063$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1064
1065# Files in fp, port/fp subdirectories that need base.il inline template
1066IL=				\
1067	__flt_decim.o		\
1068	decimal_bin.o
1069
1070$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1071
1072# Files in fp subdirectory which need __quad.il inline template
1073QIL=				\
1074	_Q_add.o		\
1075	_Q_cmp.o		\
1076	_Q_cmpe.o		\
1077	_Q_div.o		\
1078	_Q_dtoq.o		\
1079	_Q_fcc.o		\
1080	_Q_mul.o		\
1081	_Q_qtod.o		\
1082	_Q_qtoi.o		\
1083	_Q_qtos.o		\
1084	_Q_qtou.o		\
1085	_Q_sqrt.o		\
1086	_Q_stoq.o		\
1087	_Q_sub.o		\
1088	_Qp_qtox.o		\
1089	_Qp_qtoux.o
1090
1091$(QIL:%=pics/%) := CFLAGS64 += $(LIBCDIR)/$(MACH)/fp/__quad.il
1092pics/_Qp%.o := CFLAGS64 += -I$(LIBCDIR)/$(MACH)/fp
1093pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1094
1095# Files in crt subdirectory which need muldiv64.il inline template
1096#CIL=	mul64.o divrem64.o
1097#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
1098
1099# large-file-aware components that should be built large
1100
1101#$(COMSYSOBJS64:%=pics/%) := \
1102#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1103
1104#$(SYSOBJS64:%=pics/%) := \
1105#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1106
1107#$(PORTGEN64:%=pics/%) := \
1108#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1109
1110#$(PORTSTDIO64:%=pics/%) := \
1111#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1112
1113#$(PORTSYS64:%=pics/%) := \
1114#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1115
1116$(PORTSTDIO_W:%=pics/%) := \
1117	CPPFLAGS += -D_WIDE
1118
1119$(PORTPRINT_W:%=pics/%) := \
1120	CPPFLAGS += -D_WIDE
1121
1122$(PORTI18N_COND:%=pics/%) := \
1123	CPPFLAGS += -D_WCS_LONGLONG
1124
1125# Files which need extra optimization
1126pics/getenv.o := sparcv9_COPTFLAG = -xO4
1127
1128.KEEP_STATE:
1129
1130all: $(LIBS) $(LIB_PIC)
1131
1132lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1133lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1134lint	:=	LINTFLAGS64 += -mn
1135
1136lint:
1137	@echo $(LINT.c) ... $(LDLIBS)
1138	@$(LINT.c) $(SRCS) $(LDLIBS)
1139
1140$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1141$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1142$(LINTLIB):= LINTFLAGS64=-nvx -m64
1143
1144# object files that depend on inline template
1145$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1146$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1147$(QIL:%=pics/%): $(LIBCDIR)/$(MACH)/fp/__quad.il
1148#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
1149
1150# include common libc targets
1151include $(LIBCDIR)/Makefile.targ
1152
1153# We need to strip out all CTF and DOF data from the static library
1154$(LIB_PIC) := DIR = pics
1155$(LIB_PIC): pics $$(PICS)
1156	$(BUILD.AR)
1157	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1158	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1159	$(AR) -ts $@ > /dev/null
1160	$(POST_PROCESS_A)
1161
1162# special cases
1163#$(STRETS:%=pics/%): crt/stret.s
1164#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1165#	$(POST_PROCESS_O)
1166
1167#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1168#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1169#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1170#	$(RM) crt/_rtld.s
1171
1172ASSYMDEP_OBJS=			\
1173	_lwp_mutex_unlock.o	\
1174	_stack_grow.o		\
1175	asm_subr.o		\
1176	tls_get_addr.o		\
1177	unwind_frame.o		\
1178	vforkx.o
1179
1180$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1181
1182$(ASSYMDEP_OBJS:%=pics/%): assym.h
1183
1184# assym.h build rules
1185
1186GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1187
1188# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1189#	live in Makefile.master
1190
1191CPPFLAGS.genassym = \
1192	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1193
1194genassym: $(GENASSYM_C)
1195	$(NATIVECC) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc \
1196		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1197
1198OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1199
1200assym.h: $(OFFSETS) genassym
1201	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1202	./genassym >>$@
1203
1204# derived C source and related explicit dependencies
1205$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1206	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1207
1208pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1209