xref: /illumos-gate/usr/src/lib/libc/sparcv9/Makefile (revision cce0e03bb2d07f0fe27cabb93acae9c23655859f)
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	l64a.o			\
468	lckpwdf.o		\
469	lconstants.o		\
470	ldivide.o		\
471	lfind.o			\
472	lfmt.o			\
473	lfmt_log.o		\
474	lldiv.o			\
475	lltostr.o		\
476	lmath.o			\
477	localtime.o		\
478	lsearch.o		\
479	madvise.o		\
480	malloc.o		\
481	memalign.o		\
482	mkdev.o			\
483	mkdtemp.o		\
484	mkfifo.o		\
485	mkstemp.o		\
486	mktemp.o		\
487	mlock.o			\
488	mlockall.o		\
489	mon.o			\
490	msync.o			\
491	munlock.o		\
492	munlockall.o		\
493	ndbm.o			\
494	nftw.o			\
495	nlspath_checks.o	\
496	nsparse.o		\
497	nss_common.o		\
498	nss_dbdefs.o		\
499	nss_deffinder.o		\
500	opendir.o		\
501	opt_data.o		\
502	perror.o		\
503	pfmt.o			\
504	pfmt_data.o		\
505	pfmt_print.o		\
506	plock.o			\
507	poll.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	strsignal.o		\
553	strspn.o		\
554	strstr.o		\
555	strtod.o		\
556	strtoimax.o		\
557	strtok.o		\
558	strtok_r.o		\
559	strtoll.o		\
560	strtoull.o		\
561	strtoumax.o		\
562	swab.o			\
563	swapctl.o		\
564	sysconf.o		\
565	syslog.o		\
566	tcdrain.o		\
567	tcflow.o		\
568	tcflush.o		\
569	tcgetattr.o		\
570	tcgetpgrp.o		\
571	tcgetsid.o		\
572	tcsendbreak.o		\
573	tcsetattr.o		\
574	tcsetpgrp.o		\
575	tell.o			\
576	telldir.o		\
577	tfind.o			\
578	time_data.o		\
579	time_gdata.o		\
580	truncate.o		\
581	tsdalloc.o		\
582	tsearch.o		\
583	ttyname.o		\
584	ttyslot.o		\
585	ualarm.o		\
586	ucred.o			\
587	valloc.o		\
588	vlfmt.o			\
589	vpfmt.o			\
590	waitpid.o		\
591	walkstack.o		\
592	wdata.o			\
593	xgetwidth.o		\
594	xpg4.o			\
595	xpg6.o
596
597PORTPRINT_W=			\
598	doprnt_w.o
599
600PORTPRINT=			\
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	fallocate.o		\
740	mqueue.o		\
741	pos4obj.o		\
742	sched.o			\
743	sem.o			\
744	shm.o			\
745	sigev_thread.o
746
747TPOOLOBJS=			\
748	thread_pool.o
749
750THREADSOBJS=			\
751	alloc.o			\
752	assfail.o		\
753	cancel.o		\
754	door_calls.o		\
755	pthr_attr.o		\
756	pthr_barrier.o		\
757	pthr_cond.o		\
758	pthr_mutex.o		\
759	pthr_rwlock.o		\
760	pthread.o		\
761	rtsched.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
929CFLAGS64 += $(THREAD_DEBUG)
930
931ALTPICS= $(TRACEOBJS:%=pics/%)
932
933$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
934$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
935
936MAPFILES =	../port/mapfile-vers mapfile-vers
937
938sparcv9_C_PICFLAGS= -K PIC
939CFLAGS64 +=	$(EXTN_CFLAGS)
940CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) \
941		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
942ASFLAGS=	-K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
943		$(sparcv9_AS_XARCH)
944
945# Conditionally add support for making |wordexp()| check whether
946# /usr/bin/ksh is ksh93 or not
947include ../../../Makefile.ksh93switch
948CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
949
950# Inform the run-time linker about libc specialized initialization
951RTLDINFO =	-z rtldinfo=tls_rtldinfo
952DYNFLAGS +=	$(RTLDINFO)
953
954DYNFLAGS +=	$(EXTN_DYNFLAGS)
955
956BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
957
958# Override this top level flag so the compiler builds in its native
959# C99 mode.  This has been enabled to support the complex arithmetic
960# added to libc.
961C99MODE=	$(C99_ENABLE)
962
963# libc method of building an archive
964BUILD.AR= $(RM) $@ ; \
965	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
966
967# extra files for the clean target
968CLEANFILES=			\
969	../port/gen/errlst.c	\
970	../port/gen/new_list.c	\
971	assym.h			\
972	genassym		\
973	pics/crti.o		\
974	pics/crtn.o		\
975	$(ALTPICS)
976
977CLOBBERFILES +=	$(LIB_PIC)
978
979# list of C source for lint
980SRCS=							\
981	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
982	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
983	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
984	$(PORTFP:%.o=../port/fp/%.c)			\
985	$(PORTGEN:%.o=../port/gen/%.c)			\
986	$(PORTI18N:%.o=../port/i18n/%.c)		\
987	$(PORTPRINT:%.o=../port/print/%.c)		\
988	$(PORTREGEX:%.o=../port/regex/%.c)		\
989	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
990	$(PORTSYS:%.o=../port/sys/%.c)			\
991	$(AIOOBJS:%.o=../port/aio/%.c)			\
992	$(RTOBJS:%.o=../port/rt/%.c)			\
993	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
994	$(THREADSOBJS:%.o=../port/threads/%.c)		\
995	$(THREADSMACHOBJS:%.o=../$(MACH)/threads/%.c)	\
996	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
997	$(UNWINDMACHOBJS:%.o=../port/unwind/%.c)	\
998	$(FPOBJS:%.o=../$(MACH)/fp/%.c)			\
999	$(FPOBJS64:%.o=$(LIBCBASE)/fp/%.c)		\
1000	$(LIBCBASE)/crt/_ftou.c				\
1001	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1002	$(LIBCBASE)/gen/byteorder.c			\
1003	$(LIBCBASE)/gen/ecvt.c				\
1004	$(LIBCBASE)/gen/getctxt.c			\
1005	$(LIBCBASE)/gen/lexp10.c			\
1006	$(LIBCBASE)/gen/llog10.c			\
1007	$(LIBCBASE)/gen/makectxt.c			\
1008	$(LIBCBASE)/gen/siginfolst.c			\
1009	$(LIBCBASE)/gen/siglongjmp.c			\
1010	$(LIBCBASE)/gen/swapctxt.c
1011
1012# conditional assignments
1013$(DYNLIB) := CRTI = crti.o
1014$(DYNLIB) := CRTN = crtn.o
1015
1016# Files which need the threads .il inline template
1017TIL=				\
1018	aio.o			\
1019	alloc.o			\
1020	assfail.o		\
1021	atexit.o		\
1022	atfork.o		\
1023	cancel.o		\
1024	door_calls.o		\
1025	errno.o			\
1026	getctxt.o		\
1027	lwp.o			\
1028	ma.o			\
1029	machdep.o		\
1030	posix_aio.o		\
1031	pthr_attr.o		\
1032	pthr_barrier.o		\
1033	pthr_cond.o		\
1034	pthr_mutex.o		\
1035	pthr_rwlock.o		\
1036	pthread.o		\
1037	rand.o			\
1038	rtsched.o		\
1039	rwlock.o		\
1040	scalls.o		\
1041	sema.o			\
1042	sigaction.o		\
1043	sigev_thread.o		\
1044	spawn.o			\
1045	stack.o			\
1046	swapctxt.o		\
1047	synch.o			\
1048	tdb_agent.o		\
1049	thr.o			\
1050	thread_interface.o	\
1051	thread_pool.o		\
1052	tls.o			\
1053	tsd.o			\
1054	unwind.o
1055
1056$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1057
1058# Files in fp, port/fp subdirectories that need base.il inline template
1059IL=				\
1060	__flt_decim.o		\
1061	decimal_bin.o
1062
1063$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1064
1065# Files in fp subdirectory which need __quad.il inline template
1066QIL=				\
1067	_Q_add.o		\
1068	_Q_cmp.o		\
1069	_Q_cmpe.o		\
1070	_Q_div.o		\
1071	_Q_dtoq.o		\
1072	_Q_fcc.o		\
1073	_Q_mul.o		\
1074	_Q_qtod.o		\
1075	_Q_qtoi.o		\
1076	_Q_qtos.o		\
1077	_Q_qtou.o		\
1078	_Q_sqrt.o		\
1079	_Q_stoq.o		\
1080	_Q_sub.o		\
1081	_Qp_qtox.o		\
1082	_Qp_qtoux.o
1083
1084$(QIL:%=pics/%) := CFLAGS64 += ../$(MACH)/fp/__quad.il
1085pics/_Qp%.o := CFLAGS64 += -I../$(MACH)/fp
1086pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1087
1088# Files in crt subdirectory which need muldiv64.il inline template
1089#CIL=	mul64.o divrem64.o
1090#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
1091
1092# large-file-aware components that should be built large
1093
1094#$(COMSYSOBJS64:%=pics/%) := \
1095#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1096
1097#$(SYSOBJS64:%=pics/%) := \
1098#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1099
1100#$(PORTGEN64:%=pics/%) := \
1101#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1102
1103#$(PORTSTDIO64:%=pics/%) := \
1104#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1105
1106#$(PORTSYS64:%=pics/%) := \
1107#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1108
1109$(PORTSTDIO_W:%=pics/%) := \
1110	CPPFLAGS += -D_WIDE
1111
1112$(PORTPRINT_W:%=pics/%) := \
1113	CPPFLAGS += -D_WIDE
1114
1115$(PORTI18N_COND:%=pics/%) := \
1116	CPPFLAGS += -D_WCS_LONGLONG
1117
1118# Files which need extra optimization
1119pics/getenv.o := sparcv9_COPTFLAG = -xO4
1120
1121.KEEP_STATE:
1122
1123all: $(LIBS) $(LIB_PIC)
1124
1125lint	:=	CPPFLAGS += -I../$(MACH)/fp
1126lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1127lint	:=	LINTFLAGS64 += -mn
1128
1129lint:
1130	@echo $(LINT.c) ... $(LDLIBS)
1131	@$(LINT.c) $(SRCS) $(LDLIBS)
1132
1133$(LINTLIB):= SRCS=../port/llib-lc
1134$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1135$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=v9
1136
1137# object files that depend on inline template
1138$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1139$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1140$(QIL:%=pics/%): ../$(MACH)/fp/__quad.il
1141#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
1142
1143# include common libc targets
1144include ../Makefile.targ
1145
1146# We need to strip out all CTF and DOF data from the static library
1147$(LIB_PIC) := DIR = pics
1148$(LIB_PIC): pics $$(PICS)
1149	$(BUILD.AR)
1150	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1151	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1152	$(AR) -ts $@ > /dev/null
1153	$(POST_PROCESS_A)
1154
1155# special cases
1156#$(STRETS:%=pics/%): crt/stret.s
1157#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1158#	$(POST_PROCESS_O)
1159
1160#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1161#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1162#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1163#	$(RM) crt/_rtld.s
1164
1165ASSYMDEP_OBJS=			\
1166	_lwp_mutex_unlock.o	\
1167	_stack_grow.o		\
1168	asm_subr.o		\
1169	tls_get_addr.o		\
1170	unwind_frame.o		\
1171	vforkx.o
1172
1173$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1174
1175$(ASSYMDEP_OBJS:%=pics/%): assym.h
1176
1177# assym.h build rules
1178
1179GENASSYM_C = ../$(MACH)/genassym.c
1180
1181# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1182#	live in Makefile.master
1183
1184CPPFLAGS.genassym = \
1185	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1186
1187genassym: $(GENASSYM_C)
1188	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc \
1189		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1190
1191OFFSETS = ../$(MACH)/offsets.in
1192
1193assym.h: $(OFFSETS) genassym
1194	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1195	./genassym >>$@
1196
1197# derived C source and related explicit dependencies
1198../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1199	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1200
1201pics/new_list.o: ../port/gen/new_list.c
1202