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