xref: /titanic_41/usr/src/lib/libc/sparcv9/Makefile (revision f127cb91970601c2695eead0ee127f1cac48bb7a)
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	err.o			\
407	errno.o			\
408	euclen.o		\
409	event_port.o		\
410	execvp.o		\
411	fattach.o		\
412	fdetach.o		\
413	fdopendir.o		\
414	fmtmsg.o		\
415	ftime.o			\
416	ftok.o			\
417	ftw.o			\
418	gcvt.o			\
419	getauxv.o		\
420	getcwd.o		\
421	getdate_err.o		\
422	getdtblsize.o		\
423	getenv.o		\
424	getexecname.o		\
425	getgrnam.o		\
426	getgrnam_r.o		\
427	gethostid.o		\
428	gethostname.o		\
429	gethz.o			\
430	getisax.o		\
431	getloadavg.o		\
432	getlogin.o		\
433	getmntent.o		\
434	getnetgrent.o		\
435	getopt.o		\
436	getopt_long.o		\
437	getpagesize.o		\
438	getpw.o			\
439	getpwnam.o		\
440	getpwnam_r.o		\
441	getrusage.o		\
442	getspent.o		\
443	getspent_r.o		\
444	getsubopt.o		\
445	gettxt.o		\
446	getusershell.o		\
447	getut.o			\
448	getutx.o		\
449	getvfsent.o		\
450	getwd.o			\
451	getwidth.o		\
452	getxby_door.o		\
453	gtxt.o			\
454	hsearch.o		\
455	iconv.o			\
456	imaxabs.o		\
457	imaxdiv.o		\
458	index.o			\
459	initgroups.o		\
460	insque.o		\
461	isaexec.o		\
462	isastream.o		\
463	isatty.o		\
464	killpg.o		\
465	l64a.o			\
466	lckpwdf.o		\
467	lconstants.o		\
468	ldivide.o		\
469	lfind.o			\
470	lfmt.o			\
471	lfmt_log.o		\
472	lldiv.o			\
473	lltostr.o		\
474	lmath.o			\
475	localtime.o		\
476	lsearch.o		\
477	madvise.o		\
478	malloc.o		\
479	memalign.o		\
480	mkdev.o			\
481	mkdtemp.o		\
482	mkfifo.o		\
483	mkstemp.o		\
484	mktemp.o		\
485	mlock.o			\
486	mlockall.o		\
487	mon.o			\
488	msync.o			\
489	munlock.o		\
490	munlockall.o		\
491	ndbm.o			\
492	nftw.o			\
493	nlspath_checks.o	\
494	nsparse.o		\
495	nss_common.o		\
496	nss_dbdefs.o		\
497	nss_deffinder.o		\
498	opendir.o		\
499	opt_data.o		\
500	perror.o		\
501	pfmt.o			\
502	pfmt_data.o		\
503	pfmt_print.o		\
504	plock.o			\
505	poll.o			\
506	priocntl.o		\
507	privlib.o		\
508	priv_str_xlate.o	\
509	psiginfo.o		\
510	psignal.o		\
511	pt.o			\
512	putpwent.o		\
513	putspent.o		\
514	raise.o			\
515	rand.o			\
516	random.o		\
517	rctlops.o		\
518	readdir.o		\
519	readdir_r.o		\
520	realpath.o		\
521	reboot.o		\
522	regexpr.o		\
523	rename.o		\
524	rewinddir.o		\
525	rindex.o		\
526	scandir.o		\
527	seekdir.o		\
528	select.o		\
529	setlabel.o		\
530	setpriority.o		\
531	settimeofday.o		\
532	sh_locks.o		\
533	sigflag.o		\
534	siglist.o		\
535	sigsend.o		\
536	sigsetops.o		\
537	ssignal.o		\
538	stack.o			\
539	str2sig.o		\
540	strcase_charmap.o	\
541	strcat.o		\
542	strcspn.o		\
543	strdup.o		\
544	strerror.o		\
545	strncat.o		\
546	strlcat.o		\
547	strncasecmp.o		\
548	strpbrk.o		\
549	strrchr.o		\
550	strsignal.o		\
551	strspn.o		\
552	strstr.o		\
553	strtod.o		\
554	strtoimax.o		\
555	strtok.o		\
556	strtok_r.o		\
557	strtoll.o		\
558	strtoull.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	wait3.o			\
589	wait4.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	fcntl.o			\
805	fsmisc.o		\
806	fstatat.o		\
807	fsync.o			\
808	getpeerucred.o		\
809	inst_sync.o		\
810	issetugid.o		\
811	label.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	$(COMOBJS)		\
862	$(GENOBJS)		\
863	$(PORTFP)		\
864	$(PORTGEN)		\
865	$(PORTGEN64)		\
866	$(PORTI18N)		\
867	$(PORTI18N_COND)	\
868	$(PORTPRINT)		\
869	$(PORTPRINT_W)		\
870	$(PORTREGEX)		\
871	$(PORTSTDIO)		\
872	$(PORTSTDIO64)		\
873	$(PORTSTDIO_W)		\
874	$(PORTSYS)		\
875	$(PORTSYS64)		\
876	$(AIOOBJS)		\
877	$(RTOBJS)		\
878	$(TPOOLOBJS)		\
879	$(THREADSOBJS)		\
880	$(THREADSMACHOBJS)	\
881	$(THREADSASMOBJS)	\
882	$(UNICODEOBJS)		\
883	$(UNWINDMACHOBJS)	\
884	$(UNWINDASMOBJS)	\
885	$(COMSYSOBJS)		\
886	$(SYSOBJS)		\
887	$(COMSYSOBJS64)		\
888	$(SYSOBJS64)		\
889	$(VALUES)
890
891TRACEOBJS=			\
892	plockstat.o
893
894# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
895# modules whose source is provided in the $(SRC)/lib/common directory.
896# This must be done because otherwise the Sun C compiler would insert
897# its own versions of these modules and those versions contain code
898# to call out to C++ initialization functions.  Such C++ initialization
899# functions can call back into libc before thread initialization is
900# complete and this leads to segmentation violations and other problems.
901# Since libc contains no C++ code, linking with the minimal crti.o and
902# crtn.o modules is safe and avoids the problems described above.
903OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
904CRTSRCS= ../../common/sparcv9
905
906# include common library definitions
907include ../../Makefile.lib
908include ../../Makefile.lib.64
909
910# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
911# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
912# need to be compatible with the ones for the libc stuff.  Whenever the changes
913# that affect the compilation conditions of libc happened, those for libc_i18n
914# also need to be updated.
915
916CFLAGS64 += $(CCVERBOSE)
917
918# This is necessary to avoid problems with calling _ex_unwind().
919# We probably don't want any inlining anyway.
920CFLAGS64 += -xinline=
921
922# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
923# enables ASSERT() checking in the threads portion of the library.
924# This is automatically enabled for DEBUG builds, not for non-debug builds.
925THREAD_DEBUG =
926$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
927
928CFLAGS64 += $(THREAD_DEBUG)
929
930ALTPICS= $(TRACEOBJS:%=pics/%)
931
932$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
933$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
934
935MAPFILES =	../port/mapfile-vers mapfile-vers
936
937sparcv9_C_PICFLAGS= -K PIC
938CFLAGS64 +=	$(EXTN_CFLAGS)
939CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) \
940		-I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master)
941ASFLAGS=	-K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
942		$(sparcv9_AS_XARCH)
943
944# Conditionally add support for making |wordexp()| check whether
945# /usr/bin/ksh is ksh93 or not
946include ../../../Makefile.ksh93switch
947CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
948
949# Inform the run-time linker about libc specialized initialization
950RTLDINFO =	-z rtldinfo=tls_rtldinfo
951DYNFLAGS +=	$(RTLDINFO)
952
953DYNFLAGS +=	$(EXTN_DYNFLAGS)
954
955BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
956
957# Override this top level flag so the compiler builds in its native
958# C99 mode.  This has been enabled to support the complex arithmetic
959# added to libc.
960C99MODE=	$(C99_ENABLE)
961
962# libc method of building an archive
963BUILD.AR= $(RM) $@ ; \
964	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
965
966# extra files for the clean target
967CLEANFILES=			\
968	../port/gen/errlst.c	\
969	../port/gen/new_list.c	\
970	assym.h			\
971	genassym		\
972	pics/crti.o		\
973	pics/crtn.o		\
974	$(ALTPICS)
975
976CLOBBERFILES +=	$(LIB_PIC)
977
978# list of C source for lint
979SRCS=							\
980	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.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) $(LIB_PIC) := DYNOBJS = _rtbootld.o
1012$(DYNLIB) := CRTI = crti.o
1013$(DYNLIB) := CRTN = crtn.o
1014
1015# Files which need the threads .il inline template
1016TIL=				\
1017	aio.o			\
1018	alloc.o			\
1019	assfail.o		\
1020	atexit.o		\
1021	atfork.o		\
1022	cancel.o		\
1023	door_calls.o		\
1024	errno.o			\
1025	getctxt.o		\
1026	lwp.o			\
1027	ma.o			\
1028	machdep.o		\
1029	posix_aio.o		\
1030	pthr_attr.o		\
1031	pthr_barrier.o		\
1032	pthr_cond.o		\
1033	pthr_mutex.o		\
1034	pthr_rwlock.o		\
1035	pthread.o		\
1036	rand.o			\
1037	rtsched.o		\
1038	rwlock.o		\
1039	scalls.o		\
1040	sema.o			\
1041	sigaction.o		\
1042	sigev_thread.o		\
1043	spawn.o			\
1044	stack.o			\
1045	swapctxt.o		\
1046	synch.o			\
1047	tdb_agent.o		\
1048	thr.o			\
1049	thread_interface.o	\
1050	thread_pool.o		\
1051	tls.o			\
1052	tsd.o			\
1053	unwind.o
1054
1055$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1056
1057# Files in fp, port/fp subdirectories that need base.il inline template
1058IL=				\
1059	__flt_decim.o		\
1060	decimal_bin.o
1061
1062$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1063
1064# Files in fp subdirectory which need __quad.il inline template
1065QIL=				\
1066	_Q_add.o		\
1067	_Q_cmp.o		\
1068	_Q_cmpe.o		\
1069	_Q_div.o		\
1070	_Q_dtoq.o		\
1071	_Q_fcc.o		\
1072	_Q_mul.o		\
1073	_Q_qtod.o		\
1074	_Q_qtoi.o		\
1075	_Q_qtos.o		\
1076	_Q_qtou.o		\
1077	_Q_sqrt.o		\
1078	_Q_stoq.o		\
1079	_Q_sub.o		\
1080	_Qp_qtox.o		\
1081	_Qp_qtoux.o
1082
1083$(QIL:%=pics/%) := CFLAGS64 += ../$(MACH)/fp/__quad.il
1084pics/_Qp%.o := CFLAGS64 += -I../$(MACH)/fp
1085pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1086
1087# Files in crt subdirectory which need muldiv64.il inline template
1088#CIL=	mul64.o divrem64.o
1089#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
1090
1091# large-file-aware components that should be built large
1092
1093#$(COMSYSOBJS64:%=pics/%) := \
1094#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1095
1096#$(SYSOBJS64:%=pics/%) := \
1097#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1098
1099#$(PORTGEN64:%=pics/%) := \
1100#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1101
1102#$(PORTSTDIO64:%=pics/%) := \
1103#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1104
1105#$(PORTSYS64:%=pics/%) := \
1106#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1107
1108$(PORTSTDIO_W:%=pics/%) := \
1109	CPPFLAGS += -D_WIDE
1110
1111$(PORTPRINT_W:%=pics/%) := \
1112	CPPFLAGS += -D_WIDE
1113
1114$(PORTI18N_COND:%=pics/%) := \
1115	CPPFLAGS += -D_WCS_LONGLONG
1116
1117# Files which need extra optimization
1118pics/getenv.o := sparcv9_COPTFLAG = -xO4
1119
1120.KEEP_STATE:
1121
1122all: $(LIBS) $(LIB_PIC)
1123
1124lint	:=	CPPFLAGS += -I../$(MACH)/fp
1125lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1126lint	:=	LINTFLAGS64 += -mn
1127
1128lint:
1129	@echo $(LINT.c) ... $(LDLIBS)
1130	@$(LINT.c) $(SRCS) $(LDLIBS)
1131
1132$(LINTLIB):= SRCS=../port/llib-lc
1133$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1134$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=v9
1135
1136# object files that depend on inline template
1137$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1138$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1139$(QIL:%=pics/%): ../$(MACH)/fp/__quad.il
1140#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
1141
1142# include common libc targets
1143include ../Makefile.targ
1144
1145# We need to strip out all CTF and DOF data from the static library
1146$(LIB_PIC) := DIR = pics
1147$(LIB_PIC): pics $$(PICS)
1148	$(BUILD.AR)
1149	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1150	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1151	$(AR) -ts $@ > /dev/null
1152	$(POST_PROCESS_A)
1153
1154# special cases
1155#$(STRETS:%=pics/%): crt/stret.s
1156#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1157#	$(POST_PROCESS_O)
1158
1159#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1160#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1161#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1162#	$(RM) crt/_rtld.s
1163
1164ASSYMDEP_OBJS=			\
1165	_lwp_mutex_unlock.o	\
1166	_stack_grow.o		\
1167	asm_subr.o		\
1168	tls_get_addr.o		\
1169	unwind_frame.o		\
1170	vforkx.o
1171
1172$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1173
1174$(ASSYMDEP_OBJS:%=pics/%): assym.h
1175
1176# assym.h build rules
1177
1178GENASSYM_C = ../$(MACH)/genassym.c
1179
1180# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1181#	live in Makefile.master
1182
1183CPPFLAGS.genassym = \
1184	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1185
1186genassym: $(GENASSYM_C)
1187	$(NATIVECC) -I$(LIBCBASE)/inc -I../inc \
1188		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1189
1190OFFSETS = ../$(MACH)/offsets.in
1191
1192assym.h: $(OFFSETS) genassym
1193	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1194	./genassym >>$@
1195
1196# derived C source and related explicit dependencies
1197../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1198	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1199
1200pics/new_list.o: ../port/gen/new_list.c
1201