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