xref: /titanic_52/usr/src/lib/libc/sparcv9/Makefile (revision 6009dbc6db3fe0e2890761d3d562bb4c4b9bf0be)
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 2008 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
110XATTROBJS=			\
111	xattr_common.o
112
113COMOBJS=			\
114	bcmp.o			\
115	bcopy.o			\
116	bsearch.o		\
117	bzero.o			\
118	ffs.o			\
119	memccpy.o		\
120	qsort.o			\
121	strtol.o		\
122	strtoul.o
123
124GENOBJS=			\
125	_getsp.o		\
126	_xregs_clrptr.o		\
127	abs.o			\
128	alloca.o		\
129	byteorder.o		\
130	cuexit.o		\
131	ecvt.o			\
132	getctxt.o		\
133	lexp10.o		\
134	llog10.o		\
135	lock.o			\
136	makectxt.o		\
137	memchr.o		\
138	memcmp.o		\
139	memcpy.o		\
140	memmove.o		\
141	memset.o		\
142	new_list.o		\
143	setjmp.o		\
144	siginfolst.o		\
145	siglongjmp.o		\
146	sparc_data.o		\
147	strcasecmp.o		\
148	strchr.o		\
149	strcmp.o		\
150	strcpy.o		\
151	strlcpy.o		\
152	strlen.o		\
153	strncmp.o		\
154	strncpy.o		\
155	strnlen.o		\
156	swapctxt.o		\
157	sync_instruction_memory.o
158
159# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
160# This macro should ALWAYS be empty; native APIs are already 'large file'.
161COMSYSOBJS64=
162
163SYSOBJS64=
164
165COMSYSOBJS=			\
166	__clock_timer.o		\
167	__getloadavg.o		\
168	__rusagesys.o		\
169	__signotify.o		\
170	__sigrt.o		\
171	__time.o		\
172	_lgrp_home_fast.o	\
173	_lgrpsys.o		\
174	_nfssys.o		\
175	_portfs.o		\
176	_pset.o			\
177	_rpcsys.o		\
178	_sigaction.o		\
179	_so_accept.o		\
180	_so_bind.o		\
181	_so_connect.o		\
182	_so_getpeername.o	\
183	_so_getsockname.o	\
184	_so_getsockopt.o	\
185	_so_listen.o		\
186	_so_recv.o		\
187	_so_recvfrom.o		\
188	_so_recvmsg.o		\
189	_so_send.o		\
190	_so_sendmsg.o		\
191	_so_sendto.o		\
192	_so_setsockopt.o	\
193	_so_shutdown.o		\
194	_so_socket.o		\
195	_so_socketpair.o	\
196	_sockconfig.o		\
197	access.o		\
198	acct.o			\
199	acl.o			\
200	adjtime.o		\
201	alarm.o			\
202	brk.o			\
203	chdir.o			\
204	chmod.o			\
205	chown.o			\
206	chroot.o		\
207	cladm.o			\
208	close.o			\
209	creat.o			\
210	dup.o			\
211	execve.o		\
212	exit.o			\
213	facl.o			\
214	fchdir.o		\
215	fchmod.o		\
216	fchown.o		\
217	fchroot.o		\
218	fcntl.o			\
219	fdsync.o		\
220	fpathconf.o		\
221	fstat.o			\
222	fstatfs.o		\
223	fstatvfs.o		\
224	getcpuid.o		\
225	getdents.o		\
226	getegid.o		\
227	geteuid.o		\
228	getgid.o		\
229	getgroups.o		\
230	gethrtime.o		\
231	getitimer.o		\
232	getmsg.o		\
233	getpid.o		\
234	getpmsg.o		\
235	getppid.o		\
236	getrlimit.o		\
237	getuid.o		\
238	gtty.o			\
239	install_utrap.o		\
240	ioctl.o			\
241	kaio.o			\
242	kill.o			\
243	lchown.o		\
244	link.o			\
245	llseek.o		\
246	lseek.o			\
247	lstat.o			\
248	memcntl.o		\
249	mincore.o		\
250	mkdir.o			\
251	mknod.o			\
252	mmap.o			\
253	modctl.o		\
254	mount.o			\
255	mprotect.o		\
256	munmap.o		\
257	nice.o			\
258	ntp_adjtime.o		\
259	ntp_gettime.o		\
260	open.o			\
261	p_online.o		\
262	pathconf.o		\
263	pause.o			\
264	pcsample.o		\
265	pollsys.o		\
266	pread.o			\
267	priocntlset.o		\
268	processor_bind.o	\
269	processor_info.o	\
270	profil.o		\
271	putmsg.o		\
272	putpmsg.o		\
273	pwrite.o		\
274	read.o			\
275	readlink.o		\
276	readv.o			\
277	rename.o		\
278	resolvepath.o		\
279	rmdir.o			\
280	seteguid.o		\
281	setgid.o		\
282	setgroups.o		\
283	setitimer.o		\
284	setreid.o		\
285	setrlimit.o		\
286	setuid.o		\
287	sigaltstk.o		\
288	sigprocmsk.o		\
289	sigsendset.o		\
290	sigsuspend.o		\
291	stat.o			\
292	statfs.o		\
293	statvfs.o		\
294	stty.o			\
295	symlink.o		\
296	sync.o			\
297	sysconfig.o		\
298	sysfs.o			\
299	sysinfo.o		\
300	syslwp.o		\
301	times.o			\
302	ulimit.o		\
303	umask.o			\
304	umount2.o		\
305	unlink.o		\
306	utime.o			\
307	utimes.o		\
308	utssys.o		\
309	uucopy.o		\
310	vhangup.o		\
311	waitid.o		\
312	write.o			\
313	writev.o		\
314	yield.o
315
316SYSOBJS=			\
317	__clock_gettime.o	\
318	__getcontext.o		\
319	_lwp_mutex_unlock.o	\
320	_stack_grow.o		\
321	door.o			\
322	forkx.o			\
323	forkallx.o		\
324	gettimeofday.o		\
325	pipe.o			\
326	sparc_utrap_install.o	\
327	syscall.o		\
328	tls_get_addr.o		\
329	uadmin.o		\
330	umount.o		\
331	uname.o			\
332	vforkx.o
333
334# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
335# This macro should ALWAYS be empty; native APIs are already 'large file'.
336PORTGEN64=
337
338# objects from source under ../port
339PORTFP=				\
340	__flt_decim.o		\
341	__flt_rounds.o		\
342	__tbl_10_b.o		\
343	__tbl_10_h.o		\
344	__tbl_10_s.o		\
345	__tbl_2_b.o		\
346	__tbl_2_h.o		\
347	__tbl_2_s.o		\
348	__tbl_fdq.o		\
349	__tbl_tens.o		\
350	__x_power.o		\
351	_base_sup.o		\
352	aconvert.o		\
353	decimal_bin.o		\
354	double_decim.o		\
355	econvert.o		\
356	fconvert.o		\
357	file_decim.o		\
358	finite.o		\
359	fp_data.o		\
360	func_decim.o		\
361	gconvert.o		\
362	hex_bin.o		\
363	ieee_globals.o		\
364	pack_float.o		\
365	sigfpe.o		\
366	string_decim.o
367
368PORTGEN=			\
369	_env_data.o		\
370	_xftw.o			\
371	a64l.o			\
372	abort.o			\
373	addsev.o		\
374	assert.o		\
375	attrat.o		\
376	atof.o			\
377	atoi.o			\
378	atol.o			\
379	atoll.o			\
380	attropen.o		\
381	atexit.o		\
382	atfork.o		\
383	basename.o		\
384	calloc.o		\
385	catgets.o		\
386	catopen.o		\
387	cfgetispeed.o		\
388	cfgetospeed.o		\
389	cfree.o			\
390	cfsetispeed.o		\
391	cfsetospeed.o		\
392	cftime.o		\
393	clock.o			\
394	closedir.o		\
395	closefrom.o		\
396	confstr.o		\
397	crypt.o			\
398	csetlen.o		\
399	ctime.o			\
400	ctime_r.o		\
401	deflt.o			\
402	directio.o		\
403	dirname.o		\
404	div.o			\
405	drand48.o		\
406	dup2.o			\
407	env_data.o		\
408	err.o			\
409	errno.o			\
410	euclen.o		\
411	event_port.o		\
412	execvp.o		\
413	fattach.o		\
414	fdetach.o		\
415	fdopendir.o		\
416	fmtmsg.o		\
417	ftime.o			\
418	ftok.o			\
419	ftw.o			\
420	gcvt.o			\
421	getauxv.o		\
422	getcwd.o		\
423	getdate_err.o		\
424	getdtblsize.o		\
425	getenv.o		\
426	getexecname.o		\
427	getgrnam.o		\
428	getgrnam_r.o		\
429	gethostid.o		\
430	gethostname.o		\
431	gethz.o			\
432	getisax.o		\
433	getloadavg.o		\
434	getlogin.o		\
435	getmntent.o		\
436	getnetgrent.o		\
437	getopt.o		\
438	getopt_long.o		\
439	getpagesize.o		\
440	getpw.o			\
441	getpwnam.o		\
442	getpwnam_r.o		\
443	getrusage.o		\
444	getspent.o		\
445	getspent_r.o		\
446	getsubopt.o		\
447	gettxt.o		\
448	getusershell.o		\
449	getut.o			\
450	getutx.o		\
451	getvfsent.o		\
452	getwd.o			\
453	getwidth.o		\
454	getxby_door.o		\
455	gtxt.o			\
456	hsearch.o		\
457	iconv.o			\
458	imaxabs.o		\
459	imaxdiv.o		\
460	index.o			\
461	initgroups.o		\
462	insque.o		\
463	isaexec.o		\
464	isastream.o		\
465	isatty.o		\
466	killpg.o		\
467	klpdlib.o		\
468	l64a.o			\
469	lckpwdf.o		\
470	lconstants.o		\
471	ldivide.o		\
472	lfind.o			\
473	lfmt.o			\
474	lfmt_log.o		\
475	lldiv.o			\
476	lltostr.o		\
477	lmath.o			\
478	localtime.o		\
479	lsearch.o		\
480	madvise.o		\
481	malloc.o		\
482	memalign.o		\
483	mkdev.o			\
484	mkdtemp.o		\
485	mkfifo.o		\
486	mkstemp.o		\
487	mktemp.o		\
488	mlock.o			\
489	mlockall.o		\
490	mon.o			\
491	msync.o			\
492	munlock.o		\
493	munlockall.o		\
494	ndbm.o			\
495	nftw.o			\
496	nlspath_checks.o	\
497	nsparse.o		\
498	nss_common.o		\
499	nss_dbdefs.o		\
500	nss_deffinder.o		\
501	opendir.o		\
502	opt_data.o		\
503	perror.o		\
504	pfmt.o			\
505	pfmt_data.o		\
506	pfmt_print.o		\
507	plock.o			\
508	poll.o			\
509	priocntl.o		\
510	privlib.o		\
511	priv_str_xlate.o	\
512	psiginfo.o		\
513	psignal.o		\
514	pt.o			\
515	putpwent.o		\
516	putspent.o		\
517	raise.o			\
518	rand.o			\
519	random.o		\
520	rctlops.o		\
521	readdir.o		\
522	readdir_r.o		\
523	realpath.o		\
524	reboot.o		\
525	regexpr.o		\
526	remove.o		\
527	rewinddir.o		\
528	rindex.o		\
529	scandir.o		\
530	seekdir.o		\
531	select.o		\
532	setlabel.o		\
533	setpriority.o		\
534	settimeofday.o		\
535	sh_locks.o		\
536	sigflag.o		\
537	siglist.o		\
538	sigsend.o		\
539	sigsetops.o		\
540	ssignal.o		\
541	stack.o			\
542	str2sig.o		\
543	strcase_charmap.o	\
544	strcat.o		\
545	strcspn.o		\
546	strdup.o		\
547	strerror.o		\
548	strncat.o		\
549	strlcat.o		\
550	strncasecmp.o		\
551	strpbrk.o		\
552	strrchr.o		\
553	strsignal.o		\
554	strspn.o		\
555	strstr.o		\
556	strtod.o		\
557	strtoimax.o		\
558	strtok.o		\
559	strtok_r.o		\
560	strtoll.o		\
561	strtoull.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	doprnt.o		\
603	fprintf.o		\
604	printf.o		\
605	snprintf.o		\
606	sprintf.o		\
607	vfprintf.o		\
608	vprintf.o		\
609	vsnprintf.o		\
610	vsprintf.o		\
611	vwprintf.o		\
612	wprintf.o
613
614# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
615# This macro should ALWAYS be empty; native APIs are already 'large file'.
616PORTSTDIO64=
617
618PORTSTDIO_W=			\
619	doscan_w.o
620
621PORTSTDIO=			\
622	__extensions.o		\
623	_endopen.o		\
624	_filbuf.o		\
625	_findbuf.o		\
626	_flsbuf.o		\
627	_wrtchk.o		\
628	clearerr.o		\
629	ctermid.o		\
630	ctermid_r.o		\
631	cuserid.o		\
632	data.o			\
633	doscan.o		\
634	fdopen.o		\
635	feof.o			\
636	ferror.o		\
637	fgetc.o			\
638	fgets.o			\
639	fileno.o		\
640	flockf.o		\
641	flush.o			\
642	fopen.o			\
643	fpos.o			\
644	fputc.o			\
645	fputs.o			\
646	fread.o			\
647	fseek.o			\
648	fseeko.o		\
649	ftell.o			\
650	ftello.o		\
651	fwrite.o		\
652	getc.o			\
653	getchar.o		\
654	getpass.o		\
655	gets.o			\
656	getw.o			\
657	popen.o			\
658	putc.o			\
659	putchar.o		\
660	puts.o			\
661	putw.o			\
662	rewind.o		\
663	scanf.o			\
664	setbuf.o		\
665	setbuffer.o		\
666	setvbuf.o		\
667	system.o		\
668	tempnam.o		\
669	tmpfile.o		\
670	tmpnam_r.o		\
671	ungetc.o		\
672	mse.o			\
673	vscanf.o		\
674	vwscanf.o		\
675	wscanf.o
676
677PORTI18N=			\
678	__fgetwc_xpg5.o		\
679	__fgetws_xpg5.o		\
680	__fputwc_xpg5.o		\
681	__fputws_xpg5.o		\
682	__ungetwc_xpg5.o	\
683	getwchar.o		\
684	putwchar.o		\
685	putws.o			\
686	strtows.o		\
687	wcstoimax.o		\
688	wcstol.o		\
689	wcstoul.o		\
690	wcswcs.o		\
691	wscasecmp.o		\
692	wscat.o			\
693	wschr.o			\
694	wscmp.o			\
695	wscpy.o			\
696	wscspn.o		\
697	wsdup.o			\
698	wslen.o			\
699	wsncasecmp.o		\
700	wsncat.o		\
701	wsncmp.o		\
702	wsncpy.o		\
703	wspbrk.o		\
704	wsprintf.o		\
705	wsrchr.o		\
706	wsscanf.o		\
707	wsspn.o			\
708	wstod.o			\
709	wstok.o			\
710	wstol.o			\
711	wstoll.o		\
712	wsxfrm.o		\
713	wmemchr.o		\
714	wmemcmp.o		\
715	wmemcpy.o		\
716	wmemmove.o		\
717	wmemset.o		\
718	wcsstr.o		\
719	gettext.o		\
720	gettext_real.o		\
721	gettext_util.o		\
722	gettext_gnu.o		\
723	plural_parser.o		\
724	wdresolve.o		\
725	_ctype.o		\
726	isascii.o		\
727	toascii.o
728
729PORTI18N_COND=			\
730	wcstol_longlong.o	\
731	wcstoul_longlong.o
732
733AIOOBJS=			\
734	aio.o			\
735	aio_alloc.o		\
736	posix_aio.o
737
738RTOBJS=				\
739	clock_timer.o		\
740	fallocate.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	$(PORTFP)		\
865	$(PORTGEN)		\
866	$(PORTGEN64)		\
867	$(PORTI18N)		\
868	$(PORTI18N_COND)	\
869	$(PORTPRINT)		\
870	$(PORTPRINT_W)		\
871	$(PORTREGEX)		\
872	$(PORTSTDIO)		\
873	$(PORTSTDIO64)		\
874	$(PORTSTDIO_W)		\
875	$(PORTSYS)		\
876	$(PORTSYS64)		\
877	$(AIOOBJS)		\
878	$(RTOBJS)		\
879	$(TPOOLOBJS)		\
880	$(THREADSOBJS)		\
881	$(THREADSMACHOBJS)	\
882	$(THREADSASMOBJS)	\
883	$(UNICODEOBJS)		\
884	$(UNWINDMACHOBJS)	\
885	$(UNWINDASMOBJS)	\
886	$(COMSYSOBJS)		\
887	$(SYSOBJS)		\
888	$(COMSYSOBJS64)		\
889	$(SYSOBJS64)		\
890	$(VALUES)
891
892TRACEOBJS=			\
893	plockstat.o
894
895# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
896# modules whose source is provided in the $(SRC)/lib/common directory.
897# This must be done because otherwise the Sun C compiler would insert
898# its own versions of these modules and those versions contain code
899# to call out to C++ initialization functions.  Such C++ initialization
900# functions can call back into libc before thread initialization is
901# complete and this leads to segmentation violations and other problems.
902# Since libc contains no C++ code, linking with the minimal crti.o and
903# crtn.o modules is safe and avoids the problems described above.
904OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
905CRTSRCS= ../../common/sparcv9
906
907# include common library definitions
908include ../../Makefile.lib
909include ../../Makefile.lib.64
910
911# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
912# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
913# need to be compatible with the ones for the libc stuff.  Whenever the changes
914# that affect the compilation conditions of libc happened, those for libc_i18n
915# also need to be updated.
916
917CFLAGS64 += $(CCVERBOSE)
918
919# This is necessary to avoid problems with calling _ex_unwind().
920# We probably don't want any inlining anyway.
921CFLAGS64 += -xinline=
922
923# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
924# enables ASSERT() checking in the threads portion of the library.
925# This is automatically enabled for DEBUG builds, not for non-debug builds.
926THREAD_DEBUG =
927$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
928
929ALTPICS= $(TRACEOBJS:%=pics/%)
930
931$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
932$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
933
934MAPFILES =	../port/mapfile-vers mapfile-vers
935
936sparcv9_C_PICFLAGS= -K PIC
937CFLAGS64 +=	$(EXTN_CFLAGS)
938CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
939		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
940ASFLAGS=	-K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
941		$(sparcv9_AS_XARCH)
942
943# Conditionally add support for making |wordexp()| check whether
944# /usr/bin/ksh is ksh93 or not
945include ../../../Makefile.ksh93switch
946CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
947
948# Inform the run-time linker about libc specialized initialization
949RTLDINFO =	-z rtldinfo=tls_rtldinfo
950DYNFLAGS +=	$(RTLDINFO)
951
952DYNFLAGS +=	$(EXTN_DYNFLAGS)
953
954BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
955
956# Override this top level flag so the compiler builds in its native
957# C99 mode.  This has been enabled to support the complex arithmetic
958# added to libc.
959C99MODE=	$(C99_ENABLE)
960
961# libc method of building an archive
962BUILD.AR= $(RM) $@ ; \
963	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
964
965# extra files for the clean target
966CLEANFILES=			\
967	../port/gen/errlst.c	\
968	../port/gen/new_list.c	\
969	assym.h			\
970	genassym		\
971	pics/crti.o		\
972	pics/crtn.o		\
973	$(ALTPICS)
974
975CLOBBERFILES +=	$(LIB_PIC)
976
977# list of C source for lint
978SRCS=							\
979	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
980	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
981	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
982	$(PORTFP:%.o=../port/fp/%.c)			\
983	$(PORTGEN:%.o=../port/gen/%.c)			\
984	$(PORTI18N:%.o=../port/i18n/%.c)		\
985	$(PORTPRINT:%.o=../port/print/%.c)		\
986	$(PORTREGEX:%.o=../port/regex/%.c)		\
987	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
988	$(PORTSYS:%.o=../port/sys/%.c)			\
989	$(AIOOBJS:%.o=../port/aio/%.c)			\
990	$(RTOBJS:%.o=../port/rt/%.c)			\
991	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
992	$(THREADSOBJS:%.o=../port/threads/%.c)		\
993	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
994	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
995	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
996	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
997	$(FPOBJS64:%.o=$(LIBCBASE)/fp/%.c)		\
998	$(LIBCBASE)/crt/_ftou.c				\
999	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1000	$(LIBCBASE)/gen/byteorder.c			\
1001	$(LIBCBASE)/gen/ecvt.c				\
1002	$(LIBCBASE)/gen/getctxt.c			\
1003	$(LIBCBASE)/gen/lexp10.c			\
1004	$(LIBCBASE)/gen/llog10.c			\
1005	$(LIBCBASE)/gen/makectxt.c			\
1006	$(LIBCBASE)/gen/siginfolst.c			\
1007	$(LIBCBASE)/gen/siglongjmp.c			\
1008	$(LIBCBASE)/gen/swapctxt.c
1009
1010# conditional assignments
1011$(DYNLIB) := CRTI = crti.o
1012$(DYNLIB) := CRTN = crtn.o
1013
1014# Files which need the threads .il inline template
1015TIL=				\
1016	aio.o			\
1017	alloc.o			\
1018	assfail.o		\
1019	atexit.o		\
1020	atfork.o		\
1021	cancel.o		\
1022	door_calls.o		\
1023	errno.o			\
1024	getctxt.o		\
1025	lwp.o			\
1026	ma.o			\
1027	machdep.o		\
1028	posix_aio.o		\
1029	pthr_attr.o		\
1030	pthr_barrier.o		\
1031	pthr_cond.o		\
1032	pthr_mutex.o		\
1033	pthr_rwlock.o		\
1034	pthread.o		\
1035	rand.o			\
1036	rwlock.o		\
1037	scalls.o		\
1038	sched.o			\
1039	sema.o			\
1040	sigaction.o		\
1041	sigev_thread.o		\
1042	spawn.o			\
1043	stack.o			\
1044	swapctxt.o		\
1045	synch.o			\
1046	tdb_agent.o		\
1047	thr.o			\
1048	thread_interface.o	\
1049	thread_pool.o		\
1050	tls.o			\
1051	tsd.o			\
1052	unwind.o
1053
1054$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1055
1056# Files in fp, port/fp subdirectories that need base.il inline template
1057IL=				\
1058	__flt_decim.o		\
1059	decimal_bin.o
1060
1061$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1062
1063# Files in fp subdirectory which need __quad.il inline template
1064QIL=				\
1065	_Q_add.o		\
1066	_Q_cmp.o		\
1067	_Q_cmpe.o		\
1068	_Q_div.o		\
1069	_Q_dtoq.o		\
1070	_Q_fcc.o		\
1071	_Q_mul.o		\
1072	_Q_qtod.o		\
1073	_Q_qtoi.o		\
1074	_Q_qtos.o		\
1075	_Q_qtou.o		\
1076	_Q_sqrt.o		\
1077	_Q_stoq.o		\
1078	_Q_sub.o		\
1079	_Qp_qtox.o		\
1080	_Qp_qtoux.o
1081
1082$(QIL:%=pics/%) := CFLAGS64 += ../$(MACH)/fp/__quad.il
1083pics/_Qp%.o := CFLAGS64 += -I../$(MACH)/fp
1084pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1085
1086# Files in crt subdirectory which need muldiv64.il inline template
1087#CIL=	mul64.o divrem64.o
1088#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
1089
1090# large-file-aware components that should be built large
1091
1092#$(COMSYSOBJS64:%=pics/%) := \
1093#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1094
1095#$(SYSOBJS64:%=pics/%) := \
1096#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1097
1098#$(PORTGEN64:%=pics/%) := \
1099#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1100
1101#$(PORTSTDIO64:%=pics/%) := \
1102#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1103
1104#$(PORTSYS64:%=pics/%) := \
1105#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1106
1107$(PORTSTDIO_W:%=pics/%) := \
1108	CPPFLAGS += -D_WIDE
1109
1110$(PORTPRINT_W:%=pics/%) := \
1111	CPPFLAGS += -D_WIDE
1112
1113$(PORTI18N_COND:%=pics/%) := \
1114	CPPFLAGS += -D_WCS_LONGLONG
1115
1116# Files which need extra optimization
1117pics/getenv.o := sparcv9_COPTFLAG = -xO4
1118
1119.KEEP_STATE:
1120
1121all: $(LIBS) $(LIB_PIC)
1122
1123lint	:=	CPPFLAGS += -I../$(MACH)/fp
1124lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1125lint	:=	LINTFLAGS64 += -mn
1126
1127lint:
1128	@echo $(LINT.c) ... $(LDLIBS)
1129	@$(LINT.c) $(SRCS) $(LDLIBS)
1130
1131$(LINTLIB):= SRCS=../port/llib-lc
1132$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1133$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=v9
1134
1135# object files that depend on inline template
1136$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1137$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1138$(QIL:%=pics/%): ../$(MACH)/fp/__quad.il
1139#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
1140
1141# include common libc targets
1142include ../Makefile.targ
1143
1144# We need to strip out all CTF and DOF data from the static library
1145$(LIB_PIC) := DIR = pics
1146$(LIB_PIC): pics $$(PICS)
1147	$(BUILD.AR)
1148	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1149	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1150	$(AR) -ts $@ > /dev/null
1151	$(POST_PROCESS_A)
1152
1153# special cases
1154#$(STRETS:%=pics/%): crt/stret.s
1155#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1156#	$(POST_PROCESS_O)
1157
1158#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1159#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1160#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1161#	$(RM) crt/_rtld.s
1162
1163ASSYMDEP_OBJS=			\
1164	_lwp_mutex_unlock.o	\
1165	_stack_grow.o		\
1166	asm_subr.o		\
1167	tls_get_addr.o		\
1168	unwind_frame.o		\
1169	vforkx.o
1170
1171$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1172
1173$(ASSYMDEP_OBJS:%=pics/%): assym.h
1174
1175# assym.h build rules
1176
1177GENASSYM_C = ../$(MACH)/genassym.c
1178
1179# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1180#	live in Makefile.master
1181
1182CPPFLAGS.genassym = \
1183	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1184
1185genassym: $(GENASSYM_C)
1186	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc \
1187		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1188
1189OFFSETS = ../$(MACH)/offsets.in
1190
1191assym.h: $(OFFSETS) genassym
1192	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1193	./genassym >>$@
1194
1195# derived C source and related explicit dependencies
1196../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1197	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1198
1199pics/new_list.o: ../port/gen/new_list.c
1200