xref: /illumos-gate/usr/src/lib/libc/sparcv9/Makefile.com (revision ef2504f26d1ea5859db9838255bb63f488f1b050)
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#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27LIBCDIR=	$(SRC)/lib/libc
28LIB_PIC= libc_pic.a
29VERS=	.1
30CPP=	/usr/lib/cpp
31TARGET_ARCH=	sparc
32
33# objects are grouped by source directory
34
35# local objects
36STRETS=
37
38CRTOBJS=			\
39	__align_cpy_2.o		\
40	__align_cpy_4.o		\
41	__align_cpy_8.o		\
42	_ftou.o			\
43	cerror.o
44
45DYNOBJS=
46
47FPOBJS=				\
48	_D_cplx_div.o		\
49	_D_cplx_div_ix.o	\
50	_D_cplx_div_rx.o	\
51	_D_cplx_mul.o		\
52	_F_cplx_div.o		\
53	_F_cplx_div_ix.o	\
54	_F_cplx_div_rx.o	\
55	_F_cplx_mul.o		\
56	_Q_add.o		\
57	_Q_cmp.o		\
58	_Q_cmpe.o		\
59	_Q_cplx_div.o		\
60	_Q_cplx_div_ix.o	\
61	_Q_cplx_div_rx.o	\
62	_Q_cplx_lr_div.o	\
63	_Q_cplx_lr_div_ix.o	\
64	_Q_cplx_lr_div_rx.o	\
65	_Q_cplx_lr_mul.o	\
66	_Q_cplx_mul.o		\
67	_Q_div.o		\
68	_Q_dtoq.o		\
69	_Q_fcc.o		\
70	_Q_itoq.o		\
71	_Q_mul.o		\
72	_Q_neg.o		\
73	_Q_qtod.o		\
74	_Q_qtoi.o		\
75	_Q_qtos.o		\
76	_Q_qtou.o		\
77	_Q_scl.o		\
78	_Q_sqrt.o		\
79	_Q_stoq.o		\
80	_Q_sub.o		\
81	_Q_utoq.o
82
83FPOBJS64=			\
84	_Qp_qtox.o		\
85	_Qp_qtoux.o		\
86	_Qp_xtoq.o		\
87	_Qp_uxtoq.o		\
88	__dtoul.o		\
89	__ftoul.o
90
91FPASMOBJS=			\
92	_Q_get_rp_rd.o		\
93	__quad_mag64.o		\
94	fpgetmask.o		\
95	fpgetrnd.o		\
96	fpgetsticky.o		\
97	fpsetmask.o		\
98	fpsetrnd.o		\
99	fpsetsticky.o
100
101$(__GNUC)FPASMOBJS +=		\
102	__quad.o
103
104ATOMICOBJS=			\
105	atomic.o
106
107XATTROBJS=			\
108	xattr_common.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	strtoll.o		\
121	strtoull.o
122
123GENOBJS=			\
124	_getsp.o		\
125	_xregs_clrptr.o		\
126	abs.o			\
127	alloca.o		\
128	byteorder.o		\
129	cuexit.o		\
130	ecvt.o			\
131	getctxt.o		\
132	lock.o			\
133	makectxt.o		\
134	memchr.o		\
135	memcmp.o		\
136	new_list.o		\
137	setjmp.o		\
138	siginfolst.o		\
139	siglongjmp.o		\
140	sparc_data.o		\
141	strcasecmp.o		\
142	strchr.o		\
143	strcmp.o		\
144	strlcpy.o		\
145	strncmp.o		\
146	strncpy.o		\
147	strnlen.o		\
148	swapctxt.o		\
149	sync_instruction_memory.o
150
151# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
152# This macro should ALWAYS be empty; native APIs are already 'large file'.
153COMSYSOBJS64=
154
155SYSOBJS64=
156
157COMSYSOBJS=			\
158	__clock_timer.o		\
159	__getloadavg.o		\
160	__rusagesys.o		\
161	__signotify.o		\
162	__sigrt.o		\
163	__time.o		\
164	_lgrp_home_fast.o	\
165	_lgrpsys.o		\
166	_nfssys.o		\
167	_portfs.o		\
168	_pset.o			\
169	_rpcsys.o		\
170	_sigaction.o		\
171	_so_accept.o		\
172	_so_bind.o		\
173	_so_connect.o		\
174	_so_getpeername.o	\
175	_so_getsockname.o	\
176	_so_getsockopt.o	\
177	_so_listen.o		\
178	_so_recv.o		\
179	_so_recvfrom.o		\
180	_so_recvmsg.o		\
181	_so_send.o		\
182	_so_sendmsg.o		\
183	_so_sendto.o		\
184	_so_setsockopt.o	\
185	_so_shutdown.o		\
186	_so_socket.o		\
187	_so_socketpair.o	\
188	_sockconfig.o		\
189	access.o		\
190	acct.o			\
191	acl.o			\
192	adjtime.o		\
193	alarm.o			\
194	brk.o			\
195	chdir.o			\
196	chmod.o			\
197	chown.o			\
198	chroot.o		\
199	cladm.o			\
200	close.o			\
201	creat.o			\
202	dup.o			\
203	execve.o		\
204	exit.o			\
205	facl.o			\
206	fchdir.o		\
207	fchmod.o		\
208	fchown.o		\
209	fchroot.o		\
210	fcntl.o			\
211	fdsync.o		\
212	fpathconf.o		\
213	fstat.o			\
214	fstatfs.o		\
215	fstatvfs.o		\
216	getcpuid.o		\
217	getdents.o		\
218	getegid.o		\
219	geteuid.o		\
220	getgid.o		\
221	getgroups.o		\
222	gethrtime.o		\
223	getitimer.o		\
224	getmsg.o		\
225	getpid.o		\
226	getpmsg.o		\
227	getppid.o		\
228	getrlimit.o		\
229	getuid.o		\
230	gtty.o			\
231	install_utrap.o		\
232	ioctl.o			\
233	kaio.o			\
234	kill.o			\
235	lchown.o		\
236	link.o			\
237	llseek.o		\
238	lseek.o			\
239	lstat.o			\
240	memcntl.o		\
241	mincore.o		\
242	mkdir.o			\
243	mknod.o			\
244	mmap.o			\
245	mmapobjsys.o		\
246	modctl.o		\
247	mount.o			\
248	mprotect.o		\
249	munmap.o		\
250	nice.o			\
251	ntp_adjtime.o		\
252	ntp_gettime.o		\
253	open.o			\
254	p_online.o		\
255	pathconf.o		\
256	pause.o			\
257	pcsample.o		\
258	pollsys.o		\
259	pread.o			\
260	priocntlset.o		\
261	processor_bind.o	\
262	processor_info.o	\
263	profil.o		\
264	putmsg.o		\
265	putpmsg.o		\
266	pwrite.o		\
267	read.o			\
268	readlink.o		\
269	readv.o			\
270	rename.o		\
271	resolvepath.o		\
272	rmdir.o			\
273	seteguid.o		\
274	setgid.o		\
275	setgroups.o		\
276	setitimer.o		\
277	setreid.o		\
278	setrlimit.o		\
279	setuid.o		\
280	sigaltstk.o		\
281	sigprocmsk.o		\
282	sigsendset.o		\
283	sigsuspend.o		\
284	stat.o			\
285	statfs.o		\
286	statvfs.o		\
287	stty.o			\
288	symlink.o		\
289	sync.o			\
290	sysconfig.o		\
291	sysfs.o			\
292	sysinfo.o		\
293	syslwp.o		\
294	times.o			\
295	ulimit.o		\
296	umask.o			\
297	umount2.o		\
298	unlink.o		\
299	utime.o			\
300	utimes.o		\
301	utssys.o		\
302	uucopy.o		\
303	vhangup.o		\
304	waitid.o		\
305	write.o			\
306	writev.o		\
307	yield.o
308
309SYSOBJS=			\
310	__clock_gettime.o	\
311	__getcontext.o		\
312	_lwp_mutex_unlock.o	\
313	_stack_grow.o		\
314	door.o			\
315	forkx.o			\
316	forkallx.o		\
317	gettimeofday.o		\
318	pipe.o			\
319	sparc_utrap_install.o	\
320	syscall.o		\
321	tls_get_addr.o		\
322	uadmin.o		\
323	umount.o		\
324	uname.o			\
325	vforkx.o
326
327# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
328# This macro should ALWAYS be empty; native APIs are already 'large file'.
329PORTGEN64=
330
331# objects from source under $(LIBCDIR)/port
332PORTFP=				\
333	__flt_decim.o		\
334	__flt_rounds.o		\
335	__tbl_10_b.o		\
336	__tbl_10_h.o		\
337	__tbl_10_s.o		\
338	__tbl_2_b.o		\
339	__tbl_2_h.o		\
340	__tbl_2_s.o		\
341	__tbl_fdq.o		\
342	__tbl_tens.o		\
343	__x_power.o		\
344	_base_sup.o		\
345	aconvert.o		\
346	decimal_bin.o		\
347	double_decim.o		\
348	econvert.o		\
349	fconvert.o		\
350	file_decim.o		\
351	finite.o		\
352	fp_data.o		\
353	func_decim.o		\
354	gconvert.o		\
355	hex_bin.o		\
356	ieee_globals.o		\
357	pack_float.o		\
358	sigfpe.o		\
359	string_decim.o
360
361PORTGEN=			\
362	_env_data.o		\
363	_xftw.o			\
364	a64l.o			\
365	abort.o			\
366	addsev.o		\
367	assert.o		\
368	attrat.o		\
369	atof.o			\
370	atoi.o			\
371	atol.o			\
372	atoll.o			\
373	attropen.o		\
374	atexit.o		\
375	atfork.o		\
376	basename.o		\
377	calloc.o		\
378	catgets.o		\
379	catopen.o		\
380	cfgetispeed.o		\
381	cfgetospeed.o		\
382	cfree.o			\
383	cfsetispeed.o		\
384	cfsetospeed.o		\
385	cftime.o		\
386	clock.o			\
387	closedir.o		\
388	closefrom.o		\
389	confstr.o		\
390	crypt.o			\
391	csetlen.o		\
392	ctime.o			\
393	ctime_r.o		\
394	deflt.o			\
395	directio.o		\
396	dirname.o		\
397	div.o			\
398	drand48.o		\
399	dup2.o			\
400	env_data.o		\
401	err.o			\
402	errno.o			\
403	euclen.o		\
404	event_port.o		\
405	execvp.o		\
406	fattach.o		\
407	fdetach.o		\
408	fdopendir.o		\
409	fmtmsg.o		\
410	ftime.o			\
411	ftok.o			\
412	ftw.o			\
413	gcvt.o			\
414	getauxv.o		\
415	getcwd.o		\
416	getdate_err.o		\
417	getdtblsize.o		\
418	getenv.o		\
419	getexecname.o		\
420	getgrnam.o		\
421	getgrnam_r.o		\
422	gethostid.o		\
423	gethostname.o		\
424	gethz.o			\
425	getisax.o		\
426	getloadavg.o		\
427	getlogin.o		\
428	getmntent.o		\
429	getnetgrent.o		\
430	getopt.o		\
431	getopt_long.o		\
432	getpagesize.o		\
433	getpw.o			\
434	getpwnam.o		\
435	getpwnam_r.o		\
436	getrusage.o		\
437	getspent.o		\
438	getspent_r.o		\
439	getsubopt.o		\
440	gettxt.o		\
441	getusershell.o		\
442	getut.o			\
443	getutx.o		\
444	getvfsent.o		\
445	getwd.o			\
446	getwidth.o		\
447	getxby_door.o		\
448	gtxt.o			\
449	hsearch.o		\
450	iconv.o			\
451	imaxabs.o		\
452	imaxdiv.o		\
453	index.o			\
454	initgroups.o		\
455	insque.o		\
456	isaexec.o		\
457	isastream.o		\
458	isatty.o		\
459	killpg.o		\
460	klpdlib.o		\
461	l64a.o			\
462	lckpwdf.o		\
463	lconstants.o		\
464	ldivide.o		\
465	lexp10.o		\
466	lfind.o			\
467	lfmt.o			\
468	lfmt_log.o		\
469	lldiv.o			\
470	llog10.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	posix_fadvise.o		\
505	posix_fallocate.o	\
506	posix_madvise.o		\
507	posix_memalign.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	strsep.o		\
553	strsignal.o		\
554	strspn.o		\
555	strstr.o		\
556	strtod.o		\
557	strtoimax.o		\
558	strtok.o		\
559	strtok_r.o		\
560	strtoumax.o		\
561	swab.o			\
562	swapctl.o		\
563	sysconf.o		\
564	syslog.o		\
565	tcdrain.o		\
566	tcflow.o		\
567	tcflush.o		\
568	tcgetattr.o		\
569	tcgetpgrp.o		\
570	tcgetsid.o		\
571	tcsendbreak.o		\
572	tcsetattr.o		\
573	tcsetpgrp.o		\
574	tell.o			\
575	telldir.o		\
576	tfind.o			\
577	time_data.o		\
578	time_gdata.o		\
579	truncate.o		\
580	tsdalloc.o		\
581	tsearch.o		\
582	ttyname.o		\
583	ttyslot.o		\
584	ualarm.o		\
585	ucred.o			\
586	valloc.o		\
587	vlfmt.o			\
588	vpfmt.o			\
589	waitpid.o		\
590	walkstack.o		\
591	wdata.o			\
592	xgetwidth.o		\
593	xpg4.o			\
594	xpg6.o
595
596PORTPRINT_W=			\
597	doprnt_w.o
598
599PORTPRINT=			\
600	asprintf.o		\
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	mqueue.o		\
740	pos4obj.o		\
741	sched.o			\
742	sem.o			\
743	shm.o			\
744	sigev_thread.o
745
746TPOOLOBJS=			\
747	thread_pool.o
748
749THREADSOBJS=			\
750	alloc.o			\
751	assfail.o		\
752	cancel.o		\
753	door_calls.o		\
754	pthr_attr.o		\
755	pthr_barrier.o		\
756	pthr_cond.o		\
757	pthr_mutex.o		\
758	pthr_rwlock.o		\
759	pthread.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
778UNICODEOBJS=			\
779	u8_textprep.o		\
780	uconv.o
781
782UNWINDMACHOBJS=			\
783	unwind.o
784
785UNWINDASMOBJS=			\
786	unwind_frame.o
787
788# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
789# This macro should ALWAYS be empty; native APIs are already 'large file'.
790PORTSYS64=
791
792PORTSYS=			\
793	_autofssys.o		\
794	acctctl.o		\
795	bsd_signal.o		\
796	corectl.o		\
797	exacctsys.o		\
798	execl.o			\
799	execle.o		\
800	execv.o			\
801	faccessat.o		\
802	fsmisc.o		\
803	fstatat.o		\
804	getpagesizes.o		\
805	getpeerucred.o		\
806	inst_sync.o		\
807	issetugid.o		\
808	label.o			\
809	libc_fcntl.o		\
810	libc_link.o		\
811	libc_open.o		\
812	lockf.o			\
813	lwp.o			\
814	lwp_cond.o		\
815	lwp_rwlock.o		\
816	lwp_sigmask.o		\
817	meminfosys.o		\
818	msgsys.o		\
819	nfssys.o		\
820	openat.o		\
821	pgrpsys.o		\
822	posix_sigwait.o		\
823	ppriv.o			\
824	psetsys.o		\
825	rctlsys.o		\
826	sbrk.o			\
827	semsys.o		\
828	set_errno.o		\
829	sharefs.o		\
830	shmsys.o		\
831	sidsys.o		\
832	siginterrupt.o		\
833	signal.o		\
834	sigpending.o		\
835	sigstack.o		\
836	tasksys.o		\
837	time.o			\
838	time_util.o		\
839	ucontext.o		\
840	ustat.o			\
841	zone.o
842
843PORTREGEX=			\
844	glob.o			\
845	regcmp.o		\
846	regex.o			\
847	wordexp.o
848
849VALUES=	values-Xa.o
850
851MOSTOBJS=			\
852	$(STRETS)		\
853	$(CRTOBJS)		\
854	$(DYNOBJS)		\
855	$(FPOBJS)		\
856	$(FPOBJS64)		\
857	$(FPASMOBJS)		\
858	$(ATOMICOBJS)		\
859	$(XATTROBJS)		\
860	$(COMOBJS)		\
861	$(GENOBJS)		\
862	$(PRFOBJS)		\
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 $(SRC)/lib/Makefile.lib
908include $(SRC)/lib/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
916# we need to override the default SONAME here because we might
917# be building a variant object (still libc.so.1, but different filename)
918SONAME = libc.so.1
919
920CFLAGS64 += $(CCVERBOSE)
921
922# This is necessary to avoid problems with calling _ex_unwind().
923# We probably don't want any inlining anyway.
924CFLAGS64 += -xinline=
925
926# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
927# enables ASSERT() checking in the threads portion of the library.
928# This is automatically enabled for DEBUG builds, not for non-debug builds.
929THREAD_DEBUG =
930$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
931
932# Make string literals read-only to save memory.
933CFLAGS64 += $(XSTRCONST)
934
935ALTPICS= $(TRACEOBJS:%=pics/%)
936
937$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
938$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
939
940MAPFILES =	$(LIBCDIR)/port/mapfile-vers $(LIBCDIR)/sparcv9/mapfile-vers \
941		$(MAPFILE_AUX)
942
943sparcv9_C_PICFLAGS= -K PIC
944CFLAGS64 +=	$(EXTN_CFLAGS)
945CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
946		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
947ASFLAGS=	$(EXTN_ASFLAGS) -K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
948		$(sparcv9_AS_XARCH)
949
950# Conditionally add support for making |wordexp()| check whether
951# /usr/bin/ksh is ksh93 or not
952include $(LIBCDIR)/../../Makefile.ksh93switch
953CPPFLAGS += -DWORDEXP_KSH93=$(ON_BUILD_KSH93_AS_BINKSH)
954
955# Inform the run-time linker about libc specialized initialization
956RTLDINFO =	-z rtldinfo=tls_rtldinfo
957DYNFLAGS +=	$(RTLDINFO)
958
959DYNFLAGS +=	$(EXTN_DYNFLAGS)
960
961BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
962
963# Override this top level flag so the compiler builds in its native
964# C99 mode.  This has been enabled to support the complex arithmetic
965# added to libc.
966C99MODE=	$(C99_ENABLE)
967
968# libc method of building an archive
969BUILD.AR= $(RM) $@ ; \
970	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
971
972# extra files for the clean target
973CLEANFILES=			\
974	$(LIBCDIR)/port/gen/errlst.c	\
975	$(LIBCDIR)/port/gen/new_list.c	\
976	assym.h			\
977	genassym		\
978	pics/crti.o		\
979	pics/crtn.o		\
980	$(ALTPICS)
981
982CLOBBERFILES +=	$(LIB_PIC)
983
984# list of C source for lint
985SRCS=							\
986	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
987	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
988	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
989	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
990	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
991	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
992	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
993	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
994	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
995	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
996	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
997	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
998	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
999	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
1000	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
1001	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
1002	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
1003	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
1004	$(FPOBJS64:%.o=$(LIBCBASE)/fp/%.c)		\
1005	$(LIBCBASE)/crt/_ftou.c				\
1006	$(LIBCBASE)/gen/_xregs_clrptr.c			\
1007	$(LIBCBASE)/gen/byteorder.c			\
1008	$(LIBCBASE)/gen/ecvt.c				\
1009	$(LIBCBASE)/gen/getctxt.c			\
1010	$(LIBCBASE)/gen/makectxt.c			\
1011	$(LIBCBASE)/gen/siginfolst.c			\
1012	$(LIBCBASE)/gen/siglongjmp.c			\
1013	$(LIBCBASE)/gen/swapctxt.c
1014
1015# conditional assignments
1016$(DYNLIB) := CRTI = crti.o
1017$(DYNLIB) := CRTN = crtn.o
1018
1019# Files which need the threads .il inline template
1020TIL=				\
1021	aio.o			\
1022	alloc.o			\
1023	assfail.o		\
1024	atexit.o		\
1025	atfork.o		\
1026	cancel.o		\
1027	door_calls.o		\
1028	errno.o			\
1029	getctxt.o		\
1030	lwp.o			\
1031	ma.o			\
1032	machdep.o		\
1033	posix_aio.o		\
1034	pthr_attr.o		\
1035	pthr_barrier.o		\
1036	pthr_cond.o		\
1037	pthr_mutex.o		\
1038	pthr_rwlock.o		\
1039	pthread.o		\
1040	rand.o			\
1041	rwlock.o		\
1042	scalls.o		\
1043	sched.o			\
1044	sema.o			\
1045	sigaction.o		\
1046	sigev_thread.o		\
1047	spawn.o			\
1048	stack.o			\
1049	swapctxt.o		\
1050	synch.o			\
1051	tdb_agent.o		\
1052	thr.o			\
1053	thread_interface.o	\
1054	thread_pool.o		\
1055	tls.o			\
1056	tsd.o			\
1057	unwind.o
1058
1059$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il
1060
1061# Files in fp, port/fp subdirectories that need base.il inline template
1062IL=				\
1063	__flt_decim.o		\
1064	decimal_bin.o
1065
1066$(IL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/fp/base.il
1067
1068# Files in fp subdirectory which need __quad.il inline template
1069QIL=				\
1070	_Q_add.o		\
1071	_Q_cmp.o		\
1072	_Q_cmpe.o		\
1073	_Q_div.o		\
1074	_Q_dtoq.o		\
1075	_Q_fcc.o		\
1076	_Q_mul.o		\
1077	_Q_qtod.o		\
1078	_Q_qtoi.o		\
1079	_Q_qtos.o		\
1080	_Q_qtou.o		\
1081	_Q_sqrt.o		\
1082	_Q_stoq.o		\
1083	_Q_sub.o		\
1084	_Qp_qtox.o		\
1085	_Qp_qtoux.o
1086
1087$(QIL:%=pics/%) := CFLAGS64 += $(LIBCDIR)/$(MACH)/fp/__quad.il
1088pics/_Qp%.o := CFLAGS64 += -I$(LIBCDIR)/$(MACH)/fp
1089pics/_Q%.o := sparcv9_COPTFLAG = -xO4 -xchip=ultra
1090
1091# Files in crt subdirectory which need muldiv64.il inline template
1092#CIL=	mul64.o divrem64.o
1093#$(CIL:%=pics/%) := CFLAGS += $(LIBCBASE)/crt/mul64.il
1094
1095# large-file-aware components that should be built large
1096
1097#$(COMSYSOBJS64:%=pics/%) := \
1098#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1099
1100#$(SYSOBJS64:%=pics/%) := \
1101#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1102
1103#$(PORTGEN64:%=pics/%) := \
1104#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1105
1106#$(PORTSTDIO64:%=pics/%) := \
1107#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1108
1109#$(PORTSYS64:%=pics/%) := \
1110#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1111
1112$(PORTSTDIO_W:%=pics/%) := \
1113	CPPFLAGS += -D_WIDE
1114
1115$(PORTPRINT_W:%=pics/%) := \
1116	CPPFLAGS += -D_WIDE
1117
1118$(PORTI18N_COND:%=pics/%) := \
1119	CPPFLAGS += -D_WCS_LONGLONG
1120
1121# Files which need extra optimization
1122pics/getenv.o := sparcv9_COPTFLAG = -xO4
1123
1124.KEEP_STATE:
1125
1126all: $(LIBS) $(LIB_PIC)
1127
1128lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
1129lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1130lint	:=	LINTFLAGS64 += -mn
1131
1132lint:
1133	@echo $(LINT.c) ... $(LDLIBS)
1134	@$(LINT.c) $(SRCS) $(LDLIBS)
1135
1136$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
1137$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1138$(LINTLIB):= LINTFLAGS64=-nvx -m64
1139
1140# object files that depend on inline template
1141$(TIL:%=pics/%): $(LIBCBASE)/threads/sparcv9.il
1142$(IL:%=pics/%): $(LIBCBASE)/fp/base.il
1143$(QIL:%=pics/%): $(LIBCDIR)/$(MACH)/fp/__quad.il
1144#$(CIL:%=pics/%): $(LIBCBASE)/crt/muldiv64.il
1145
1146# include common libc targets
1147include $(LIBCDIR)/Makefile.targ
1148
1149# We need to strip out all CTF and DOF data from the static library
1150$(LIB_PIC) := DIR = pics
1151$(LIB_PIC): pics $$(PICS)
1152	$(BUILD.AR)
1153	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1154	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
1155	$(AR) -ts $@ > /dev/null
1156	$(POST_PROCESS_A)
1157
1158# special cases
1159#$(STRETS:%=pics/%): crt/stret.s
1160#	$(AS) $(ASFLAGS) -DSTRET$(@F:stret%.o=%) crt/stret.s -o $@
1161#	$(POST_PROCESS_O)
1162
1163#crt/_rtbootld.s:	crt/_rtboot.s crt/_rtld.c
1164#	$(CC) $(CPPFLAGS) -O -S -K pic crt/_rtld.c -o crt/_rtld.s
1165#	$(CAT) crt/_rtboot.s crt/_rtld.s > $@
1166#	$(RM) crt/_rtld.s
1167
1168ASSYMDEP_OBJS=			\
1169	_lwp_mutex_unlock.o	\
1170	_stack_grow.o		\
1171	asm_subr.o		\
1172	tls_get_addr.o		\
1173	unwind_frame.o		\
1174	vforkx.o
1175
1176$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
1177
1178$(ASSYMDEP_OBJS:%=pics/%): assym.h
1179
1180# assym.h build rules
1181
1182GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
1183
1184# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1185#	live in Makefile.master
1186
1187CPPFLAGS.genassym = \
1188	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1189
1190genassym: $(GENASSYM_C)
1191	$(NATIVECC) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc \
1192		$(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1193
1194OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
1195
1196assym.h: $(OFFSETS) genassym
1197	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1198	./genassym >>$@
1199
1200# derived C source and related explicit dependencies
1201$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
1202	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
1203
1204pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
1205