xref: /titanic_41/usr/src/lib/libc/sparcv9/Makefile (revision 948f2876ce2a3010558f4f6937e16086ebcd36f2)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28LIBCBASE=.
29
30LIBRARY= libc.a
31LIB_PIC= libc_pic.a
32VERS=	.1
33CPP=	/usr/lib/cpp
34TARGET_ARCH=	sparc
35
36# objects are grouped by source directory
37
38# local objects
39STRETS=
40
41CRTOBJS=			\
42	__align_cpy_2.o		\
43	__align_cpy_4.o		\
44	__align_cpy_8.o		\
45	_ftou.o			\
46	cerror.o
47
48DYNOBJS=
49
50FPOBJS=				\
51	_D_cplx_div.o		\
52	_D_cplx_div_ix.o	\
53	_D_cplx_div_rx.o	\
54	_D_cplx_mul.o		\
55	_F_cplx_div.o		\
56	_F_cplx_div_ix.o	\
57	_F_cplx_div_rx.o	\
58	_F_cplx_mul.o		\
59	_Q_add.o		\
60	_Q_cmp.o		\
61	_Q_cmpe.o		\
62	_Q_cplx_div.o		\
63	_Q_cplx_div_ix.o	\
64	_Q_cplx_div_rx.o	\
65	_Q_cplx_lr_div.o	\
66	_Q_cplx_lr_div_ix.o	\
67	_Q_cplx_lr_div_rx.o	\
68	_Q_cplx_lr_mul.o	\
69	_Q_cplx_mul.o		\
70	_Q_div.o		\
71	_Q_dtoq.o		\
72	_Q_fcc.o		\
73	_Q_itoq.o		\
74	_Q_mul.o		\
75	_Q_neg.o		\
76	_Q_qtod.o		\
77	_Q_qtoi.o		\
78	_Q_qtos.o		\
79	_Q_qtou.o		\
80	_Q_scl.o		\
81	_Q_sqrt.o		\
82	_Q_stoq.o		\
83	_Q_sub.o		\
84	_Q_utoq.o
85
86FPOBJS64=			\
87	_Qp_qtox.o		\
88	_Qp_qtoux.o		\
89	_Qp_xtoq.o		\
90	_Qp_uxtoq.o		\
91	__dtoul.o		\
92	__ftoul.o
93
94FPASMOBJS=			\
95	_Q_get_rp_rd.o		\
96	__quad_mag64.o		\
97	fpgetmask.o		\
98	fpgetrnd.o		\
99	fpgetsticky.o		\
100	fpsetmask.o		\
101	fpsetrnd.o		\
102	fpsetsticky.o
103
104$(__GNUC)FPASMOBJS +=		\
105	__quad.o
106
107ATOMICOBJS=			\
108	atomic.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
121GENOBJS=			\
122	_getsp.o		\
123	_xregs_clrptr.o		\
124	abs.o			\
125	alloca.o		\
126	byteorder.o		\
127	cuexit.o		\
128	ecvt.o			\
129	getctxt.o		\
130	lexp10.o		\
131	llog10.o		\
132	lock.o			\
133	makectxt.o		\
134	memchr.o		\
135	memcmp.o		\
136	memcpy.o		\
137	memmove.o		\
138	memset.o		\
139	new_list.o		\
140	setjmp.o		\
141	siginfolst.o		\
142	siglongjmp.o		\
143	sparc_data.o		\
144	strcasecmp.o		\
145	strchr.o		\
146	strcmp.o		\
147	strcpy.o		\
148	strlcpy.o		\
149	strlen.o		\
150	strncmp.o		\
151	strncpy.o		\
152	strnlen.o		\
153	swapctxt.o		\
154	sync_instruction_memory.o
155
156# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
157# This macro should ALWAYS be empty; native APIs are already 'large file'.
158COMSYSOBJS64=
159
160SYSOBJS64=
161
162COMSYSOBJS=			\
163	__clock_timer.o		\
164	__fcntl.o		\
165	__getloadavg.o		\
166	__rusagesys.o		\
167	__signotify.o		\
168	__sigrt.o		\
169	__time.o		\
170	_lgrp_home_fast.o	\
171	_lgrpsys.o		\
172	_nfssys.o		\
173	_portfs.o		\
174	_pset.o			\
175	_rename.o		\
176	_rpcsys.o		\
177	_sigaction.o		\
178	_so_accept.o		\
179	_so_bind.o		\
180	_so_connect.o		\
181	_so_getpeername.o	\
182	_so_getsockname.o	\
183	_so_getsockopt.o	\
184	_so_listen.o		\
185	_so_recv.o		\
186	_so_recvfrom.o		\
187	_so_recvmsg.o		\
188	_so_send.o		\
189	_so_sendmsg.o		\
190	_so_sendto.o		\
191	_so_setsockopt.o	\
192	_so_shutdown.o		\
193	_so_socket.o		\
194	_so_socketpair.o	\
195	_sockconfig.o		\
196	access.o		\
197	acct.o			\
198	acl.o			\
199	adjtime.o		\
200	alarm.o			\
201	brk.o			\
202	chdir.o			\
203	chmod.o			\
204	chown.o			\
205	chroot.o		\
206	cladm.o			\
207	close.o			\
208	creat.o			\
209	dup.o			\
210	execve.o		\
211	exit.o			\
212	facl.o			\
213	fchdir.o		\
214	fchmod.o		\
215	fchown.o		\
216	fchroot.o		\
217	fdsync.o		\
218	fpathconf.o		\
219	fstat.o			\
220	fstatfs.o		\
221	fstatvfs.o		\
222	getcpuid.o		\
223	getdents.o		\
224	getegid.o		\
225	geteuid.o		\
226	getgid.o		\
227	getgroups.o		\
228	gethrtime.o		\
229	getitimer.o		\
230	getmsg.o		\
231	getpagesizes.o		\
232	getpid.o		\
233	getpmsg.o		\
234	getppid.o		\
235	getrlimit.o		\
236	getuid.o		\
237	gtty.o			\
238	install_utrap.o		\
239	ioctl.o			\
240	kaio.o			\
241	kill.o			\
242	lchown.o		\
243	link.o			\
244	llseek.o		\
245	lseek.o			\
246	lstat.o			\
247	memcntl.o		\
248	mincore.o		\
249	mkdir.o			\
250	mknod.o			\
251	mmap.o			\
252	modctl.o		\
253	mount.o			\
254	mprotect.o		\
255	munmap.o		\
256	nice.o			\
257	ntp_adjtime.o		\
258	ntp_gettime.o		\
259	open.o			\
260	p_online.o		\
261	pathconf.o		\
262	pause.o			\
263	pcsample.o		\
264	pollsys.o		\
265	pread.o			\
266	priocntlset.o		\
267	processor_bind.o	\
268	processor_info.o	\
269	profil.o		\
270	putmsg.o		\
271	putpmsg.o		\
272	pwrite.o		\
273	read.o			\
274	readlink.o		\
275	readv.o			\
276	resolvepath.o		\
277	rmdir.o			\
278	seteguid.o		\
279	setgid.o		\
280	setgroups.o		\
281	setitimer.o		\
282	setreid.o		\
283	setrlimit.o		\
284	setuid.o		\
285	sigaltstk.o		\
286	sigprocmsk.o		\
287	sigsendset.o		\
288	sigsuspend.o		\
289	stat.o			\
290	statfs.o		\
291	statvfs.o		\
292	stty.o			\
293	symlink.o		\
294	sync.o			\
295	sysconfig.o		\
296	sysfs.o			\
297	sysinfo.o		\
298	syslwp.o		\
299	times.o			\
300	ulimit.o		\
301	umask.o			\
302	umount2.o		\
303	unlink.o		\
304	utime.o			\
305	utimes.o		\
306	utssys.o		\
307	uucopy.o		\
308	vhangup.o		\
309	waitid.o		\
310	write.o			\
311	writev.o		\
312	yield.o
313
314SYSOBJS=			\
315	__clock_gettime.o	\
316	__getcontext.o		\
317	_lwp_mutex_unlock.o	\
318	_stack_grow.o		\
319	door.o			\
320	forkx.o			\
321	forkallx.o		\
322	gettimeofday.o		\
323	pipe.o			\
324	sparc_utrap_install.o	\
325	syscall.o		\
326	syssun.o		\
327	tls_get_addr.o		\
328	uadmin.o		\
329	umount.o		\
330	uname.o			\
331	vforkx.o
332
333# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
334# This macro should ALWAYS be empty; native APIs are already 'large file'.
335PORTGEN64=
336
337# objects from source under ../port
338PORTFP=				\
339	__flt_decim.o		\
340	__flt_rounds.o		\
341	__tbl_10_b.o		\
342	__tbl_10_h.o		\
343	__tbl_10_s.o		\
344	__tbl_2_b.o		\
345	__tbl_2_h.o		\
346	__tbl_2_s.o		\
347	__tbl_fdq.o		\
348	__tbl_tens.o		\
349	__x_power.o		\
350	_base_sup.o		\
351	aconvert.o		\
352	decimal_bin.o		\
353	double_decim.o		\
354	econvert.o		\
355	fconvert.o		\
356	file_decim.o		\
357	finite.o		\
358	fp_data.o		\
359	func_decim.o		\
360	gconvert.o		\
361	hex_bin.o		\
362	ieee_globals.o		\
363	pack_float.o		\
364	sigfpe.o		\
365	string_decim.o
366
367PORTGEN=			\
368	_env_data.o		\
369	_xftw.o			\
370	a64l.o			\
371	abort.o			\
372	addsev.o		\
373	assert.o		\
374	atof.o			\
375	atoi.o			\
376	atol.o			\
377	atoll.o			\
378	attropen.o		\
379	atexit.o		\
380	atfork.o		\
381	basename.o		\
382	calloc.o		\
383	catgets.o		\
384	catopen.o		\
385	cfgetispeed.o		\
386	cfgetospeed.o		\
387	cfree.o			\
388	cfsetispeed.o		\
389	cfsetospeed.o		\
390	cftime.o		\
391	clock.o			\
392	closedir.o		\
393	closefrom.o		\
394	confstr.o		\
395	crypt.o			\
396	csetlen.o		\
397	ctime.o			\
398	ctime_r.o		\
399	deflt.o			\
400	directio.o		\
401	dirname.o		\
402	div.o			\
403	drand48.o		\
404	dup2.o			\
405	env_data.o		\
406	errno.o			\
407	euclen.o		\
408	event_port.o		\
409	execvp.o		\
410	fattach.o		\
411	fdetach.o		\
412	fdopendir.o		\
413	fmtmsg.o		\
414	ftime.o			\
415	ftok.o			\
416	ftw.o			\
417	gcvt.o			\
418	getauxv.o		\
419	getcwd.o		\
420	getdate_err.o		\
421	getdtblsize.o		\
422	getenv.o		\
423	getexecname.o		\
424	getgrnam.o		\
425	getgrnam_r.o		\
426	gethostid.o		\
427	gethostname.o		\
428	gethz.o			\
429	getisax.o		\
430	getloadavg.o		\
431	getlogin.o		\
432	getmntent.o		\
433	getnetgrent.o		\
434	getopt.o		\
435	getopt_long.o		\
436	getpagesize.o		\
437	getpw.o			\
438	getpwnam.o		\
439	getpwnam_r.o		\
440	getrusage.o		\
441	getspent.o		\
442	getspent_r.o		\
443	getsubopt.o		\
444	gettxt.o		\
445	getusershell.o		\
446	getut.o			\
447	getutx.o		\
448	getvfsent.o		\
449	getwd.o			\
450	getwidth.o		\
451	getxby_door.o		\
452	gtxt.o			\
453	hsearch.o		\
454	iconv.o			\
455	imaxabs.o		\
456	imaxdiv.o		\
457	index.o			\
458	initgroups.o		\
459	insque.o		\
460	isaexec.o		\
461	isastream.o		\
462	isatty.o		\
463	killpg.o		\
464	l64a.o			\
465	lckpwdf.o		\
466	lconstants.o		\
467	ldivide.o		\
468	lfind.o			\
469	lfmt.o			\
470	lfmt_log.o		\
471	lldiv.o			\
472	lltostr.o		\
473	lmath.o			\
474	localtime.o		\
475	lsearch.o		\
476	madvise.o		\
477	malloc.o		\
478	memalign.o		\
479	mkdev.o			\
480	mkdtemp.o		\
481	mkfifo.o		\
482	mkstemp.o		\
483	mktemp.o		\
484	mlock.o			\
485	mlockall.o		\
486	mon.o			\
487	msync.o			\
488	munlock.o		\
489	munlockall.o		\
490	ndbm.o			\
491	nftw.o			\
492	nlspath_checks.o	\
493	nsparse.o		\
494	nss_common.o		\
495	nss_dbdefs.o		\
496	nss_deffinder.o		\
497	opendir.o		\
498	opt_data.o		\
499	perror.o		\
500	pfmt.o			\
501	pfmt_data.o		\
502	pfmt_print.o		\
503	plock.o			\
504	poll.o			\
505	priocntl.o		\
506	privlib.o		\
507	priv_str_xlate.o	\
508	psiginfo.o		\
509	psignal.o		\
510	pt.o			\
511	putpwent.o		\
512	putspent.o		\
513	raise.o			\
514	rand.o			\
515	random.o		\
516	rctlops.o		\
517	readdir.o		\
518	readdir_r.o		\
519	realpath.o		\
520	reboot.o		\
521	regexpr.o		\
522	rename.o		\
523	rewinddir.o		\
524	rindex.o		\
525	scandir.o		\
526	seekdir.o		\
527	select.o		\
528	setlabel.o		\
529	setpriority.o		\
530	settimeofday.o		\
531	sh_locks.o		\
532	sigflag.o		\
533	siglist.o		\
534	sigsend.o		\
535	sigsetops.o		\
536	ssignal.o		\
537	stack.o			\
538	str2sig.o		\
539	strcase_charmap.o	\
540	strcat.o		\
541	strcspn.o		\
542	strdup.o		\
543	strerror.o		\
544	strncat.o		\
545	strlcat.o		\
546	strncasecmp.o		\
547	strpbrk.o		\
548	strrchr.o		\
549	strsignal.o		\
550	strspn.o		\
551	strstr.o		\
552	strtod.o		\
553	strtoimax.o		\
554	strtok.o		\
555	strtok_r.o		\
556	strtoll.o		\
557	strtoull.o		\
558	strtoumax.o		\
559	swab.o			\
560	swapctl.o		\
561	sysconf.o		\
562	syslog.o		\
563	tcdrain.o		\
564	tcflow.o		\
565	tcflush.o		\
566	tcgetattr.o		\
567	tcgetpgrp.o		\
568	tcgetsid.o		\
569	tcsendbreak.o		\
570	tcsetattr.o		\
571	tcsetpgrp.o		\
572	tell.o			\
573	telldir.o		\
574	tfind.o			\
575	time_data.o		\
576	time_gdata.o		\
577	truncate.o		\
578	tsdalloc.o		\
579	tsearch.o		\
580	ttyname.o		\
581	ttyslot.o		\
582	ualarm.o		\
583	ucred.o			\
584	valloc.o		\
585	vlfmt.o			\
586	vpfmt.o			\
587	wait3.o			\
588	wait4.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	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	fallocate.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	rtsched.o		\
761	rwlock.o		\
762	scalls.o		\
763	sema.o			\
764	sigaction.o		\
765	spawn.o			\
766	synch.o			\
767	tdb_agent.o		\
768	thr.o			\
769	thread_interface.o	\
770	tls.o			\
771	tsd.o
772
773THREADSMACHOBJS=		\
774	machdep.o
775
776THREADSASMOBJS=			\
777	asm_subr.o
778
779UNWINDMACHOBJS=			\
780	unwind.o
781
782UNWINDASMOBJS=			\
783	unwind_frame.o
784
785# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
786# This macro should ALWAYS be empty; native APIs are already 'large file'.
787PORTSYS64=
788
789PORTSYS=			\
790	_autofssys.o		\
791	acctctl.o		\
792	bsd_signal.o		\
793	corectl.o		\
794	exacctsys.o		\
795	execl.o			\
796	execle.o		\
797	execv.o			\
798	faccessat.o		\
799	fcntl.o			\
800	fsmisc.o		\
801	fstatat.o		\
802	fsync.o			\
803	getpeerucred.o		\
804	inst_sync.o		\
805	issetugid.o		\
806	label.o			\
807	libc_link.o		\
808	libc_open.o		\
809	lockf.o			\
810	lwp.o			\
811	lwp_cond.o		\
812	lwp_rwlock.o		\
813	lwp_sigmask.o		\
814	meminfosys.o		\
815	msgsys.o		\
816	nfssys.o		\
817	openat.o		\
818	pgrpsys.o		\
819	posix_sigwait.o		\
820	ppriv.o			\
821	psetsys.o		\
822	rctlsys.o		\
823	sbrk.o			\
824	semsys.o		\
825	set_errno.o		\
826	sharefs.o		\
827	shmsys.o		\
828	sidsys.o		\
829	siginterrupt.o		\
830	signal.o		\
831	sigpending.o		\
832	sigstack.o		\
833	tasksys.o		\
834	time.o			\
835	time_util.o		\
836	ucontext.o		\
837	ustat.o			\
838	zone.o
839
840PORTREGEX=			\
841	glob.o			\
842	regcmp.o		\
843	regex.o			\
844	wordexp.o
845
846VALUES=	values-Xa.o
847
848MOSTOBJS=			\
849	$(STRETS)		\
850	$(CRTOBJS)		\
851	$(DYNOBJS)		\
852	$(FPOBJS)		\
853	$(FPOBJS64)		\
854	$(FPASMOBJS)		\
855	$(ATOMICOBJS)		\
856	$(COMOBJS)		\
857	$(GENOBJS)		\
858	$(PORTFP)		\
859	$(PORTGEN)		\
860	$(PORTGEN64)		\
861	$(PORTI18N)		\
862	$(PORTI18N_COND)	\
863	$(PORTPRINT)		\
864	$(PORTPRINT_W)		\
865	$(PORTREGEX)		\
866	$(PORTSTDIO)		\
867	$(PORTSTDIO64)		\
868	$(PORTSTDIO_W)		\
869	$(PORTSYS)		\
870	$(PORTSYS64)		\
871	$(AIOOBJS)		\
872	$(RTOBJS)		\
873	$(TPOOLOBJS)		\
874	$(THREADSOBJS)		\
875	$(THREADSMACHOBJS)	\
876	$(THREADSASMOBJS)	\
877	$(UNWINDMACHOBJS)	\
878	$(UNWINDASMOBJS)	\
879	$(COMSYSOBJS)		\
880	$(SYSOBJS)		\
881	$(COMSYSOBJS64)		\
882	$(SYSOBJS64)		\
883	$(VALUES)
884
885TRACEOBJS=			\
886	plockstat.o
887
888# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
889# modules whose source is provided in the $(SRC)/lib/common directory.
890# This must be done because otherwise the Sun C compiler would insert
891# its own versions of these modules and those versions contain code
892# to call out to C++ initialization functions.  Such C++ initialization
893# functions can call back into libc before thread initialization is
894# complete and this leads to segmentation violations and other problems.
895# Since libc contains no C++ code, linking with the minimal crti.o and
896# crtn.o modules is safe and avoids the problems described above.
897OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
898CRTSRCS= ../../common/sparcv9
899
900# include common library definitions
901include ../../Makefile.lib
902include ../../Makefile.lib.64
903
904# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
905# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
906# need to be compatible with the ones for the libc stuff.  Whenever the changes
907# that affect the compilation conditions of libc happened, those for libc_i18n
908# also need to be updated.
909
910CFLAGS64 += $(CCVERBOSE)
911
912# This is necessary to avoid problems with calling _ex_unwind().
913# We probably don't want any inlining anyway.
914CFLAGS64 += -xinline=
915
916# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
917# enables ASSERT() checking in the threads portion of the library.
918# This is automatically enabled for DEBUG builds, not for non-debug builds.
919THREAD_DEBUG =
920$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
921
922CFLAGS64 += $(THREAD_DEBUG)
923
924ALTPICS= $(TRACEOBJS:%=pics/%)
925
926$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
927$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
928
929MAPFILES =	../port/mapfile-vers mapfile-vers
930
931sparcv9_C_PICFLAGS= -K PIC
932CFLAGS64 +=	$(EXTN_CFLAGS)
933CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) \
934		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
935ASFLAGS=	-K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
936		$(sparcv9_AS_XARCH)
937
938# Inform the run-time linker about libc specialized initialization
939RTLDINFO =	-z rtldinfo=tls_rtldinfo
940DYNFLAGS +=	$(RTLDINFO)
941
942DYNFLAGS +=	$(EXTN_DYNFLAGS)
943
944BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
945
946# Override this top level flag so the compiler builds in its native
947# C99 mode.  This has been enabled to support the complex arithmetic
948# added to libc.
949C99MODE=	$(C99_ENABLE)
950
951# libc method of building an archive
952BUILD.AR= $(RM) $@ ; \
953	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
954
955# extra files for the clean target
956CLEANFILES=			\
957	../port/gen/errlst.c	\
958	../port/gen/new_list.c	\
959	assym.h			\
960	genassym		\
961	pics/crti.o		\
962	pics/crtn.o		\
963	$(ALTPICS)
964
965CLOBBERFILES +=	$(LIB_PIC)
966
967# list of C source for lint
968SRCS=							\
969	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
970	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
971	$(PORTFP:%.o=../port/fp/%.c)			\
972	$(PORTGEN:%.o=../port/gen/%.c)			\
973	$(PORTI18N:%.o=../port/i18n/%.c)		\
974	$(PORTPRINT:%.o=../port/print/%.c)		\
975	$(PORTREGEX:%.o=../port/regex/%.c)		\
976	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
977	$(PORTSYS:%.o=../port/sys/%.c)			\
978	$(AIOOBJS:%.o=../port/aio/%.c)			\
979	$(RTOBJS:%.o=../port/rt/%.c)			\
980	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
981	$(THREADSOBJS:%.o=../port/threads/%.c)		\
982	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
983	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
984	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
985	$(FPOBJS64:%.o=$(LIBCBASE)/fp/%.c)		\
986	$(LIBCBASE)/crt/_ftou.c				\
987	$(LIBCBASE)/gen/_xregs_clrptr.c			\
988	$(LIBCBASE)/gen/byteorder.c			\
989	$(LIBCBASE)/gen/ecvt.c				\
990	$(LIBCBASE)/gen/getctxt.c			\
991	$(LIBCBASE)/gen/lexp10.c			\
992	$(LIBCBASE)/gen/llog10.c			\
993	$(LIBCBASE)/gen/makectxt.c			\
994	$(LIBCBASE)/gen/siginfolst.c			\
995	$(LIBCBASE)/gen/siglongjmp.c			\
996	$(LIBCBASE)/gen/swapctxt.c
997
998# conditional assignments
999# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1000$(DYNLIB) := CRTI = crti.o
1001$(DYNLIB) := CRTN = crtn.o
1002
1003# Files which need the threads .il inline template
1004TIL=				\
1005	aio.o			\
1006	alloc.o			\
1007	assfail.o		\
1008	atexit.o		\
1009	atfork.o		\
1010	cancel.o		\
1011	door_calls.o		\
1012	errno.o			\
1013	getctxt.o		\
1014	lwp.o			\
1015	ma.o			\
1016	machdep.o		\
1017	posix_aio.o		\
1018	pthr_attr.o		\
1019	pthr_barrier.o		\
1020	pthr_cond.o		\
1021	pthr_mutex.o		\
1022	pthr_rwlock.o		\
1023	pthread.o		\
1024	rand.o			\
1025	rtsched.o		\
1026	rwlock.o		\
1027	scalls.o		\
1028	sema.o			\
1029	sigaction.o		\
1030	sigev_thread.o		\
1031	spawn.o			\
1032	stack.o			\
1033	swapctxt.o		\
1034	synch.o			\
1035	tdb_agent.o		\
1036	thr.o			\
1037	thread_interface.o	\
1038	thread_pool.o		\
1039	tls.o			\
1040	tsd.o			\
1041	unwind.o
1042
1043$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1044
1045# Files in fp, port/fp subdirectories that need base.il inline template
1046IL=				\
1047	__flt_decim.o		\
1048	decimal_bin.o
1049
1050$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1051
1052# Files in fp subdirectory which need __quad.il inline template
1053QIL=				\
1054	_Q_add.o		\
1055	_Q_cmp.o		\
1056	_Q_cmpe.o		\
1057	_Q_div.o		\
1058	_Q_dtoq.o		\
1059	_Q_fcc.o		\
1060	_Q_mul.o		\
1061	_Q_qtod.o		\
1062	_Q_qtoi.o		\
1063	_Q_qtos.o		\
1064	_Q_qtou.o		\
1065	_Q_sqrt.o		\
1066	_Q_stoq.o		\
1067	_Q_sub.o		\
1068	_Qp_qtox.o		\
1069	_Qp_qtoux.o
1070
1071$(QIL:%=pics/%) := CFLAGS64 += ../$(MACH)/fp/__quad.il
1072pics/_Qp%.o := CFLAGS64 += -I../$(MACH)/fp
1073pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1074
1075# Files in crt subdirectory which need muldiv64.il inline template
1076#CIL=	mul64.o divrem64.o
1077#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
1078
1079# large-file-aware components that should be built large
1080
1081#$(COMSYSOBJS64:%=pics/%) := \
1082#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1083
1084#$(SYSOBJS64:%=pics/%) := \
1085#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1086
1087#$(PORTGEN64:%=pics/%) := \
1088#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1089
1090#$(PORTSTDIO64:%=pics/%) := \
1091#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1092
1093#$(PORTSYS64:%=pics/%) := \
1094#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1095
1096$(PORTSTDIO_W:%=pics/%) := \
1097	CPPFLAGS += -D_WIDE
1098
1099$(PORTPRINT_W:%=pics/%) := \
1100	CPPFLAGS += -D_WIDE
1101
1102$(PORTI18N_COND:%=pics/%) := \
1103	CPPFLAGS += -D_WCS_LONGLONG
1104
1105# Files which need extra optimization
1106pics/getenv.o := sparcv9_COPTFLAG = -xO4
1107
1108.KEEP_STATE:
1109
1110all: $(LIBS) $(LIB_PIC)
1111
1112lint	:=	CPPFLAGS += -I../$(MACH)/fp
1113lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1114lint	:=	LINTFLAGS64 += -mn
1115
1116lint:
1117	@echo $(LINT.c) ... $(LDLIBS)
1118	@$(LINT.c) $(SRCS) $(LDLIBS)
1119
1120$(LINTLIB):= SRCS=../port/llib-lc
1121$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1122$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=v9
1123
1124# object files that depend on inline template
1125$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1126$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1127$(QIL:%=pics/%): ../$(MACH)/fp/__quad.il
1128#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
1129
1130# include common libc targets
1131include ../Makefile.targ
1132
1133# We need to strip out all CTF and DOF data from the static library
1134$(LIB_PIC) := DIR = pics
1135$(LIB_PIC): pics $$(PICS)
1136	$(BUILD.AR)
1137	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1138	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1139	$(AR) -ts $@ > /dev/null
1140	$(POST_PROCESS_A)
1141
1142# special cases
1143#$(STRETS:%=pics/%): crt/stret.s
1144#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1145#	$(POST_PROCESS_O)
1146
1147#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1148#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1149#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1150#	$(RM) crt/_rtld.s
1151
1152ASSYMDEP_OBJS=			\
1153	_lwp_mutex_unlock.o	\
1154	_stack_grow.o		\
1155	asm_subr.o		\
1156	tls_get_addr.o		\
1157	unwind_frame.o		\
1158	vforkx.o
1159
1160$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1161
1162$(ASSYMDEP_OBJS:%=pics/%): assym.h
1163
1164# assym.h build rules
1165
1166GENASSYM_C = ../$(MACH)/genassym.c
1167
1168# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1169#	live in Makefile.master
1170
1171CPPFLAGS.genassym = \
1172	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1173
1174genassym: $(GENASSYM_C)
1175	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc \
1176		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1177
1178OFFSETS = ../$(MACH)/offsets.in
1179
1180assym.h: $(OFFSETS) genassym
1181	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1182	./genassym >>$@
1183
1184# derived C source and related explicit dependencies
1185../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1186	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1187
1188pics/new_list.o: ../port/gen/new_list.c
1189