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