xref: /illumos-gate/usr/src/lib/libc/sparcv9/Makefile (revision 91760536453132b0d3369ad5543622a5478007e6)
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
26LIBCBASE=.
27
28LIBRARY= libc.a
29LIB_PIC= libc_pic.a
30VERS=	.1
31CPP=	/usr/lib/cpp
32TARGET_ARCH=	sparc
33
34# objects are grouped by source directory
35
36# local objects
37STRETS=
38
39CRTOBJS=			\
40	__align_cpy_2.o		\
41	__align_cpy_4.o		\
42	__align_cpy_8.o		\
43	_ftou.o			\
44	cerror.o
45
46DYNOBJS=
47
48FPOBJS=				\
49	_D_cplx_div.o		\
50	_D_cplx_div_ix.o	\
51	_D_cplx_div_rx.o	\
52	_D_cplx_mul.o		\
53	_F_cplx_div.o		\
54	_F_cplx_div_ix.o	\
55	_F_cplx_div_rx.o	\
56	_F_cplx_mul.o		\
57	_Q_add.o		\
58	_Q_cmp.o		\
59	_Q_cmpe.o		\
60	_Q_cplx_div.o		\
61	_Q_cplx_div_ix.o	\
62	_Q_cplx_div_rx.o	\
63	_Q_cplx_lr_div.o	\
64	_Q_cplx_lr_div_ix.o	\
65	_Q_cplx_lr_div_rx.o	\
66	_Q_cplx_lr_mul.o	\
67	_Q_cplx_mul.o		\
68	_Q_div.o		\
69	_Q_dtoq.o		\
70	_Q_fcc.o		\
71	_Q_itoq.o		\
72	_Q_mul.o		\
73	_Q_neg.o		\
74	_Q_qtod.o		\
75	_Q_qtoi.o		\
76	_Q_qtos.o		\
77	_Q_qtou.o		\
78	_Q_scl.o		\
79	_Q_sqrt.o		\
80	_Q_stoq.o		\
81	_Q_sub.o		\
82	_Q_utoq.o
83
84FPOBJS64=			\
85	_Qp_qtox.o		\
86	_Qp_qtoux.o		\
87	_Qp_xtoq.o		\
88	_Qp_uxtoq.o		\
89	__dtoul.o		\
90	__ftoul.o
91
92FPASMOBJS=			\
93	_Q_get_rp_rd.o		\
94	__quad_mag64.o		\
95	fpgetmask.o		\
96	fpgetrnd.o		\
97	fpgetsticky.o		\
98	fpsetmask.o		\
99	fpsetrnd.o		\
100	fpsetsticky.o
101
102$(__GNUC)FPASMOBJS +=		\
103	__quad.o
104
105ATOMICOBJS=			\
106	atomic.o
107
108XATTROBJS=			\
109	xattr_common.o
110
111COMOBJS=			\
112	bcmp.o			\
113	bcopy.o			\
114	bsearch.o		\
115	bzero.o			\
116	ffs.o			\
117	memccpy.o		\
118	qsort.o			\
119	strtol.o		\
120	strtoul.o
121
122GENOBJS=			\
123	_getsp.o		\
124	_xregs_clrptr.o		\
125	abs.o			\
126	alloca.o		\
127	byteorder.o		\
128	cuexit.o		\
129	ecvt.o			\
130	getctxt.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	__getloadavg.o		\
164	__rusagesys.o		\
165	__signotify.o		\
166	__sigrt.o		\
167	__time.o		\
168	_lgrp_home_fast.o	\
169	_lgrpsys.o		\
170	_nfssys.o		\
171	_portfs.o		\
172	_pset.o			\
173	_rpcsys.o		\
174	_sigaction.o		\
175	_so_accept.o		\
176	_so_bind.o		\
177	_so_connect.o		\
178	_so_getpeername.o	\
179	_so_getsockname.o	\
180	_so_getsockopt.o	\
181	_so_listen.o		\
182	_so_recv.o		\
183	_so_recvfrom.o		\
184	_so_recvmsg.o		\
185	_so_send.o		\
186	_so_sendmsg.o		\
187	_so_sendto.o		\
188	_so_setsockopt.o	\
189	_so_shutdown.o		\
190	_so_socket.o		\
191	_so_socketpair.o	\
192	_sockconfig.o		\
193	access.o		\
194	acct.o			\
195	acl.o			\
196	adjtime.o		\
197	alarm.o			\
198	brk.o			\
199	chdir.o			\
200	chmod.o			\
201	chown.o			\
202	chroot.o		\
203	cladm.o			\
204	close.o			\
205	creat.o			\
206	dup.o			\
207	execve.o		\
208	exit.o			\
209	facl.o			\
210	fchdir.o		\
211	fchmod.o		\
212	fchown.o		\
213	fchroot.o		\
214	fcntl.o			\
215	fdsync.o		\
216	fpathconf.o		\
217	fstat.o			\
218	fstatfs.o		\
219	fstatvfs.o		\
220	getcpuid.o		\
221	getdents.o		\
222	getegid.o		\
223	geteuid.o		\
224	getgid.o		\
225	getgroups.o		\
226	gethrtime.o		\
227	getitimer.o		\
228	getmsg.o		\
229	getpid.o		\
230	getpmsg.o		\
231	getppid.o		\
232	getrlimit.o		\
233	getuid.o		\
234	gtty.o			\
235	install_utrap.o		\
236	ioctl.o			\
237	kaio.o			\
238	kill.o			\
239	lchown.o		\
240	link.o			\
241	llseek.o		\
242	lseek.o			\
243	lstat.o			\
244	memcntl.o		\
245	mincore.o		\
246	mkdir.o			\
247	mknod.o			\
248	mmap.o			\
249	modctl.o		\
250	mount.o			\
251	mprotect.o		\
252	munmap.o		\
253	nice.o			\
254	ntp_adjtime.o		\
255	ntp_gettime.o		\
256	open.o			\
257	p_online.o		\
258	pathconf.o		\
259	pause.o			\
260	pcsample.o		\
261	pollsys.o		\
262	pread.o			\
263	priocntlset.o		\
264	processor_bind.o	\
265	processor_info.o	\
266	profil.o		\
267	putmsg.o		\
268	putpmsg.o		\
269	pwrite.o		\
270	read.o			\
271	readlink.o		\
272	readv.o			\
273	rename.o		\
274	resolvepath.o		\
275	rmdir.o			\
276	seteguid.o		\
277	setgid.o		\
278	setgroups.o		\
279	setitimer.o		\
280	setreid.o		\
281	setrlimit.o		\
282	setuid.o		\
283	sigaltstk.o		\
284	sigprocmsk.o		\
285	sigsendset.o		\
286	sigsuspend.o		\
287	stat.o			\
288	statfs.o		\
289	statvfs.o		\
290	stty.o			\
291	symlink.o		\
292	sync.o			\
293	sysconfig.o		\
294	sysfs.o			\
295	sysinfo.o		\
296	syslwp.o		\
297	times.o			\
298	ulimit.o		\
299	umask.o			\
300	umount2.o		\
301	unlink.o		\
302	utime.o			\
303	utimes.o		\
304	utssys.o		\
305	uucopy.o		\
306	vhangup.o		\
307	waitid.o		\
308	write.o			\
309	writev.o		\
310	yield.o
311
312SYSOBJS=			\
313	__clock_gettime.o	\
314	__getcontext.o		\
315	_lwp_mutex_unlock.o	\
316	_stack_grow.o		\
317	door.o			\
318	forkx.o			\
319	forkallx.o		\
320	gettimeofday.o		\
321	pipe.o			\
322	sparc_utrap_install.o	\
323	syscall.o		\
324	tls_get_addr.o		\
325	uadmin.o		\
326	umount.o		\
327	uname.o			\
328	vforkx.o
329
330# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
331# This macro should ALWAYS be empty; native APIs are already 'large file'.
332PORTGEN64=
333
334# objects from source under ../port
335PORTFP=				\
336	__flt_decim.o		\
337	__flt_rounds.o		\
338	__tbl_10_b.o		\
339	__tbl_10_h.o		\
340	__tbl_10_s.o		\
341	__tbl_2_b.o		\
342	__tbl_2_h.o		\
343	__tbl_2_s.o		\
344	__tbl_fdq.o		\
345	__tbl_tens.o		\
346	__x_power.o		\
347	_base_sup.o		\
348	aconvert.o		\
349	decimal_bin.o		\
350	double_decim.o		\
351	econvert.o		\
352	fconvert.o		\
353	file_decim.o		\
354	finite.o		\
355	fp_data.o		\
356	func_decim.o		\
357	gconvert.o		\
358	hex_bin.o		\
359	ieee_globals.o		\
360	pack_float.o		\
361	sigfpe.o		\
362	string_decim.o
363
364PORTGEN=			\
365	_env_data.o		\
366	_xftw.o			\
367	a64l.o			\
368	abort.o			\
369	addsev.o		\
370	assert.o		\
371	attrat.o		\
372	atof.o			\
373	atoi.o			\
374	atol.o			\
375	atoll.o			\
376	attropen.o		\
377	atexit.o		\
378	atfork.o		\
379	basename.o		\
380	calloc.o		\
381	catgets.o		\
382	catopen.o		\
383	cfgetispeed.o		\
384	cfgetospeed.o		\
385	cfree.o			\
386	cfsetispeed.o		\
387	cfsetospeed.o		\
388	cftime.o		\
389	clock.o			\
390	closedir.o		\
391	closefrom.o		\
392	confstr.o		\
393	crypt.o			\
394	csetlen.o		\
395	ctime.o			\
396	ctime_r.o		\
397	deflt.o			\
398	directio.o		\
399	dirname.o		\
400	div.o			\
401	drand48.o		\
402	dup2.o			\
403	env_data.o		\
404	err.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	klpdlib.o		\
464	l64a.o			\
465	lckpwdf.o		\
466	lconstants.o		\
467	ldivide.o		\
468	lexp10.o		\
469	lfind.o			\
470	lfmt.o			\
471	lfmt_log.o		\
472	lldiv.o			\
473	llog10.o		\
474	lltostr.o		\
475	lmath.o			\
476	localtime.o		\
477	lsearch.o		\
478	madvise.o		\
479	malloc.o		\
480	memalign.o		\
481	mkdev.o			\
482	mkdtemp.o		\
483	mkfifo.o		\
484	mkstemp.o		\
485	mktemp.o		\
486	mlock.o			\
487	mlockall.o		\
488	mon.o			\
489	msync.o			\
490	munlock.o		\
491	munlockall.o		\
492	ndbm.o			\
493	nftw.o			\
494	nlspath_checks.o	\
495	nsparse.o		\
496	nss_common.o		\
497	nss_dbdefs.o		\
498	nss_deffinder.o		\
499	opendir.o		\
500	opt_data.o		\
501	perror.o		\
502	pfmt.o			\
503	pfmt_data.o		\
504	pfmt_print.o		\
505	plock.o			\
506	poll.o			\
507	posix_fadvise.o		\
508	posix_fallocate.o	\
509	posix_madvise.o		\
510	posix_memalign.o	\
511	priocntl.o		\
512	privlib.o		\
513	priv_str_xlate.o	\
514	psiginfo.o		\
515	psignal.o		\
516	pt.o			\
517	putpwent.o		\
518	putspent.o		\
519	raise.o			\
520	rand.o			\
521	random.o		\
522	rctlops.o		\
523	readdir.o		\
524	readdir_r.o		\
525	realpath.o		\
526	reboot.o		\
527	regexpr.o		\
528	remove.o		\
529	rewinddir.o		\
530	rindex.o		\
531	scandir.o		\
532	seekdir.o		\
533	select.o		\
534	setlabel.o		\
535	setpriority.o		\
536	settimeofday.o		\
537	sh_locks.o		\
538	sigflag.o		\
539	siglist.o		\
540	sigsend.o		\
541	sigsetops.o		\
542	ssignal.o		\
543	stack.o			\
544	str2sig.o		\
545	strcase_charmap.o	\
546	strcat.o		\
547	strcspn.o		\
548	strdup.o		\
549	strerror.o		\
550	strncat.o		\
551	strlcat.o		\
552	strncasecmp.o		\
553	strpbrk.o		\
554	strrchr.o		\
555	strsep.o		\
556	strsignal.o		\
557	strspn.o		\
558	strstr.o		\
559	strtod.o		\
560	strtoimax.o		\
561	strtok.o		\
562	strtok_r.o		\
563	strtoll.o		\
564	strtoull.o		\
565	strtoumax.o		\
566	swab.o			\
567	swapctl.o		\
568	sysconf.o		\
569	syslog.o		\
570	tcdrain.o		\
571	tcflow.o		\
572	tcflush.o		\
573	tcgetattr.o		\
574	tcgetpgrp.o		\
575	tcgetsid.o		\
576	tcsendbreak.o		\
577	tcsetattr.o		\
578	tcsetpgrp.o		\
579	tell.o			\
580	telldir.o		\
581	tfind.o			\
582	time_data.o		\
583	time_gdata.o		\
584	truncate.o		\
585	tsdalloc.o		\
586	tsearch.o		\
587	ttyname.o		\
588	ttyslot.o		\
589	ualarm.o		\
590	ucred.o			\
591	valloc.o		\
592	vlfmt.o			\
593	vpfmt.o			\
594	waitpid.o		\
595	walkstack.o		\
596	wdata.o			\
597	xgetwidth.o		\
598	xpg4.o			\
599	xpg6.o
600
601PORTPRINT_W=			\
602	doprnt_w.o
603
604PORTPRINT=			\
605	doprnt.o		\
606	fprintf.o		\
607	printf.o		\
608	snprintf.o		\
609	sprintf.o		\
610	vfprintf.o		\
611	vprintf.o		\
612	vsnprintf.o		\
613	vsprintf.o		\
614	vwprintf.o		\
615	wprintf.o
616
617# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
618# This macro should ALWAYS be empty; native APIs are already 'large file'.
619PORTSTDIO64=
620
621PORTSTDIO_W=			\
622	doscan_w.o
623
624PORTSTDIO=			\
625	__extensions.o		\
626	_endopen.o		\
627	_filbuf.o		\
628	_findbuf.o		\
629	_flsbuf.o		\
630	_wrtchk.o		\
631	clearerr.o		\
632	ctermid.o		\
633	ctermid_r.o		\
634	cuserid.o		\
635	data.o			\
636	doscan.o		\
637	fdopen.o		\
638	feof.o			\
639	ferror.o		\
640	fgetc.o			\
641	fgets.o			\
642	fileno.o		\
643	flockf.o		\
644	flush.o			\
645	fopen.o			\
646	fpos.o			\
647	fputc.o			\
648	fputs.o			\
649	fread.o			\
650	fseek.o			\
651	fseeko.o		\
652	ftell.o			\
653	ftello.o		\
654	fwrite.o		\
655	getc.o			\
656	getchar.o		\
657	getpass.o		\
658	gets.o			\
659	getw.o			\
660	popen.o			\
661	putc.o			\
662	putchar.o		\
663	puts.o			\
664	putw.o			\
665	rewind.o		\
666	scanf.o			\
667	setbuf.o		\
668	setbuffer.o		\
669	setvbuf.o		\
670	system.o		\
671	tempnam.o		\
672	tmpfile.o		\
673	tmpnam_r.o		\
674	ungetc.o		\
675	mse.o			\
676	vscanf.o		\
677	vwscanf.o		\
678	wscanf.o
679
680PORTI18N=			\
681	__fgetwc_xpg5.o		\
682	__fgetws_xpg5.o		\
683	__fputwc_xpg5.o		\
684	__fputws_xpg5.o		\
685	__ungetwc_xpg5.o	\
686	getwchar.o		\
687	putwchar.o		\
688	putws.o			\
689	strtows.o		\
690	wcstoimax.o		\
691	wcstol.o		\
692	wcstoul.o		\
693	wcswcs.o		\
694	wscasecmp.o		\
695	wscat.o			\
696	wschr.o			\
697	wscmp.o			\
698	wscpy.o			\
699	wscspn.o		\
700	wsdup.o			\
701	wslen.o			\
702	wsncasecmp.o		\
703	wsncat.o		\
704	wsncmp.o		\
705	wsncpy.o		\
706	wspbrk.o		\
707	wsprintf.o		\
708	wsrchr.o		\
709	wsscanf.o		\
710	wsspn.o			\
711	wstod.o			\
712	wstok.o			\
713	wstol.o			\
714	wstoll.o		\
715	wsxfrm.o		\
716	wmemchr.o		\
717	wmemcmp.o		\
718	wmemcpy.o		\
719	wmemmove.o		\
720	wmemset.o		\
721	wcsstr.o		\
722	gettext.o		\
723	gettext_real.o		\
724	gettext_util.o		\
725	gettext_gnu.o		\
726	plural_parser.o		\
727	wdresolve.o		\
728	_ctype.o		\
729	isascii.o		\
730	toascii.o
731
732PORTI18N_COND=			\
733	wcstol_longlong.o	\
734	wcstoul_longlong.o
735
736AIOOBJS=			\
737	aio.o			\
738	aio_alloc.o		\
739	posix_aio.o
740
741RTOBJS=				\
742	clock_timer.o		\
743	mqueue.o		\
744	pos4obj.o		\
745	sched.o			\
746	sem.o			\
747	shm.o			\
748	sigev_thread.o
749
750TPOOLOBJS=			\
751	thread_pool.o
752
753THREADSOBJS=			\
754	alloc.o			\
755	assfail.o		\
756	cancel.o		\
757	door_calls.o		\
758	pthr_attr.o		\
759	pthr_barrier.o		\
760	pthr_cond.o		\
761	pthr_mutex.o		\
762	pthr_rwlock.o		\
763	pthread.o		\
764	rwlock.o		\
765	scalls.o		\
766	sema.o			\
767	sigaction.o		\
768	spawn.o			\
769	synch.o			\
770	tdb_agent.o		\
771	thr.o			\
772	thread_interface.o	\
773	tls.o			\
774	tsd.o
775
776THREADSMACHOBJS=		\
777	machdep.o
778
779THREADSASMOBJS=			\
780	asm_subr.o
781
782UNICODEOBJS=			\
783	u8_textprep.o		\
784	uconv.o
785
786UNWINDMACHOBJS=			\
787	unwind.o
788
789UNWINDASMOBJS=			\
790	unwind_frame.o
791
792# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
793# This macro should ALWAYS be empty; native APIs are already 'large file'.
794PORTSYS64=
795
796PORTSYS=			\
797	_autofssys.o		\
798	acctctl.o		\
799	bsd_signal.o		\
800	corectl.o		\
801	exacctsys.o		\
802	execl.o			\
803	execle.o		\
804	execv.o			\
805	faccessat.o		\
806	fsmisc.o		\
807	fstatat.o		\
808	getpagesizes.o		\
809	getpeerucred.o		\
810	inst_sync.o		\
811	issetugid.o		\
812	label.o			\
813	libc_fcntl.o		\
814	libc_link.o		\
815	libc_open.o		\
816	lockf.o			\
817	lwp.o			\
818	lwp_cond.o		\
819	lwp_rwlock.o		\
820	lwp_sigmask.o		\
821	meminfosys.o		\
822	msgsys.o		\
823	nfssys.o		\
824	openat.o		\
825	pgrpsys.o		\
826	posix_sigwait.o		\
827	ppriv.o			\
828	psetsys.o		\
829	rctlsys.o		\
830	sbrk.o			\
831	semsys.o		\
832	set_errno.o		\
833	sharefs.o		\
834	shmsys.o		\
835	sidsys.o		\
836	siginterrupt.o		\
837	signal.o		\
838	sigpending.o		\
839	sigstack.o		\
840	tasksys.o		\
841	time.o			\
842	time_util.o		\
843	ucontext.o		\
844	ustat.o			\
845	zone.o
846
847PORTREGEX=			\
848	glob.o			\
849	regcmp.o		\
850	regex.o			\
851	wordexp.o
852
853VALUES=	values-Xa.o
854
855MOSTOBJS=			\
856	$(STRETS)		\
857	$(CRTOBJS)		\
858	$(DYNOBJS)		\
859	$(FPOBJS)		\
860	$(FPOBJS64)		\
861	$(FPASMOBJS)		\
862	$(ATOMICOBJS)		\
863	$(XATTROBJS)		\
864	$(COMOBJS)		\
865	$(GENOBJS)		\
866	$(PORTFP)		\
867	$(PORTGEN)		\
868	$(PORTGEN64)		\
869	$(PORTI18N)		\
870	$(PORTI18N_COND)	\
871	$(PORTPRINT)		\
872	$(PORTPRINT_W)		\
873	$(PORTREGEX)		\
874	$(PORTSTDIO)		\
875	$(PORTSTDIO64)		\
876	$(PORTSTDIO_W)		\
877	$(PORTSYS)		\
878	$(PORTSYS64)		\
879	$(AIOOBJS)		\
880	$(RTOBJS)		\
881	$(TPOOLOBJS)		\
882	$(THREADSOBJS)		\
883	$(THREADSMACHOBJS)	\
884	$(THREADSASMOBJS)	\
885	$(UNICODEOBJS)		\
886	$(UNWINDMACHOBJS)	\
887	$(UNWINDASMOBJS)	\
888	$(COMSYSOBJS)		\
889	$(SYSOBJS)		\
890	$(COMSYSOBJS64)		\
891	$(SYSOBJS64)		\
892	$(VALUES)
893
894TRACEOBJS=			\
895	plockstat.o
896
897# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
898# modules whose source is provided in the $(SRC)/lib/common directory.
899# This must be done because otherwise the Sun C compiler would insert
900# its own versions of these modules and those versions contain code
901# to call out to C++ initialization functions.  Such C++ initialization
902# functions can call back into libc before thread initialization is
903# complete and this leads to segmentation violations and other problems.
904# Since libc contains no C++ code, linking with the minimal crti.o and
905# crtn.o modules is safe and avoids the problems described above.
906OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
907CRTSRCS= ../../common/sparcv9
908
909# include common library definitions
910include ../../Makefile.lib
911include ../../Makefile.lib.64
912
913# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
914# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
915# need to be compatible with the ones for the libc stuff.  Whenever the changes
916# that affect the compilation conditions of libc happened, those for libc_i18n
917# also need to be updated.
918
919CFLAGS64 += $(CCVERBOSE)
920
921# This is necessary to avoid problems with calling _ex_unwind().
922# We probably don't want any inlining anyway.
923CFLAGS64 += -xinline=
924
925# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
926# enables ASSERT() checking in the threads portion of the library.
927# This is automatically enabled for DEBUG builds, not for non-debug builds.
928THREAD_DEBUG =
929$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_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) $(THREAD_DEBUG) \
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/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 -m64
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