xref: /titanic_44/usr/src/lib/libc/amd64/Makefile (revision 6927f468b0af7710df000f6b16f6ee413e1e3007)
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# lib/libc/amd64/Makefile
28#
29LIBCBASE=.
30
31LIBRARY= libc.a
32LIB_PIC= libc_pic.a
33VERS=	.1
34CPP=	/usr/lib/cpp
35TARGET_ARCH=	amd64
36
37# objects are grouped by source directory
38
39# local objects
40STRETS=
41
42CRTOBJS=			\
43	cerror.o
44
45DYNOBJS=
46
47FPOBJS=				\
48	_base_il.o		\
49	fpgetmask.o		\
50	fpgetround.o		\
51	fpsetmask.o		\
52	fpsetround.o		\
53	fpstart.o
54
55I386FPOBJS=			\
56	_D_cplx_div.o		\
57	_D_cplx_div_ix.o	\
58	_D_cplx_div_rx.o	\
59	_D_cplx_lr_div.o	\
60	_D_cplx_lr_div_ix.o	\
61	_D_cplx_lr_div_rx.o	\
62	_D_cplx_mul.o		\
63	_F_cplx_div.o		\
64	_F_cplx_div_ix.o	\
65	_F_cplx_div_rx.o	\
66	_F_cplx_lr_div.o	\
67	_F_cplx_lr_div_ix.o	\
68	_F_cplx_lr_div_rx.o	\
69	_F_cplx_mul.o		\
70	_X_cplx_div.o		\
71	_X_cplx_div_ix.o	\
72	_X_cplx_div_rx.o	\
73	_X_cplx_lr_div.o	\
74	_X_cplx_lr_div_ix.o	\
75	_X_cplx_lr_div_rx.o	\
76	_X_cplx_mul.o
77
78FPASMOBJS=			\
79	__xgetRD.o		\
80	_xtoll.o		\
81	_xtoull.o		\
82	fpcw.o			\
83	fpgetsticky.o		\
84	fpsetsticky.o
85
86ATOMICOBJS=			\
87	atomic.o
88
89COMOBJS=			\
90	bcmp.o			\
91	bcopy.o			\
92	bsearch.o		\
93	bzero.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	ffs.o			\
393	fmtmsg.o		\
394	ftime.o			\
395	ftok.o			\
396	ftw.o			\
397	gcvt.o			\
398	getauxv.o		\
399	getcwd.o		\
400	getdate_err.o		\
401	getdtblsize.o		\
402	getenv.o		\
403	getexecname.o		\
404	getgrnam.o		\
405	getgrnam_r.o		\
406	gethostid.o		\
407	gethostname.o		\
408	gethz.o			\
409	getisax.o		\
410	getloadavg.o		\
411	getlogin.o		\
412	getmntent.o		\
413	getnetgrent.o		\
414	getopt.o		\
415	getopt_long.o		\
416	getpagesize.o		\
417	getpw.o			\
418	getpwnam.o		\
419	getpwnam_r.o		\
420	getrusage.o		\
421	getspent.o		\
422	getspent_r.o		\
423	getsubopt.o		\
424	gettxt.o		\
425	getusershell.o		\
426	getut.o			\
427	getutx.o		\
428	getvfsent.o		\
429	getwd.o			\
430	getwidth.o		\
431	getxby_door.o		\
432	gtxt.o			\
433	hsearch.o		\
434	iconv.o			\
435	imaxabs.o		\
436	imaxdiv.o		\
437	index.o			\
438	initgroups.o		\
439	insque.o		\
440	isaexec.o		\
441	isastream.o		\
442	isatty.o		\
443	killpg.o		\
444	l64a.o			\
445	lckpwdf.o		\
446	lconstants.o		\
447	lfind.o			\
448	lfmt.o			\
449	lfmt_log.o		\
450	lldiv.o			\
451	lltostr.o		\
452	lmath.o			\
453	localtime.o		\
454	lsearch.o		\
455	madvise.o		\
456	malloc.o		\
457	memalign.o		\
458	mkdev.o			\
459	mkdtemp.o		\
460	mkfifo.o		\
461	mkstemp.o		\
462	mktemp.o		\
463	mlock.o			\
464	mlockall.o		\
465	mon.o			\
466	msync.o			\
467	munlock.o		\
468	munlockall.o		\
469	ndbm.o			\
470	nftw.o			\
471	nlspath_checks.o	\
472	nsparse.o		\
473	nss_common.o		\
474	nss_dbdefs.o		\
475	nss_deffinder.o		\
476	opendir.o		\
477	opt_data.o		\
478	perror.o		\
479	pfmt.o			\
480	pfmt_data.o		\
481	pfmt_print.o		\
482	plock.o			\
483	poll.o			\
484	priocntl.o		\
485	privlib.o		\
486	priv_str_xlate.o	\
487	psiginfo.o		\
488	psignal.o		\
489	pt.o			\
490	putpwent.o		\
491	putspent.o		\
492	raise.o			\
493	rand.o			\
494	random.o		\
495	rctlops.o		\
496	readdir.o		\
497	readdir_r.o		\
498	realpath.o		\
499	reboot.o		\
500	regexpr.o		\
501	rename.o		\
502	rewinddir.o		\
503	rindex.o		\
504	scandir.o		\
505	seekdir.o		\
506	select.o		\
507	select_large_fdset.o	\
508	setlabel.o		\
509	setpriority.o		\
510	settimeofday.o		\
511	sh_locks.o		\
512	sigflag.o		\
513	siglist.o		\
514	sigsend.o		\
515	sigsetops.o		\
516	ssignal.o		\
517	stack.o			\
518	str2sig.o		\
519	strcase_charmap.o	\
520	strcasecmp.o		\
521	strcat.o		\
522	strchr.o		\
523	strcspn.o		\
524	strdup.o		\
525	strerror.o		\
526	strlcat.o		\
527	strlcpy.o		\
528	strncasecmp.o		\
529	strncat.o		\
530	strpbrk.o		\
531	strrchr.o		\
532	strsignal.o		\
533	strspn.o		\
534	strstr.o		\
535	strtod.o		\
536	strtoimax.o		\
537	strtok.o		\
538	strtok_r.o		\
539	strtoll.o		\
540	strtoull.o		\
541	strtoumax.o		\
542	swab.o			\
543	swapctl.o		\
544	sysconf.o		\
545	syslog.o		\
546	tcdrain.o		\
547	tcflow.o		\
548	tcflush.o		\
549	tcgetattr.o		\
550	tcgetpgrp.o		\
551	tcgetsid.o		\
552	tcsendbreak.o		\
553	tcsetattr.o		\
554	tcsetpgrp.o		\
555	tell.o			\
556	telldir.o		\
557	tfind.o			\
558	time_data.o		\
559	time_gdata.o		\
560	truncate.o		\
561	tsdalloc.o		\
562	tsearch.o		\
563	ttyname.o		\
564	ttyslot.o		\
565	ualarm.o		\
566	ucred.o			\
567	valloc.o		\
568	vlfmt.o			\
569	vpfmt.o			\
570	wait3.o			\
571	wait4.o			\
572	waitpid.o		\
573	walkstack.o		\
574	wdata.o			\
575	xgetwidth.o		\
576	xpg4.o			\
577	xpg6.o
578
579PORTPRINT_W=			\
580	doprnt_w.o
581
582PORTPRINT=			\
583	doprnt.o		\
584	fprintf.o		\
585	printf.o		\
586	snprintf.o		\
587	sprintf.o		\
588	vfprintf.o		\
589	vprintf.o		\
590	vsnprintf.o		\
591	vsprintf.o		\
592	vwprintf.o		\
593	wprintf.o
594
595# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
596# This macro should ALWAYS be empty; native APIs are already 'large file'.
597PORTSTDIO64=
598
599PORTSTDIO_W=			\
600	doscan_w.o
601
602PORTSTDIO=			\
603	__extensions.o		\
604	_endopen.o		\
605	_filbuf.o		\
606	_findbuf.o		\
607	_flsbuf.o		\
608	_wrtchk.o		\
609	clearerr.o		\
610	ctermid.o		\
611	ctermid_r.o		\
612	cuserid.o		\
613	data.o			\
614	doscan.o		\
615	fdopen.o		\
616	feof.o			\
617	ferror.o		\
618	fgetc.o			\
619	fgets.o			\
620	fileno.o		\
621	flockf.o		\
622	flush.o			\
623	fopen.o			\
624	fpos.o			\
625	fputc.o			\
626	fputs.o			\
627	fread.o			\
628	fseek.o			\
629	fseeko.o		\
630	ftell.o			\
631	ftello.o		\
632	fwrite.o		\
633	getc.o			\
634	getchar.o		\
635	getpass.o		\
636	gets.o			\
637	getw.o			\
638	mse.o			\
639	popen.o			\
640	putc.o			\
641	putchar.o		\
642	puts.o			\
643	putw.o			\
644	rewind.o		\
645	scanf.o			\
646	setbuf.o		\
647	setbuffer.o		\
648	setvbuf.o		\
649	system.o		\
650	tempnam.o		\
651	tmpfile.o		\
652	tmpnam_r.o		\
653	ungetc.o		\
654	vscanf.o		\
655	vwscanf.o		\
656	wscanf.o
657
658PORTI18N=			\
659	__fgetwc_xpg5.o		\
660	__fgetws_xpg5.o		\
661	__fputwc_xpg5.o		\
662	__fputws_xpg5.o		\
663	__ungetwc_xpg5.o	\
664	getwchar.o		\
665	putwchar.o		\
666	putws.o			\
667	strtows.o		\
668	wcsstr.o		\
669	wcstoimax.o		\
670	wcstol.o		\
671	wcstoul.o		\
672	wcswcs.o		\
673	wmemchr.o		\
674	wmemcmp.o		\
675	wmemcpy.o		\
676	wmemmove.o		\
677	wmemset.o		\
678	wscasecmp.o		\
679	wscat.o			\
680	wschr.o			\
681	wscmp.o			\
682	wscpy.o			\
683	wscspn.o		\
684	wsdup.o			\
685	wslen.o			\
686	wsncasecmp.o		\
687	wsncat.o		\
688	wsncmp.o		\
689	wsncpy.o		\
690	wspbrk.o		\
691	wsprintf.o		\
692	wsrchr.o		\
693	wsscanf.o		\
694	wsspn.o			\
695	wstod.o			\
696	wstok.o			\
697	wstol.o			\
698	wstoll.o		\
699	wsxfrm.o		\
700	gettext.o		\
701	gettext_gnu.o		\
702	gettext_real.o		\
703	gettext_util.o		\
704	plural_parser.o		\
705	wdresolve.o		\
706	_ctype.o		\
707	isascii.o		\
708	toascii.o
709
710PORTI18N_COND=			\
711	wcstol_longlong.o	\
712	wcstoul_longlong.o
713
714THREADSOBJS=			\
715	alloc.o			\
716	assfail.o		\
717	cancel.o		\
718	door_calls.o		\
719	pthr_attr.o		\
720	pthr_barrier.o		\
721	pthr_cond.o		\
722	pthr_mutex.o		\
723	pthr_rwlock.o		\
724	pthread.o		\
725	rtsched.o		\
726	rwlock.o		\
727	scalls.o		\
728	sema.o			\
729	sigaction.o		\
730	spawn.o			\
731	synch.o			\
732	tdb_agent.o		\
733	thr.o			\
734	thread_interface.o	\
735	tls.o			\
736	tsd.o
737
738THREADSMACHOBJS=		\
739	machdep.o
740
741THREADSASMOBJS=			\
742	asm_subr.o
743
744UNWINDMACHOBJS=			\
745	call_frame_inst.o	\
746	eh_frame.o		\
747	thrp_unwind.o		\
748	unwind.o
749
750pics/unwind.o:= COPTFLAG64 =
751
752UNWINDASMOBJS=			\
753	unwind_frame.o
754
755# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
756# This macro should ALWAYS be empty; native APIs are already 'large file'.
757PORTSYS64=
758
759PORTSYS=			\
760	_autofssys.o		\
761	acctctl.o		\
762	bsd_signal.o		\
763	corectl.o		\
764	exacctsys.o		\
765	execl.o			\
766	execle.o		\
767	execv.o			\
768	fcntl.o			\
769	fsmisc.o		\
770	fstatat.o		\
771	fsync.o			\
772	getpeerucred.o		\
773	inst_sync.o		\
774	issetugid.o		\
775	libc_link.o		\
776	libc_open.o		\
777	lockf.o			\
778	lwp.o			\
779	lwp_cond.o		\
780	lwp_rwlock.o		\
781	lwp_sigmask.o		\
782	meminfosys.o		\
783	msgsys.o		\
784	nfssys.o		\
785	openat.o		\
786	pgrpsys.o		\
787	posix_sigwait.o		\
788	ppriv.o			\
789	psetsys.o		\
790	rctlsys.o		\
791	sbrk.o			\
792	semsys.o		\
793	set_errno.o		\
794	shmsys.o		\
795	siginterrupt.o		\
796	signal.o		\
797	sigpending.o		\
798	sigstack.o		\
799	tasksys.o		\
800	time.o			\
801	time_util.o		\
802	ucontext.o		\
803	ustat.o			\
804	zone.o
805
806PORTREGEX=			\
807	glob.o			\
808	regcmp.o		\
809	regex.o			\
810	wordexp.o
811
812MOSTOBJS=			\
813	$(STRETS)		\
814	$(CRTOBJS)		\
815	$(DYNOBJS)		\
816	$(FPOBJS)		\
817	$(I386FPOBJS)		\
818	$(FPASMOBJS)		\
819	$(ATOMICOBJS)		\
820	$(COMOBJS)		\
821	$(GENOBJS)		\
822	$(PORTFP)		\
823	$(PORTGEN)		\
824	$(PORTGEN64)		\
825	$(PORTI18N)		\
826	$(PORTI18N_COND)	\
827	$(PORTPRINT)		\
828	$(PORTPRINT_W)		\
829	$(PORTREGEX)		\
830	$(PORTSTDIO)		\
831	$(PORTSTDIO64)		\
832	$(PORTSTDIO_W)		\
833	$(PORTSYS)		\
834	$(PORTSYS64)		\
835	$(THREADSOBJS)		\
836	$(THREADSMACHOBJS)	\
837	$(THREADSASMOBJS)	\
838	$(UNWINDMACHOBJS)	\
839	$(UNWINDASMOBJS)	\
840	$(COMSYSOBJS)		\
841	$(SYSOBJS)		\
842	$(COMSYSOBJS64)		\
843	$(SYSOBJS64)
844
845TRACEOBJS=			\
846	plockstat.o
847
848# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
849# modules whose source is provided in the $(SRC)/lib/common directory.
850# This must be done because otherwise the Sun C compiler would insert
851# its own versions of these modules and those versions contain code
852# to call out to C++ initialization functions.  Such C++ initialization
853# functions can call back into libc before thread initialization is
854# complete and this leads to segmentation violations and other problems.
855# Since libc contains no C++ code, linking with the minimal crti.o and
856# crtn.o modules is safe and avoids the problems described above.
857OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
858CRTSRCS= ../../common/amd64
859
860# these aren't listed as $(PICS), so we need to force CTF
861pics/values-Xa.o := POST_PROCESS_O = $(CTFCONVERT_O)
862
863# include common library definitions
864include ../../Makefile.lib
865include ../../Makefile.lib.64
866
867# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
868# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
869# need to be compatible with the ones for the libc stuff.  Whenever the changes
870# that affect the compilation conditions of libc happened, those for libc_i18n
871# also need to be updated.
872
873CFLAGS64 += $(CTF_FLAGS)
874
875# This is necessary to avoid problems with calling _ex_unwind().
876# We probably don't want any inlining anyway.
877CFLAGS64 += -xinline=
878
879# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
880# enables ASSERT() checking in the threads portion of the library.
881# This is automatically enabled for DEBUG builds, not for non-debug builds.
882THREAD_DEBUG =
883$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
884
885CFLAGS64 += $(THREAD_DEBUG)
886
887ALTPICS= $(TRACEOBJS:%=pics/%)
888
889$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
890$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
891
892MAPDIR=		../spec/amd64
893MAPFILE=	$(MAPDIR)/mapfile
894
895CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) \
896		-I. -I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master) -I/usr/include
897ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
898		-xarch=generic64
899
900# Inform the run-time linker about libc specialized initialization
901RTLDINFO =	-z rtldinfo=tls_rtldinfo
902
903DYNFLAGS +=	-M $(MAPFILE) $(RTLDINFO)
904
905BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
906
907# Override this top level flag so the compiler builds in its native
908# C99 mode.  This has been enabled to support the complex arithmetic
909# added to libc.
910C99MODE=	$(C99_ENABLE)
911
912# libc method of building an archive
913BUILD.AR= $(RM) $@ ; \
914	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
915
916# extra files for the clean target
917CLEANFILES=			\
918	../port/gen/errlst.c	\
919	../port/gen/new_list.c	\
920	assym.h			\
921	genassym		\
922	crt/_rtld.s		\
923	pics/crti.o		\
924	pics/crtn.o		\
925	pics/values-Xa.o	\
926	$(ALTPICS)
927
928CLOBBERFILES +=	$(MAPFILE) $(LIB_PIC)
929
930# list of C source for lint
931SRCS=							\
932	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
933	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
934	$(PORTFP:%.o=../port/fp/%.c)			\
935	$(PORTGEN:%.o=../port/gen/%.c)			\
936	$(PORTI18N:%.o=../port/i18n/%.c)		\
937	$(PORTPRINT:%.o=../port/print/%.c)		\
938	$(PORTREGEX:%.o=../port/regex/%.c)		\
939	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
940	$(PORTSYS:%.o=../port/sys/%.c)			\
941	$(THREADSOBJS:%.o=../port/threads/%.c)		\
942	$(THREADSMACHOBJS:%.o=threads/%.c)		\
943	$(UNWINDMACHOBJS:%.o=unwind/%.c)		\
944	$(FPOBJS:%.o=fp/%.c)				\
945	$(I386FPOBJS:%.o=../i386/fp/%.c)		\
946	$(LIBCBASE)/gen/ecvt.c				\
947	$(LIBCBASE)/gen/lexp10.c			\
948	$(LIBCBASE)/gen/llog10.c			\
949	$(LIBCBASE)/gen/ltostr.c			\
950	$(LIBCBASE)/gen/makectxt.c			\
951	$(LIBCBASE)/gen/siginfolst.c			\
952	$(LIBCBASE)/gen/siglongjmp.c			\
953	$(LIBCBASE)/gen/sync_instruction_memory.c	\
954	$(LIBCBASE)/sys/uadmin.c
955
956# conditional assignments
957# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
958$(DYNLIB) := CRTI = crti.o values-Xa.o
959$(DYNLIB) := CRTN = crtn.o
960
961$(DYNLIB):	$(MAPFILE)
962
963$(MAPFILE):
964	@cd $(MAPDIR); $(MAKE) mapfile
965
966# Files which need the threads .il inline template
967TIL=				\
968	alloc.o			\
969	assfail.o		\
970	atexit.o		\
971	atfork.o		\
972	cancel.o		\
973	door_calls.o		\
974	errno.o			\
975	lwp.o			\
976	machdep.o		\
977	pthr_attr.o		\
978	pthr_barrier.o		\
979	pthr_cond.o		\
980	pthr_mutex.o		\
981	pthr_rwlock.o		\
982	pthread.o		\
983	rand.o			\
984	rtsched.o		\
985	rwlock.o		\
986	scalls.o		\
987	sema.o			\
988	sigaction.o		\
989	spawn.o			\
990	stack.o			\
991	synch.o			\
992	tdb_agent.o		\
993	thr.o			\
994	thread_interface.o	\
995	thrp_unwind.o		\
996	tls.o			\
997	tsd.o
998
999$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1000
1001# pics/mul64.o := CFLAGS64 += crt/mul64.il
1002
1003# large-file-aware components that should be built large
1004
1005#$(COMSYSOBJS64:%=pics/%) := \
1006#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1007
1008#$(SYSOBJS64:%=pics/%) := \
1009#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1010
1011#$(PORTGEN64:%=pics/%) := \
1012#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1013
1014#$(PORTSTDIO64:%=pics/%) := \
1015#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1016
1017#$(PORTSYS64:%=pics/%) := \
1018#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1019
1020$(PORTSTDIO_W:%=pics/%) := \
1021	CPPFLAGS += -D_WIDE
1022
1023$(PORTPRINT_W:%=pics/%) := \
1024	CPPFLAGS += -D_WIDE
1025
1026$(PORTPRINT_C89:%=pics/%) := \
1027	CPPFLAGS += -D_C89_INTMAX32
1028
1029$(PORTSTDIO_C89:%=pics/%) := \
1030	CPPFLAGS += -D_C89_INTMAX32
1031
1032$(PORTI18N_COND:%=pics/%) := \
1033	CPPFLAGS += -D_WCS_LONGLONG
1034
1035.KEEP_STATE:
1036
1037all: $(LIBS) $(LIB_PIC)
1038
1039lint	:=	CPPFLAGS += -I../$(MACH)/fp
1040lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1041lint	:=	LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1042
1043lint:
1044	@echo $(LINT.c) ... $(LDLIBS)
1045	@$(LINT.c) $(SRCS) $(LDLIBS)
1046
1047$(LINTLIB):= SRCS=../port/llib-lc
1048$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1049$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=amd64
1050
1051# object files that depend on inline template
1052$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1053# pics/mul64.o: crt/mul64.il
1054
1055# include common libc targets
1056include ../Makefile.targ
1057
1058# We need to strip out all CTF data from the static library
1059$(LIB_PIC) := DIR = pics
1060$(LIB_PIC): pics $$(PICS)
1061	$(BUILD.AR)
1062	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1063	$(AR) -ts $@ > /dev/null
1064	$(POST_PROCESS_A)
1065
1066ASSYMDEP_OBJS=			\
1067	_lwp_mutex_unlock.o	\
1068	_stack_grow.o		\
1069	asm_subr.o		\
1070	getcontext.o		\
1071	tls_get_addr.o		\
1072	vfork.o
1073
1074$(ASSYMDEP_OBJS:%=pics/%): assym.h
1075
1076# assym.h build rules
1077
1078GENASSYM_C = genassym.c
1079
1080# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1081#	live in Makefile.master
1082
1083CPPFLAGS.genassym = \
1084	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1085
1086genassym: $(GENASSYM_C)
1087	$(NATIVECC) -Iinc -I../inc $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1088
1089OFFSETS = ../$(MACH)/offsets.in
1090
1091assym.h: $(OFFSETS) genassym
1092	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1093	./genassym >>$@
1094
1095# derived C source and related explicit dependencies
1096../port/gen/errlst.c + \
1097../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1098	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1099
1100pics/errlst.o: ../port/gen/errlst.c
1101
1102pics/new_list.o: ../port/gen/new_list.c
1103