xref: /titanic_52/usr/src/lib/libc/amd64/Makefile (revision fb3fb4f3d76d55b64440afd0af72775dfad3bd1d)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28# lib/libc/amd64/Makefile
29#
30LIBCBASE=.
31
32LIBRARY= libc.a
33LIB_PIC= libc_pic.a
34VERS=	.1
35CPP=	/usr/lib/cpp
36TARGET_ARCH=	amd64
37
38# objects are grouped by source directory
39
40# local objects
41STRETS=
42
43CRTOBJS=			\
44	cerror.o
45
46DYNOBJS=
47
48FPOBJS=				\
49	_base_il.o		\
50	fpgetmask.o		\
51	fpgetround.o		\
52	fpsetmask.o		\
53	fpsetround.o		\
54	fpstart.o
55
56I386FPOBJS=			\
57	_D_cplx_div.o		\
58	_D_cplx_div_ix.o	\
59	_D_cplx_div_rx.o	\
60	_D_cplx_lr_div.o	\
61	_D_cplx_lr_div_ix.o	\
62	_D_cplx_lr_div_rx.o	\
63	_D_cplx_mul.o		\
64	_F_cplx_div.o		\
65	_F_cplx_div_ix.o	\
66	_F_cplx_div_rx.o	\
67	_F_cplx_lr_div.o	\
68	_F_cplx_lr_div_ix.o	\
69	_F_cplx_lr_div_rx.o	\
70	_F_cplx_mul.o		\
71	_X_cplx_div.o		\
72	_X_cplx_div_ix.o	\
73	_X_cplx_div_rx.o	\
74	_X_cplx_lr_div.o	\
75	_X_cplx_lr_div_ix.o	\
76	_X_cplx_lr_div_rx.o	\
77	_X_cplx_mul.o
78
79FPASMOBJS=			\
80	__xgetRD.o		\
81	_xtoll.o		\
82	_xtoull.o		\
83	fpcw.o			\
84	fpgetsticky.o		\
85	fpsetsticky.o
86
87ATOMICOBJS=			\
88	atomic.o
89
90COMOBJS=			\
91	bcmp.o			\
92	bcopy.o			\
93	bsearch.o		\
94	bzero.o			\
95	qsort.o			\
96	strtol.o		\
97	strtoul.o
98
99GENOBJS=			\
100	_getsp.o		\
101	abs.o			\
102	alloca.o		\
103	byteorder.o		\
104	cache.o			\
105	cuexit.o		\
106	ecvt.o			\
107	errlst.o		\
108	amd64_data.o		\
109	ldivide.o		\
110	lexp10.o		\
111	llog10.o		\
112	lock.o			\
113	ltostr.o		\
114	makectxt.o		\
115	memccpy.o		\
116	memchr.o		\
117	memcmp.o		\
118	memcpy.o		\
119	memset.o		\
120	new_list.o		\
121	setjmp.o		\
122	siginfolst.o		\
123	siglongjmp.o		\
124	strcmp.o		\
125	strcpy.o		\
126	strlen.o		\
127	strncmp.o		\
128	strncpy.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	__fcntl.o		\
140	__getloadavg.o		\
141	__rusagesys.o		\
142	__signotify.o		\
143	__sigrt.o		\
144	__time.o		\
145	_lgrp_home_fast.o	\
146	_lgrpsys.o		\
147	_nfssys.o		\
148	_portfs.o		\
149	_pset.o			\
150	_rename.o		\
151	_rpcsys.o		\
152	_sigaction.o		\
153	_so_accept.o		\
154	_so_bind.o		\
155	_so_connect.o		\
156	_so_getpeername.o	\
157	_so_getsockname.o	\
158	_so_getsockopt.o	\
159	_so_listen.o		\
160	_so_recv.o		\
161	_so_recvfrom.o		\
162	_so_recvmsg.o		\
163	_so_send.o		\
164	_so_sendmsg.o		\
165	_so_sendto.o		\
166	_so_setsockopt.o	\
167	_so_shutdown.o		\
168	_so_socket.o		\
169	_so_socketpair.o	\
170	_sockconfig.o		\
171	access.o		\
172	acct.o			\
173	acl.o			\
174	adjtime.o		\
175	alarm.o			\
176	brk.o			\
177	chdir.o			\
178	chmod.o			\
179	chown.o			\
180	chroot.o		\
181	cladm.o			\
182	close.o			\
183	creat.o			\
184	dup.o			\
185	execve.o		\
186	exit.o			\
187	facl.o			\
188	fchdir.o		\
189	fchmod.o		\
190	fchown.o		\
191	fchroot.o		\
192	fdsync.o		\
193	fpathconf.o		\
194	fstat.o			\
195	fstatfs.o		\
196	fstatvfs.o		\
197	getcpuid.o		\
198	getdents.o		\
199	getegid.o		\
200	geteuid.o		\
201	getgid.o		\
202	getgroups.o		\
203	gethrtime.o		\
204	getitimer.o		\
205	getmsg.o		\
206	getpagesizes.o		\
207	getpid.o		\
208	getpmsg.o		\
209	getppid.o		\
210	getrlimit.o		\
211	getuid.o		\
212	gtty.o			\
213	install_utrap.o		\
214	ioctl.o			\
215	kaio.o			\
216	kill.o			\
217	lchown.o		\
218	link.o			\
219	llseek.o		\
220	lseek.o			\
221	lstat.o			\
222	memcntl.o		\
223	mincore.o		\
224	mkdir.o			\
225	mknod.o			\
226	mmap.o			\
227	modctl.o		\
228	mount.o			\
229	mprotect.o		\
230	munmap.o		\
231	nice.o			\
232	ntp_adjtime.o		\
233	ntp_gettime.o		\
234	open.o			\
235	p_online.o		\
236	pathconf.o		\
237	pause.o			\
238	pcsample.o		\
239	pollsys.o		\
240	pread.o			\
241	priocntlset.o		\
242	processor_bind.o	\
243	processor_info.o	\
244	profil.o		\
245	putmsg.o		\
246	putpmsg.o		\
247	pwrite.o		\
248	read.o			\
249	readlink.o		\
250	readv.o			\
251	resolvepath.o		\
252	rmdir.o			\
253	seteguid.o		\
254	setgid.o		\
255	setgroups.o		\
256	setitimer.o		\
257	setreid.o		\
258	setrlimit.o		\
259	setuid.o		\
260	sigaltstk.o		\
261	sigprocmsk.o		\
262	sigsendset.o		\
263	sigsuspend.o		\
264	stat.o			\
265	statfs.o		\
266	statvfs.o		\
267	stty.o			\
268	symlink.o		\
269	sync.o			\
270	sysconfig.o		\
271	sysfs.o			\
272	sysinfo.o		\
273	syslwp.o		\
274	times.o			\
275	ulimit.o		\
276	umask.o			\
277	umount2.o		\
278	unlink.o		\
279	utime.o			\
280	utimes.o		\
281	utssys.o		\
282	vhangup.o		\
283	waitid.o		\
284	write.o			\
285	writev.o		\
286	yield.o
287
288SYSOBJS=			\
289	__clock_gettime.o	\
290	__getcontext.o		\
291	__uadmin.o		\
292	_lwp_mutex_unlock.o	\
293	_stack_grow.o		\
294	door.o			\
295	fork1.o			\
296	forkall.o		\
297	fxstat.o		\
298	getcontext.o		\
299	gettimeofday.o		\
300	lwp_private.o		\
301	lxstat.o		\
302	nuname.o		\
303	pipe.o			\
304	syscall.o		\
305	sysi86.o		\
306	tls_get_addr.o		\
307	uadmin.o		\
308	umount.o		\
309	uname.o			\
310	vfork.o			\
311	xmknod.o		\
312	xstat.o
313
314# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
315# This macro should ALWAYS be empty; native APIs are already 'large file'.
316PORTGEN64=
317
318# objects from source under ../port
319PORTFP=				\
320	__flt_decim.o		\
321	__flt_rounds.o		\
322	__tbl_10_b.o		\
323	__tbl_10_h.o		\
324	__tbl_10_s.o		\
325	__tbl_2_b.o		\
326	__tbl_2_h.o		\
327	__tbl_2_s.o		\
328	__tbl_fdq.o		\
329	__tbl_tens.o		\
330	__x_power.o		\
331	_base_sup.o		\
332	aconvert.o		\
333	decimal_bin.o		\
334	double_decim.o		\
335	econvert.o		\
336	fconvert.o		\
337	file_decim.o		\
338	finite.o		\
339	fp_data.o		\
340	func_decim.o		\
341	gconvert.o		\
342	hex_bin.o		\
343	ieee_globals.o		\
344	pack_float.o		\
345	sigfpe.o		\
346	string_decim.o
347
348PORTGEN=			\
349	_env_data.o		\
350	_xftw.o			\
351	a64l.o			\
352	abort.o			\
353	addsev.o		\
354	assert.o		\
355	atof.o			\
356	atoi.o			\
357	atol.o			\
358	atoll.o			\
359	attropen.o		\
360	atexit.o		\
361	atfork.o		\
362	basename.o		\
363	calloc.o		\
364	catgets.o		\
365	catopen.o		\
366	cfgetispeed.o		\
367	cfgetospeed.o		\
368	cfree.o			\
369	cfsetispeed.o		\
370	cfsetospeed.o		\
371	cftime.o		\
372	clock.o			\
373	closedir.o		\
374	closefrom.o		\
375	confstr.o		\
376	crypt.o			\
377	csetlen.o		\
378	ctime.o			\
379	ctime_r.o		\
380	directio.o		\
381	dirname.o		\
382	div.o			\
383	drand48.o		\
384	dup2.o			\
385	env_data.o		\
386	errno.o			\
387	euclen.o		\
388	event_port.o		\
389	execvp.o		\
390	fattach.o		\
391	fdetach.o		\
392	fdopendir.o		\
393	ffs.o			\
394	fmtmsg.o		\
395	ftime.o			\
396	ftok.o			\
397	ftw.o			\
398	gcvt.o			\
399	getauxv.o		\
400	getcwd.o		\
401	getdate_err.o		\
402	getdtblsize.o		\
403	getenv.o		\
404	getexecname.o		\
405	getgrnam.o		\
406	getgrnam_r.o		\
407	gethostid.o		\
408	gethostname.o		\
409	gethz.o			\
410	getisax.o		\
411	getloadavg.o		\
412	getlogin.o		\
413	getmntent.o		\
414	getnetgrent.o		\
415	getopt.o		\
416	getopt_long.o		\
417	getpagesize.o		\
418	getpw.o			\
419	getpwnam.o		\
420	getpwnam_r.o		\
421	getrusage.o		\
422	getspent.o		\
423	getspent_r.o		\
424	getsubopt.o		\
425	gettxt.o		\
426	getusershell.o		\
427	getut.o			\
428	getutx.o		\
429	getvfsent.o		\
430	getwd.o			\
431	getwidth.o		\
432	getxby_door.o		\
433	gtxt.o			\
434	hsearch.o		\
435	iconv.o			\
436	imaxabs.o		\
437	imaxdiv.o		\
438	index.o			\
439	initgroups.o		\
440	insque.o		\
441	isaexec.o		\
442	isastream.o		\
443	isatty.o		\
444	killpg.o		\
445	l64a.o			\
446	lckpwdf.o		\
447	lconstants.o		\
448	lfind.o			\
449	lfmt.o			\
450	lfmt_log.o		\
451	lldiv.o			\
452	lltostr.o		\
453	lmath.o			\
454	localtime.o		\
455	lsearch.o		\
456	madvise.o		\
457	malloc.o		\
458	memalign.o		\
459	mkdev.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