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