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