xref: /illumos-gate/usr/src/lib/libc/amd64/Makefile (revision f808c858fa61e7769218966759510a8b1190dfcf)
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	qsort.o			\
94	strtol.o		\
95	strtoul.o
96
97GENOBJS=			\
98	_getsp.o		\
99	abs.o			\
100	alloca.o		\
101	byteorder.o		\
102	cache.o			\
103	cuexit.o		\
104	ecvt.o			\
105	errlst.o		\
106	amd64_data.o		\
107	ldivide.o		\
108	lexp10.o		\
109	llog10.o		\
110	lock.o			\
111	ltostr.o		\
112	makectxt.o		\
113	memccpy.o		\
114	memchr.o		\
115	memcmp.o		\
116	memcpy.o		\
117	memset.o		\
118	new_list.o		\
119	setjmp.o		\
120	siginfolst.o		\
121	siglongjmp.o		\
122	strcmp.o		\
123	strcpy.o		\
124	strlen.o		\
125	strncmp.o		\
126	strncpy.o		\
127	sync_instruction_memory.o
128
129# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
130# This macro should ALWAYS be empty; native APIs are already 'large file'.
131COMSYSOBJS64=
132
133SYSOBJS64=
134
135COMSYSOBJS=			\
136	__clock_timer.o		\
137	__fcntl.o		\
138	__getloadavg.o		\
139	__rusagesys.o		\
140	__signotify.o		\
141	__sigrt.o		\
142	__time.o		\
143	_lgrp_home_fast.o	\
144	_lgrpsys.o		\
145	_nfssys.o		\
146	_portfs.o		\
147	_pset.o			\
148	_rename.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	access.o		\
170	acct.o			\
171	acl.o			\
172	adjtime.o		\
173	alarm.o			\
174	brk.o			\
175	chdir.o			\
176	chmod.o			\
177	chown.o			\
178	chroot.o		\
179	cladm.o			\
180	close.o			\
181	creat.o			\
182	dup.o			\
183	execve.o		\
184	exit.o			\
185	facl.o			\
186	fchdir.o		\
187	fchmod.o		\
188	fchown.o		\
189	fchroot.o		\
190	fdsync.o		\
191	fpathconf.o		\
192	fstat.o			\
193	fstatfs.o		\
194	fstatvfs.o		\
195	getcpuid.o		\
196	getdents.o		\
197	getegid.o		\
198	geteuid.o		\
199	getgid.o		\
200	getgroups.o		\
201	gethrtime.o		\
202	getitimer.o		\
203	getmsg.o		\
204	getpagesizes.o		\
205	getpid.o		\
206	getpmsg.o		\
207	getppid.o		\
208	getrlimit.o		\
209	getuid.o		\
210	gtty.o			\
211	install_utrap.o		\
212	ioctl.o			\
213	kaio.o			\
214	kill.o			\
215	lchown.o		\
216	link.o			\
217	llseek.o		\
218	lseek.o			\
219	lstat.o			\
220	memcntl.o		\
221	mincore.o		\
222	mkdir.o			\
223	mknod.o			\
224	mmap.o			\
225	modctl.o		\
226	mount.o			\
227	mprotect.o		\
228	munmap.o		\
229	nice.o			\
230	ntp_adjtime.o		\
231	ntp_gettime.o		\
232	open.o			\
233	p_online.o		\
234	pathconf.o		\
235	pause.o			\
236	pcsample.o		\
237	pollsys.o		\
238	pread.o			\
239	priocntlset.o		\
240	processor_bind.o	\
241	processor_info.o	\
242	profil.o		\
243	putmsg.o		\
244	putpmsg.o		\
245	pwrite.o		\
246	read.o			\
247	readlink.o		\
248	readv.o			\
249	resolvepath.o		\
250	rmdir.o			\
251	seteguid.o		\
252	setgid.o		\
253	setgroups.o		\
254	setitimer.o		\
255	setreid.o		\
256	setrlimit.o		\
257	setuid.o		\
258	sigaltstk.o		\
259	sigprocmsk.o		\
260	sigsendset.o		\
261	sigsuspend.o		\
262	stat.o			\
263	statfs.o		\
264	statvfs.o		\
265	stty.o			\
266	symlink.o		\
267	sync.o			\
268	sysconfig.o		\
269	sysfs.o			\
270	sysinfo.o		\
271	syslwp.o		\
272	times.o			\
273	ulimit.o		\
274	umask.o			\
275	umount2.o		\
276	unlink.o		\
277	utime.o			\
278	utimes.o		\
279	utssys.o		\
280	vhangup.o		\
281	waitid.o		\
282	write.o			\
283	writev.o		\
284	yield.o
285
286SYSOBJS=			\
287	__clock_gettime.o	\
288	__getcontext.o		\
289	__uadmin.o		\
290	_lwp_mutex_unlock.o	\
291	_stack_grow.o		\
292	door.o			\
293	fork1.o			\
294	forkall.o		\
295	fxstat.o		\
296	getcontext.o		\
297	gettimeofday.o		\
298	lwp_private.o		\
299	lxstat.o		\
300	nuname.o		\
301	pipe.o			\
302	syscall.o		\
303	sysi86.o		\
304	tls_get_addr.o		\
305	uadmin.o		\
306	umount.o		\
307	uname.o			\
308	vfork.o			\
309	xmknod.o		\
310	xstat.o
311
312# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
313# This macro should ALWAYS be empty; native APIs are already 'large file'.
314PORTGEN64=
315
316# objects from source under ../port
317PORTFP=				\
318	__flt_decim.o		\
319	__flt_rounds.o		\
320	__tbl_10_b.o		\
321	__tbl_10_h.o		\
322	__tbl_10_s.o		\
323	__tbl_2_b.o		\
324	__tbl_2_h.o		\
325	__tbl_2_s.o		\
326	__tbl_fdq.o		\
327	__tbl_tens.o		\
328	__x_power.o		\
329	_base_sup.o		\
330	aconvert.o		\
331	decimal_bin.o		\
332	double_decim.o		\
333	econvert.o		\
334	fconvert.o		\
335	file_decim.o		\
336	finite.o		\
337	fp_data.o		\
338	func_decim.o		\
339	gconvert.o		\
340	hex_bin.o		\
341	ieee_globals.o		\
342	pack_float.o		\
343	sigfpe.o		\
344	string_decim.o
345
346PORTGEN=			\
347	_env_data.o		\
348	_xftw.o			\
349	a64l.o			\
350	abort.o			\
351	addsev.o		\
352	assert.o		\
353	atof.o			\
354	atoi.o			\
355	atol.o			\
356	atoll.o			\
357	attropen.o		\
358	atexit.o		\
359	atfork.o		\
360	basename.o		\
361	calloc.o		\
362	catgets.o		\
363	catopen.o		\
364	cfgetispeed.o		\
365	cfgetospeed.o		\
366	cfree.o			\
367	cfsetispeed.o		\
368	cfsetospeed.o		\
369	cftime.o		\
370	clock.o			\
371	closedir.o		\
372	closefrom.o		\
373	confstr.o		\
374	crypt.o			\
375	csetlen.o		\
376	ctime.o			\
377	ctime_r.o		\
378	directio.o		\
379	dirname.o		\
380	div.o			\
381	drand48.o		\
382	dup2.o			\
383	env_data.o		\
384	errno.o			\
385	euclen.o		\
386	event_port.o		\
387	execvp.o		\
388	fattach.o		\
389	fdetach.o		\
390	fdopendir.o		\
391	ffs.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