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