xref: /titanic_41/usr/src/lib/libc/amd64/Makefile (revision 18c2aff776a775d34a4c9893a4c72e0434d68e36)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28LIBCBASE=.
29
30LIBRARY= libc.a
31LIB_PIC= libc_pic.a
32VERS=	.1
33CPP=	/usr/lib/cpp
34TARGET_ARCH=	amd64
35
36# objects are grouped by source directory
37
38# local objects
39STRETS=
40
41CRTOBJS=			\
42	cerror.o
43
44DYNOBJS=
45
46FPOBJS=				\
47	_base_il.o		\
48	fpgetmask.o		\
49	fpgetround.o		\
50	fpsetmask.o		\
51	fpsetround.o		\
52	fpstart.o
53
54I386FPOBJS=			\
55	_D_cplx_div.o		\
56	_D_cplx_div_ix.o	\
57	_D_cplx_div_rx.o	\
58	_D_cplx_lr_div.o	\
59	_D_cplx_lr_div_ix.o	\
60	_D_cplx_lr_div_rx.o	\
61	_D_cplx_mul.o		\
62	_F_cplx_div.o		\
63	_F_cplx_div_ix.o	\
64	_F_cplx_div_rx.o	\
65	_F_cplx_lr_div.o	\
66	_F_cplx_lr_div_ix.o	\
67	_F_cplx_lr_div_rx.o	\
68	_F_cplx_mul.o		\
69	_X_cplx_div.o		\
70	_X_cplx_div_ix.o	\
71	_X_cplx_div_rx.o	\
72	_X_cplx_lr_div.o	\
73	_X_cplx_lr_div_ix.o	\
74	_X_cplx_lr_div_rx.o	\
75	_X_cplx_mul.o
76
77FPASMOBJS=			\
78	__xgetRD.o		\
79	_xtoll.o		\
80	_xtoull.o		\
81	fpcw.o			\
82	fpgetsticky.o		\
83	fpsetsticky.o
84
85ATOMICOBJS=			\
86	atomic.o
87
88COMOBJS=			\
89	bcmp.o			\
90	bcopy.o			\
91	bsearch.o		\
92	bzero.o			\
93	ffs.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	uucopy.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	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
714AIOOBJS=			\
715	aio.o			\
716	aio_alloc.o		\
717	posix_aio.o
718
719RTOBJS=				\
720	clock_timer.o		\
721	fallocate.o		\
722	mqueue.o		\
723	pos4obj.o		\
724	sched.o			\
725	sem.o			\
726	shm.o			\
727	sigev_thread.o
728
729TPOOLOBJS=			\
730	thread_pool.o
731
732THREADSOBJS=			\
733	alloc.o			\
734	assfail.o		\
735	cancel.o		\
736	door_calls.o		\
737	pthr_attr.o		\
738	pthr_barrier.o		\
739	pthr_cond.o		\
740	pthr_mutex.o		\
741	pthr_rwlock.o		\
742	pthread.o		\
743	rtsched.o		\
744	rwlock.o		\
745	scalls.o		\
746	sema.o			\
747	sigaction.o		\
748	spawn.o			\
749	synch.o			\
750	tdb_agent.o		\
751	thr.o			\
752	thread_interface.o	\
753	tls.o			\
754	tsd.o
755
756THREADSMACHOBJS=		\
757	machdep.o
758
759THREADSASMOBJS=			\
760	asm_subr.o
761
762UNWINDMACHOBJS=			\
763	call_frame_inst.o	\
764	eh_frame.o		\
765	thrp_unwind.o		\
766	unwind.o
767
768pics/unwind.o:= COPTFLAG64 =
769
770UNWINDASMOBJS=			\
771	unwind_frame.o
772
773# Preserved solely to ease maintenance of 32-bit and 64-bit library builds
774# This macro should ALWAYS be empty; native APIs are already 'large file'.
775PORTSYS64=
776
777PORTSYS=			\
778	_autofssys.o		\
779	acctctl.o		\
780	bsd_signal.o		\
781	corectl.o		\
782	exacctsys.o		\
783	execl.o			\
784	execle.o		\
785	execv.o			\
786	fcntl.o			\
787	fsmisc.o		\
788	fstatat.o		\
789	fsync.o			\
790	getpeerucred.o		\
791	inst_sync.o		\
792	issetugid.o		\
793	label.o			\
794	libc_link.o		\
795	libc_open.o		\
796	lockf.o			\
797	lwp.o			\
798	lwp_cond.o		\
799	lwp_rwlock.o		\
800	lwp_sigmask.o		\
801	meminfosys.o		\
802	msgsys.o		\
803	nfssys.o		\
804	openat.o		\
805	pgrpsys.o		\
806	posix_sigwait.o		\
807	ppriv.o			\
808	psetsys.o		\
809	rctlsys.o		\
810	sbrk.o			\
811	semsys.o		\
812	set_errno.o		\
813	shmsys.o		\
814	siginterrupt.o		\
815	signal.o		\
816	sigpending.o		\
817	sigstack.o		\
818	tasksys.o		\
819	time.o			\
820	time_util.o		\
821	ucontext.o		\
822	ustat.o			\
823	zone.o
824
825PORTREGEX=			\
826	glob.o			\
827	regcmp.o		\
828	regex.o			\
829	wordexp.o
830
831VALUES=				\
832	values-Xa.o
833
834MOSTOBJS=			\
835	$(STRETS)		\
836	$(CRTOBJS)		\
837	$(DYNOBJS)		\
838	$(FPOBJS)		\
839	$(I386FPOBJS)		\
840	$(FPASMOBJS)		\
841	$(ATOMICOBJS)		\
842	$(COMOBJS)		\
843	$(GENOBJS)		\
844	$(PORTFP)		\
845	$(PORTGEN)		\
846	$(PORTGEN64)		\
847	$(PORTI18N)		\
848	$(PORTI18N_COND)	\
849	$(PORTPRINT)		\
850	$(PORTPRINT_W)		\
851	$(PORTREGEX)		\
852	$(PORTSTDIO)		\
853	$(PORTSTDIO64)		\
854	$(PORTSTDIO_W)		\
855	$(PORTSYS)		\
856	$(PORTSYS64)		\
857	$(AIOOBJS)		\
858	$(RTOBJS)		\
859	$(TPOOLOBJS)		\
860	$(THREADSOBJS)		\
861	$(THREADSMACHOBJS)	\
862	$(THREADSASMOBJS)	\
863	$(UNWINDMACHOBJS)	\
864	$(UNWINDASMOBJS)	\
865	$(COMSYSOBJS)		\
866	$(SYSOBJS)		\
867	$(COMSYSOBJS64)		\
868	$(SYSOBJS64)		\
869	$(VALUES)
870
871TRACEOBJS=			\
872	plockstat.o
873
874# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
875# modules whose source is provided in the $(SRC)/lib/common directory.
876# This must be done because otherwise the Sun C compiler would insert
877# its own versions of these modules and those versions contain code
878# to call out to C++ initialization functions.  Such C++ initialization
879# functions can call back into libc before thread initialization is
880# complete and this leads to segmentation violations and other problems.
881# Since libc contains no C++ code, linking with the minimal crti.o and
882# crtn.o modules is safe and avoids the problems described above.
883OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
884CRTSRCS= ../../common/amd64
885
886# include common library definitions
887include ../../Makefile.lib
888include ../../Makefile.lib.64
889
890# NOTE: libc_i18n.a will be part of libc.so.1.  Therefore, the compilation
891# conditions such as the settings of CFLAGS and CPPFLAGS for the libc_i18n stuff
892# need to be compatible with the ones for the libc stuff.  Whenever the changes
893# that affect the compilation conditions of libc happened, those for libc_i18n
894# also need to be updated.
895
896CFLAGS64 += $(CTF_FLAGS)
897
898# This is necessary to avoid problems with calling _ex_unwind().
899# We probably don't want any inlining anyway.
900CFLAGS64 += -xinline=
901
902# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
903# enables ASSERT() checking in the threads portion of the library.
904# This is automatically enabled for DEBUG builds, not for non-debug builds.
905THREAD_DEBUG =
906$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
907
908CFLAGS64 += $(THREAD_DEBUG)
909
910ALTPICS= $(TRACEOBJS:%=pics/%)
911
912$(DYNLIB) := PICS += $(ROOTFS_LIBDIR64)/libc_i18n.a
913$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS)
914
915MAPFILES =	../port/mapfile-vers mapfile-vers
916
917CPPFLAGS=	-D_REENTRANT -D$(MACH64) -D__$(MACH64) \
918		-I. -I$(LIBCBASE)/inc -I../inc $(CPPFLAGS.master) -I/usr/include
919ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) \
920		$(amd64_AS_XARCH)
921
922# Inform the run-time linker about libc specialized initialization
923RTLDINFO =	-z rtldinfo=tls_rtldinfo
924DYNFLAGS +=	$(RTLDINFO)
925
926BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
927
928# Override this top level flag so the compiler builds in its native
929# C99 mode.  This has been enabled to support the complex arithmetic
930# added to libc.
931C99MODE=	$(C99_ENABLE)
932
933# libc method of building an archive
934BUILD.AR= $(RM) $@ ; \
935	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%)| $(TSORT)`
936
937# extra files for the clean target
938CLEANFILES=			\
939	../port/gen/errlst.c	\
940	../port/gen/new_list.c	\
941	assym.h			\
942	genassym		\
943	crt/_rtld.s		\
944	pics/crti.o		\
945	pics/crtn.o		\
946	$(ALTPICS)
947
948CLOBBERFILES +=	$(LIB_PIC)
949
950# list of C source for lint
951SRCS=							\
952	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
953	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
954	$(PORTFP:%.o=../port/fp/%.c)			\
955	$(PORTGEN:%.o=../port/gen/%.c)			\
956	$(PORTI18N:%.o=../port/i18n/%.c)		\
957	$(PORTPRINT:%.o=../port/print/%.c)		\
958	$(PORTREGEX:%.o=../port/regex/%.c)		\
959	$(PORTSTDIO:%.o=../port/stdio/%.c)		\
960	$(PORTSYS:%.o=../port/sys/%.c)			\
961	$(AIOOBJS:%.o=../port/aio/%.c)			\
962	$(RTOBJS:%.o=../port/rt/%.c)			\
963	$(TPOOLOBJS:%.o=../port/tpool/%.c)		\
964	$(THREADSOBJS:%.o=../port/threads/%.c)		\
965	$(THREADSMACHOBJS:%.o=threads/%.c)		\
966	$(UNWINDMACHOBJS:%.o=unwind/%.c)		\
967	$(FPOBJS:%.o=fp/%.c)				\
968	$(I386FPOBJS:%.o=../i386/fp/%.c)		\
969	$(LIBCBASE)/gen/ecvt.c				\
970	$(LIBCBASE)/gen/lexp10.c			\
971	$(LIBCBASE)/gen/llog10.c			\
972	$(LIBCBASE)/gen/ltostr.c			\
973	$(LIBCBASE)/gen/makectxt.c			\
974	$(LIBCBASE)/gen/siginfolst.c			\
975	$(LIBCBASE)/gen/siglongjmp.c			\
976	$(LIBCBASE)/gen/sync_instruction_memory.c	\
977	$(LIBCBASE)/sys/uadmin.c
978
979# conditional assignments
980# $(DYNLIB) $(LIB_PIC) := DYNOBJS = _rtbootld.o
981$(DYNLIB) := CRTI = crti.o
982$(DYNLIB) := CRTN = crtn.o
983
984# Files which need the threads .il inline template
985TIL=				\
986	aio.o			\
987	alloc.o			\
988	assfail.o		\
989	atexit.o		\
990	atfork.o		\
991	cancel.o		\
992	door_calls.o		\
993	errno.o			\
994	lwp.o			\
995	ma.o			\
996	machdep.o		\
997	posix_aio.o		\
998	pthr_attr.o		\
999	pthr_barrier.o		\
1000	pthr_cond.o		\
1001	pthr_mutex.o		\
1002	pthr_rwlock.o		\
1003	pthread.o		\
1004	rand.o			\
1005	rtsched.o		\
1006	rwlock.o		\
1007	scalls.o		\
1008	sema.o			\
1009	sigaction.o		\
1010	sigev_thread.o		\
1011	spawn.o			\
1012	stack.o			\
1013	synch.o			\
1014	tdb_agent.o		\
1015	thr.o			\
1016	thread_interface.o	\
1017	thread_pool.o		\
1018	thrp_unwind.o		\
1019	tls.o			\
1020	tsd.o
1021
1022$(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/amd64.il
1023
1024# pics/mul64.o := CFLAGS64 += crt/mul64.il
1025
1026# large-file-aware components that should be built large
1027
1028#$(COMSYSOBJS64:%=pics/%) := \
1029#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1030
1031#$(SYSOBJS64:%=pics/%) := \
1032#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1033
1034#$(PORTGEN64:%=pics/%) := \
1035#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1036
1037#$(PORTSTDIO64:%=pics/%) := \
1038#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1039
1040#$(PORTSYS64:%=pics/%) := \
1041#	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
1042
1043$(PORTSTDIO_W:%=pics/%) := \
1044	CPPFLAGS += -D_WIDE
1045
1046$(PORTPRINT_W:%=pics/%) := \
1047	CPPFLAGS += -D_WIDE
1048
1049$(PORTPRINT_C89:%=pics/%) := \
1050	CPPFLAGS += -D_C89_INTMAX32
1051
1052$(PORTSTDIO_C89:%=pics/%) := \
1053	CPPFLAGS += -D_C89_INTMAX32
1054
1055$(PORTI18N_COND:%=pics/%) := \
1056	CPPFLAGS += -D_WCS_LONGLONG
1057
1058.KEEP_STATE:
1059
1060all: $(LIBS) $(LIB_PIC)
1061
1062lint	:=	CPPFLAGS += -I../$(MACH)/fp
1063lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
1064lint	:=	LINTFLAGS64 += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
1065
1066lint:
1067	@echo $(LINT.c) ... $(LDLIBS)
1068	@$(LINT.c) $(SRCS) $(LDLIBS)
1069
1070$(LINTLIB):= SRCS=../port/llib-lc
1071$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
1072$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=amd64
1073
1074# object files that depend on inline template
1075$(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il
1076# pics/mul64.o: crt/mul64.il
1077
1078# include common libc targets
1079include ../Makefile.targ
1080
1081# We need to strip out all CTF data from the static library
1082$(LIB_PIC) := DIR = pics
1083$(LIB_PIC): pics $$(PICS)
1084	$(BUILD.AR)
1085	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
1086	$(AR) -ts $@ > /dev/null
1087	$(POST_PROCESS_A)
1088
1089ASSYMDEP_OBJS=			\
1090	_lwp_mutex_unlock.o	\
1091	_stack_grow.o		\
1092	asm_subr.o		\
1093	getcontext.o		\
1094	tls_get_addr.o		\
1095	vfork.o
1096
1097$(ASSYMDEP_OBJS:%=pics/%): assym.h
1098
1099# assym.h build rules
1100
1101GENASSYM_C = genassym.c
1102
1103# XXX	A hack.  Perhaps this should be 'CPPFLAGS.native' and
1104#	live in Makefile.master
1105
1106CPPFLAGS.genassym = \
1107	$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
1108
1109genassym: $(GENASSYM_C)
1110	$(NATIVECC) -Iinc -I../inc $(CPPFLAGS.genassym) -o $@ $(GENASSYM_C)
1111
1112OFFSETS = ../$(MACH)/offsets.in
1113
1114assym.h: $(OFFSETS) genassym
1115	$(OFFSETS_CREATE) <$(OFFSETS) >$@
1116	./genassym >>$@
1117
1118# derived C source and related explicit dependencies
1119../port/gen/errlst.c + \
1120../port/gen/new_list.c: ../port/gen/errlist ../port/gen/errlist.awk
1121	cd ../port/gen; pwd; $(AWK) -f errlist.awk < errlist
1122
1123pics/errlst.o: ../port/gen/errlst.c
1124
1125pics/new_list.o: ../port/gen/new_list.c
1126