# Makefile.in
-# Copyright (C) 2005, 2006 Free Software Foundation
+# Copyright (C) 2005, 2006, 2009, 2010, 2011 Free Software Foundation
#
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify it under the
# terms of the GNU Library General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
+# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# GCC is distributed in the hope that it will be useful, but WITHOUT ANY
# more details.
#
# You should have received a copy of the GNU General Public License along
-# with GCC; see the file COPYING. If not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
-# USA.
+# with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
#
libgcc_topdir = @libgcc_topdir@
SHELL = @SHELL@
+cpu_type = @cpu_type@
enable_shared = @enable_shared@
+double_type_size = @double_type_size@
+long_double_type_size = @long_double_type_size@
decimal_float = @decimal_float@
enable_decimal_float = @enable_decimal_float@
fixed_point = @fixed_point@
host_noncanonical = @host_noncanonical@
+target_noncanonical = @target_noncanonical@
# List of extra object files that should be compiled for this target machine.
# The rules for compiling them should be in the t-* file for the machine.
config.status: $(srcdir)/configure $(srcdir)/config.host
$(SHELL) ./config.status --recheck
+AUTOCONF = autoconf
+configure_deps = \
+ $(srcdir)/../config/enable.m4 \
+ $(srcdir)/../config/tls.m4 \
+ $(srcdir)/../config/acx.m4 \
+ $(srcdir)/../config/no-executables.m4 \
+ $(srcdir)/../config/override.m4 \
+ $(srcdir)/../config/dfp.m4 \
+
+$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+
include $(gcc_objdir)/libgcc.mvars
# Flags to pass to recursive makes.
libsubdir = $(libdir)/gcc/$(host_noncanonical)/$(version)
# Used to install the shared libgcc.
slibdir = @slibdir@
+# Maybe used for DLLs on Windows targets.
+toolexecdir = @toolexecdir@
+toolexeclibdir = @toolexeclibdir@
export AR_FOR_TARGET
export AR_CREATE_FOR_TARGET
export RANLIB_FOR_TARGET
export libsubdir
export slibdir
+export toolexecdir
+export toolexeclibdir
version := $(shell $(CC) -dumpversion)
# will usually contain -g, so for the moment CFLAGS goes first. We must
# include CFLAGS - that's where multilib options live.
INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
- $(INCLUDES) @set_have_cc_tls@
+ $(INCLUDES) @set_have_cc_tls@ @set_use_emutls@
MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
objects = $(filter %$(objext),$^)
# Collect any host-specific information from Makefile fragments.
+
+LIBGCC_VER_GNU_PREFIX = __
+LIBGCC_VER_FIXEDPOINT_GNU_PREFIX = __
+LIBGCC_VER_SYMBOLS_PREFIX =
+
+FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
+ _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
+ _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
+ _sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf
+
+DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
+ _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
+ _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
+ _df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df
+
+TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
+ _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
+ _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
+ _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf
+
+# Additional sources to handle exceptions; overridden by targets as needed.
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+LIB2ADDEHSTATIC = $(LIB2ADDEH)
+LIB2ADDEHSHARED = $(LIB2ADDEH)
+
+# Don't build libunwind by default.
+LIBUNWIND =
+SHLIBUNWIND_LINK =
+SHLIBUNWIND_INSTALL =
+
tmake_file = @tmake_file@
include $(srcdir)/empty.mk $(tmake_file)
define gen-hide-list
$(NM) -pg $< | \
- $(AWK) 'NF == 3 && $$2 !~ /^[UN]$$/ { print "\t$(ASM_HIDDEN_OP)", $$3 }' > $@T
+ $(AWK) 'NF == 3 && $$2 !~ /^[UN]$$/ && $$3 !~ /.*_compat/ \
+ && $$3 !~ /.*@.*/ \
+ { print "\t$(ASM_HIDDEN_OP)", $$3 }' > $@T
mv -f $@T $@
endef
else
endif
endif
+LIB2ADD += enable-execute-stack.c
+
+LIB2ADDEH += $(srcdir)/emutls.c
+LIB2ADDEHSTATIC += $(srcdir)/emutls.c
+LIB2ADDEHSHARED += $(srcdir)/emutls.c
+
# Library members defined in libgcc2.c.
lib2funcs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2 \
- _clear_cache _enable_execute_stack _trampoline __main _absvsi2 \
+ _clear_cache _trampoline __main _absvsi2 \
_absvdi2 _addvsi3 _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 \
_negvsi2 _negvdi2 _ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 \
_ctzsi2 _ctzdi2 _popcount_tab _popcountsi2 _popcountdi2 \
_paritysi2 _paritydi2 _powisf2 _powidf2 _powixf2 _powitf2 \
_mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 _divxc3 \
- _divtc3 _bswapsi2 _bswapdi2
+ _divtc3 _bswapsi2 _bswapdi2 _clrsbsi2 _clrsbdi2
# The floating-point conversion routines that involve a single-word integer.
# XX stands for the integer mode.
# functions are built with a wordsize of 4; the TImode functions are
# built with the same labels, but a wordsize of 8.
-sifuncs = $(subst XX,si,$(swfloatfuncs))
-difuncs = $(subst XX,di,$(dwfloatfuncs))
-tifuncs = $(subst XX,ti,$(dwfloatfuncs))
+sifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,si,$(swfloatfuncs)))
+difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,di,$(dwfloatfuncs)))
+tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,ti,$(dwfloatfuncs)))
iter-items := $(sifuncs) $(difuncs) $(tifuncs)
iter-labels := $(sifuncs) $(difuncs) $(difuncs)
libgcc-s-objects += $(lib2-divmod-s-o)
endif
-# $(FPBIT) et al. are pathnames relative to the GCC build
-# directory; the supporting files are made by the GCC
-# Makefile.
-# FIXME: Soon we will be able to move this logic into this directory.
-
-ifneq ($(fpbit-in-libgcc),yes)
-FPBIT:=$(if $(FPBIT),$(gcc_objdir)/$(FPBIT),)
-DPBIT:=$(if $(DPBIT),$(gcc_objdir)/$(DPBIT),)
-TPBIT:=$(if $(TPBIT),$(gcc_objdir)/$(TPBIT),)
-endif
-
ifeq ($(TPBIT),)
# _sf_to_tf and _df_to_tf require tp-bit.c being compiled in.
FPBIT_FUNCS := $(filter-out _sf_to_tf,$(FPBIT_FUNCS))
DPBIT_FUNCS := $(filter-out _df_to_tf,$(DPBIT_FUNCS))
endif
+fpbit-src := $(srcdir)/fp-bit.c
+
# Build FPBIT.
ifneq ($(FPBIT),)
fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS))
-$(fpbit-o): %$(objext): $(FPBIT)
- $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(FPBIT) $(vis_hide)
+$(fpbit-o): %$(objext): $(fpbit-src)
+ $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DFLOAT $(FPBIT_CFLAGS) -c $< $(vis_hide)
libgcc-objects += $(fpbit-o)
ifeq ($(enable_shared),yes)
fpbit-s-o = $(patsubst %,%_s$(objext),$(FPBIT_FUNCS))
-$(fpbit-s-o): %_s$(objext): $(FPBIT)
- $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(FPBIT)
+$(fpbit-s-o): %_s$(objext): $(fpbit-src)
+ $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DFLOAT $(FPBIT_CFLAGS) -c $<
libgcc-s-objects += $(fpbit-s-o)
endif
endif
# Build DPBIT.
ifneq ($(DPBIT),)
dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS))
-$(dpbit-o): %$(objext): $(DPBIT)
- $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(DPBIT) $(vis_hide)
+$(dpbit-o): %$(objext): $(fpbit-src)
+ $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* $(DPBIT_CFLAGS) -c $< $(vis_hide)
libgcc-objects += $(dpbit-o)
ifeq ($(enable_shared),yes)
dpbit-s-o = $(patsubst %,%_s$(objext),$(DPBIT_FUNCS))
-$(dpbit-s-o): %_s$(objext): $(DPBIT)
- $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(DPBIT)
+$(dpbit-s-o): %_s$(objext): $(fpbit-src)
+ $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* $(DPBIT_CFLAGS) -c $<
libgcc-s-objects += $(dpbit-s-o)
endif
endif
# Build TPBIT.
ifneq ($(TPBIT),)
tpbit-o = $(patsubst %,%$(objext),$(TPBIT_FUNCS))
-$(tpbit-o): %$(objext): $(TPBIT)
- $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(TPBIT) $(vis_hide)
+$(tpbit-o): %$(objext): $(fpbit-src)
+ $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DTFLOAT $(TPBIT_CFLAGS) -c $< $(vis_hide)
libgcc-objects += $(tpbit-o)
ifeq ($(enable_shared),yes)
tpbit-s-o = $(patsubst %,%_s$(objext),$(TPBIT_FUNCS))
-$(tpbit-s-o): %_s$(objext): $(TPBIT)
- $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(TPBIT)
+$(tpbit-s-o): %_s$(objext): $(fpbit-src)
+ $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DTFLOAT $(TPBIT_CFLAGS) -c $<
libgcc-s-objects += $(tpbit-s-o)
endif
endif
libgcc-objects += $(decbits-objects)
# Next build individual support functions.
+D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \
+ _eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \
+ _sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \
+ _si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \
+ _sd_to_sf _sd_to_df _sd_to_xf _sd_to_tf \
+ _sf_to_sd _df_to_sd _xf_to_sd _tf_to_sd \
+ _sd_to_dd _sd_to_td _unord_sd _conv_sd
+
+D64PBIT_FUNCS = _addsub_dd _div_dd _mul_dd _plus_dd _minus_dd \
+ _eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \
+ _dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \
+ _si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \
+ _dd_to_sf _dd_to_df _dd_to_xf _dd_to_tf \
+ _sf_to_dd _df_to_dd _xf_to_dd _tf_to_dd \
+ _dd_to_sd _dd_to_td _unord_dd _conv_dd
+
+D128PBIT_FUNCS = _addsub_td _div_td _mul_td _plus_td _minus_td \
+ _eq_td _ne_td _lt_td _gt_td _le_td _ge_td \
+ _td_to_si _td_to_di _td_to_usi _td_to_udi \
+ _si_to_td _di_to_td _usi_to_td _udi_to_td \
+ _td_to_sf _td_to_df _td_to_xf _td_to_tf \
+ _sf_to_td _df_to_td _xf_to_td _tf_to_td \
+ _td_to_sd _td_to_dd _unord_td _conv_td
+
ifeq ($(enable_decimal_float),bid)
ifneq ($(D32PBIT),)
D32PBIT_FUNCS:=$(filter-out _plus_sd _minus_sd _conv_sd, $(D32PBIT_FUNCS))
ifeq ($(enable_decimal_float),bid)
$(d32pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
else
-$(d32pbit-o): %$(objext): $(gcc_srcdir)/config/dfp-bit.c
+$(d32pbit-o): %$(objext): $(srcdir)/dfp-bit.c
endif
$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=32 -c $<
libgcc-objects += $(d32pbit-o)
ifeq ($(enable_decimal_float),bid)
$(d64pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
else
-$(d64pbit-o): %$(objext): $(gcc_srcdir)/config/dfp-bit.c
+$(d64pbit-o): %$(objext): $(srcdir)/dfp-bit.c
endif
$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=64 -c $<
libgcc-objects += $(d64pbit-o)
ifeq ($(enable_decimal_float),bid)
$(d128pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
else
-$(d128pbit-o): %$(objext): $(gcc_srcdir)/config/dfp-bit.c
+$(d128pbit-o): %$(objext): $(srcdir)/dfp-bit.c
endif
$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=128 -c $<
libgcc-objects += $(d128pbit-o)
endif
-ifeq ($(LIBGCC_SYNC),yes)
+ifeq ($(SYNC),yes)
libgcc-sync-size-funcs := $(foreach op, add sub or and xor nand, \
sync_fetch_and_$(op) \
sync_$(op)_and_fetch) \
$(prefix)_$(suffix)))
libgcc-sync-size-funcs-o = $(patsubst %,%$(objext),$(libgcc-sync-size-funcs))
-$(libgcc-sync-size-funcs-o): %$(objext): $(gcc_srcdir)/config/sync.c
- $(gcc_compile) $(LIBGCC_SYNC_CFLAGS) \
+$(libgcc-sync-size-funcs-o): %$(objext): $(srcdir)/sync.c
+ $(gcc_compile) $(SYNC_CFLAGS) \
-DFN=`echo "$*" | sed 's/_[^_]*$$//'` \
-DSIZE=`echo "$*" | sed 's/.*_//'` \
- -c $(gcc_srcdir)/config/sync.c $(vis_hide)
+ -c $< $(vis_hide)
libgcc-objects += $(libgcc-sync-size-funcs-o)
libgcc-sync-funcs := sync_synchronize
libgcc-sync-funcs-o = $(patsubst %,%$(objext),$(libgcc-sync-funcs))
-$(libgcc-sync-funcs-o): %$(objext): $(gcc_srcdir)/config/sync.c
- $(gcc_compile) $(LIBGCC_SYNC_CFLAGS) \
+$(libgcc-sync-funcs-o): %$(objext): $(srcdir)/sync.c
+ $(gcc_compile) $(SYNC_CFLAGS) \
-DL$* \
- -c $(gcc_srcdir)/config/sync.c $(vis_hide)
+ -c $< $(vis_hide)
libgcc-objects += $(libgcc-sync-funcs-o)
ifeq ($(enable_shared),yes)
libgcc-sync-size-funcs-s-o = $(patsubst %,%_s$(objext), \
$(libgcc-sync-size-funcs))
-$(libgcc-sync-size-funcs-s-o): %_s$(objext): $(gcc_srcdir)/config/sync.c
- $(gcc_s_compile) $(LIBGCC_SYNC_CFLAGS) \
+$(libgcc-sync-size-funcs-s-o): %_s$(objext): $(srcdir)/sync.c
+ $(gcc_s_compile) $(SYNC_CFLAGS) \
-DFN=`echo "$*" | sed 's/_[^_]*$$//'` \
-DSIZE=`echo "$*" | sed 's/.*_//'` \
- -c $(gcc_srcdir)/config/sync.c
+ -c $<
libgcc-s-objects += $(libgcc-sync-size-funcs-s-o)
libgcc-sync-funcs-s-o = $(patsubst %,%_s$(objext),$(libgcc-sync-funcs))
-$(libgcc-sync-funcs-s-o): %_s$(objext): $(gcc_srcdir)/config/sync.c
- $(gcc_s_compile) $(LIBGCC_SYNC_CFLAGS) \
+$(libgcc-sync-funcs-s-o): %_s$(objext): $(srcdir)/sync.c
+ $(gcc_s_compile) $(SYNC_CFLAGS) \
-DL$* \
- -c $(gcc_srcdir)/config/sync.c
+ -c $<
libgcc-s-objects += $(libgcc-sync-funcs-s-o)
endif
endif
include $(iterator)
# Build libgcov components.
+
+# Defined in libgcov.c, included only in gcov library
+LIBGCOV = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta \
+ _gcov_fork _gcov_execl _gcov_execlp _gcov_execle \
+ _gcov_execv _gcov_execvp _gcov_execve \
+ _gcov_interval_profiler _gcov_pow2_profiler _gcov_one_value_profiler \
+ _gcov_indirect_call_profiler _gcov_average_profiler _gcov_ior_profiler \
+ _gcov_merge_ior
+
libgcov-objects = $(patsubst %,%$(objext),$(LIBGCOV))
-$(libgcov-objects): %$(objext): $(gcc_srcdir)/libgcov.c
- $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcov.c
+
+$(libgcov-objects): %$(objext): $(srcdir)/libgcov.c
+ $(gcc_compile) -DL$* -c $(srcdir)/libgcov.c
# Static libraries.
mapfile = libgcc.map
endif
+libgcc-std.ver: $(srcdir)/libgcc-std.ver.in
+ sed -e 's/__PFX__/$(LIBGCC_VER_GNU_PREFIX)/g' \
+ -e 's/__FIXPTPFX__/$(LIBGCC_VER_FIXEDPOINT_GNU_PREFIX)/g' < $< > $@
+
libgcc_s$(SHLIB_EXT): $(libgcc-s-objects) $(extra-parts)
# @multilib_flags@ is still needed because this may use
# $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly.
for file in $$parts; do \
rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file; \
$(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/; \
+ case $$file in \
+ *.a) \
+ $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;; \
+ esac; \
done
# Build extra startfiles in the gcc directory, for unconverted
for file in $$parts; do \
rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file; \
$(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/; \
+ case $$file in \
+ *.a) \
+ $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;; \
+ esac; \
done
all: $(extra-parts)
+install-unwind_h:
+ cp unwind.h $(gcc_objdir)/include/unwind.h
+ chmod a+r $(gcc_objdir)/include/unwind.h
+
+all: install-unwind_h
+
# Documentation targets (empty).
.PHONY: info html dvi pdf install-info install-html install-pdf
for file in $$parts; do \
rm -f $(DESTDIR)$(inst_libdir)/$$file; \
$(INSTALL_DATA) $$file $(DESTDIR)$(inst_libdir)/; \
+ case $$file in \
+ *.a) \
+ $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;; \
+ esac; \
done
install: install-leaf
- @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
+ @: $(MAKE) ; $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
+
+install-strip: install
-.PHONY: install install-shared install-libunwind
+.PHONY: install install-shared install-libunwind install-strip
# Don't export variables to the environment, in order to not confuse
# configure.