Makefile.in 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206
  1. # Makefile.in
  2. # Copyright (C) 2005-2022 Free Software Foundation, Inc.
  3. #
  4. # This file is part of GCC.
  5. #
  6. # GCC is free software; you can redistribute it and/or modify it under the
  7. # terms of the GNU Library General Public License as published by the Free
  8. # Software Foundation; either version 3 of the License, or (at your option)
  9. # any later version.
  10. #
  11. # GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  12. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. # FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. # more details.
  15. #
  16. # You should have received a copy of the GNU General Public License along
  17. # with GCC; see the file COPYING3. If not see
  18. # <http://www.gnu.org/licenses/>.
  19. #
  20. libgcc_topdir = @libgcc_topdir@
  21. host_subdir = @host_subdir@
  22. gcc_objdir = $(MULTIBUILDTOP)../../$(host_subdir)/gcc
  23. srcdir = @srcdir@
  24. prefix = @prefix@
  25. exec_prefix = @exec_prefix@
  26. libdir = @libdir@
  27. shlib_slibdir = @slibdir@
  28. SHELL = @SHELL@
  29. cpu_type = @cpu_type@
  30. enable_shared = @enable_shared@
  31. enable_gcov = @enable_gcov@
  32. double_type_size = @double_type_size@
  33. long_double_type_size = @long_double_type_size@
  34. decimal_float = @decimal_float@
  35. enable_vtable_verify = @enable_vtable_verify@
  36. enable_decimal_float = @enable_decimal_float@
  37. fixed_point = @fixed_point@
  38. with_aix_soname = @with_aix_soname@
  39. solaris_ld_v2_maps = @solaris_ld_v2_maps@
  40. enable_execute_stack = @enable_execute_stack@
  41. unwind_header = @unwind_header@
  42. md_unwind_header = @md_unwind_header@
  43. sfp_machine_header = @sfp_machine_header@
  44. thread_header = @thread_header@
  45. host_noncanonical = @host_noncanonical@
  46. real_host_noncanonical = @real_host_noncanonical@
  47. target_noncanonical = @target_noncanonical@
  48. # List of extra object files that should be compiled for this target machine.
  49. # The rules for compiling them should be in the t-* file for the machine.
  50. EXTRA_PARTS = @extra_parts@
  51. FORCE_EXPLICIT_EH_REGISTRY = @force_explicit_eh_registry@
  52. extra-parts = libgcc-extra-parts
  53. # Multilib support variables.
  54. MULTISRCTOP =
  55. MULTIBUILDTOP =
  56. MULTIDIRS =
  57. MULTISUBDIR =
  58. MULTIDO = true
  59. MULTICLEAN = true
  60. INSTALL = @INSTALL@
  61. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  62. INSTALL_DATA = @INSTALL_DATA@
  63. mkinstalldirs = $(SHELL) $(libgcc_topdir)/mkinstalldirs
  64. INSTALL_PARTS = $(EXTRA_PARTS)
  65. objext = .o
  66. AR = @AR@
  67. AR_FLAGS = rc
  68. CC = @CC@
  69. CFLAGS = @CFLAGS@
  70. RANLIB = @RANLIB@
  71. LN_S = @LN_S@
  72. PWD_COMMAND = $${PWDCMD-pwd}
  73. # Flags to pass to a recursive make.
  74. FLAGS_TO_PASS = \
  75. "AR=$(AR)" \
  76. "AR_FLAGS=$(AR_FLAGS)" \
  77. "CC=$(CC)" \
  78. "CFLAGS=$(CFLAGS)" \
  79. "DESTDIR=$(DESTDIR)" \
  80. "EXTRA_OFILES=$(EXTRA_OFILES)" \
  81. "HDEFINES=$(HDEFINES)" \
  82. "INSTALL=$(INSTALL)" \
  83. "INSTALL_DATA=$(INSTALL_DATA)" \
  84. "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  85. "LDFLAGS=$(LDFLAGS)" \
  86. "LOADLIBES=$(LOADLIBES)" \
  87. "RANLIB=$(RANLIB)" \
  88. "SHELL=$(SHELL)" \
  89. "prefix=$(prefix)" \
  90. "exec_prefix=$(exec_prefix)" \
  91. "libdir=$(libdir)" \
  92. "libsubdir=$(libsubdir)" \
  93. "tooldir=$(tooldir)"
  94. # Dependencies for "all" are set later in the file.
  95. all: all-multi
  96. # Now that we have built all the objects, we need to copy
  97. # them back to the GCC directory. Too many things (other
  98. # in-tree libraries, and DejaGNU) know about the layout
  99. # of the build tree, for now.
  100. $(MAKE) install-leaf DESTDIR=$(gcc_objdir) \
  101. slibdir= libsubdir= MULTIOSDIR=$(MULTIDIR)
  102. .PHONY: all-multi
  103. all-multi:
  104. # If this is the top-level multilib, build all the other
  105. # multilibs.
  106. @: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
  107. .PHONY: check installcheck
  108. check:
  109. installcheck:
  110. .PHONY: all clean
  111. clean:
  112. -rm -f libgcc_tm.h libgcc.map
  113. -rm -f libgcc_tm.stamp stmp-ldirs
  114. -rm -f *$(objext)
  115. -rm -f *.dep
  116. -rm -f *.a
  117. -rm -f libunwind$(SHLIB_EXT)
  118. -rm -f libgcc_s*
  119. @$(MULTICLEAN) multi-clean DO=clean
  120. distclean: clean
  121. @$(MULTICLEAN) multi-clean DO=distclean
  122. -rm -f auto-target.h
  123. -rm -f stamp-h
  124. -rm -f *~ Makefile config.cache config.status multilib.out
  125. -rm -f config.log
  126. maintainer-clean realclean: distclean
  127. Makefile: $(srcdir)/Makefile.in config.status
  128. CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
  129. # Depending on Makefile makes sure that config.status has been re-run
  130. # if needed. This prevents problems with parallel builds.
  131. auto-target.h: stamp-h ; @true
  132. stamp-h: $(srcdir)/config.in config.status Makefile
  133. CONFIG_FILES= CONFIG_HEADERS=auto-target.h:$(srcdir)/config.in $(SHELL) ./config.status
  134. config.status: $(srcdir)/configure $(srcdir)/config.host
  135. $(SHELL) ./config.status --recheck
  136. AUTOCONF = autoconf
  137. configure_deps = \
  138. $(srcdir)/../config/enable.m4 \
  139. $(srcdir)/../config/tls.m4 \
  140. $(srcdir)/../config/toolexeclibdir.m4 \
  141. $(srcdir)/../config/acx.m4 \
  142. $(srcdir)/../config/no-executables.m4 \
  143. $(srcdir)/../config/lib-ld.m4 \
  144. $(srcdir)/../config/override.m4 \
  145. $(srcdir)/../config/picflag.m4 \
  146. $(srcdir)/../config/dfp.m4 \
  147. $(srcdir)/../config/unwind_ipinfo.m4 \
  148. $(srcdir)/../config/gthr.m4 \
  149. $(srcdir)/../config/sjlj.m4 \
  150. $(srcdir)/../config/cet.m4
  151. $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(configure_deps)
  152. cd $(srcdir) && $(AUTOCONF)
  153. include $(gcc_objdir)/libgcc.mvars
  154. # Flags to pass to recursive makes.
  155. AR_FOR_TARGET = $(AR)
  156. AR_FLAGS_FOR_TARGET =
  157. AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
  158. AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
  159. AWK = @AWK@
  160. GCC_FOR_TARGET = $(CC)
  161. LIPO = @LIPO@
  162. LIPO_FOR_TARGET = $(LIPO)
  163. MACHMODE_H = machmode.h mode-classes.def insn-modes.h
  164. NM = @NM@
  165. NM_FOR_TARGET = $(NM)
  166. RANLIB_FOR_TARGET = $(RANLIB)
  167. STRIP = @STRIP@
  168. STRIP_FOR_TARGET = $(STRIP)
  169. # Directory in which the compiler finds libraries etc.
  170. libsubdir = $(libdir)/gcc/$(real_host_noncanonical)/$(version)@accel_dir_suffix@
  171. # Used to install the shared libgcc.
  172. slibdir = @slibdir@
  173. # Maybe used for DLLs on Windows targets.
  174. toolexecdir = @toolexecdir@
  175. toolexeclibdir = @toolexeclibdir@
  176. export AR_FOR_TARGET
  177. export AR_CREATE_FOR_TARGET
  178. export AR_FLAGS_FOR_TARGET
  179. export AR_EXTRACT_FOR_TARGET
  180. export AWK
  181. export DESTDIR
  182. export GCC_FOR_TARGET
  183. export INCLUDES
  184. export INSTALL_DATA
  185. export LIB1ASMSRC
  186. export LIBGCC2_CFLAGS
  187. export LIPO_FOR_TARGET
  188. export MACHMODE_H
  189. export NM_FOR_TARGET
  190. export STRIP_FOR_TARGET
  191. export RANLIB_FOR_TARGET
  192. export libsubdir
  193. export slibdir
  194. export toolexecdir
  195. export toolexeclibdir
  196. version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
  197. ifeq ($(decimal_float),yes)
  198. ifeq ($(enable_decimal_float),bid)
  199. DECNUMINC = -I$(srcdir)/config/libbid -DENABLE_DECIMAL_BID_FORMAT
  200. else
  201. DECNUMINC = -I$(srcdir)/../libdecnumber/$(enable_decimal_float) \
  202. -I$(srcdir)/../libdecnumber
  203. endif
  204. else
  205. DECNUMINC =
  206. endif
  207. # Options to use when compiling libgcc2.a.
  208. #
  209. LIBGCC2_DEBUG_CFLAGS = -g
  210. LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
  211. $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
  212. -fbuilding-libgcc -fno-stack-protector \
  213. $(INHIBIT_LIBC_CFLAGS)
  214. # Additional options to use when compiling libgcc2.a.
  215. # Some targets override this to -isystem include
  216. LIBGCC2_INCLUDES =
  217. # Additional target-dependent options for compiling libgcc2.a.
  218. HOST_LIBGCC2_CFLAGS =
  219. PICFLAG = @PICFLAG@
  220. CET_FLAGS = @CET_FLAGS@
  221. USE_TM_CLONE_REGISTRY = @use_tm_clone_registry@
  222. # Defined in libgcc2.c, included only in the static library.
  223. LIB2FUNCS_ST = _eprintf __gcc_bcmp
  224. # List of functions not to build from libgcc2.c.
  225. LIB2FUNCS_EXCLUDE =
  226. # List of extra C and assembler files to add to static and shared libgcc2.
  227. # Assembler files should have names ending in `.S'.
  228. LIB2ADD =
  229. # List of extra C and assembler files to add to static libgcc2.
  230. # Assembler files should have names ending in `.S'.
  231. LIB2ADD_ST =
  232. # Specify the directories to be searched for header files.
  233. # Both . and srcdir are used, in that order,
  234. # so that *config.h will be found in the compilation
  235. # subdirectory rather than in the source directory.
  236. # -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
  237. # currently being compiled, in both source trees, to be examined as well.
  238. INCLUDES = -I. -I$(@D) -I$(gcc_objdir) \
  239. -I$(srcdir) -I$(srcdir)/$(@D) -I$(srcdir)/../gcc \
  240. -I$(srcdir)/../include $(DECNUMINC)
  241. # Forcibly remove any profiling-related flags. There is no point
  242. # in supporting profiled bootstrap in this library.
  243. override CFLAGS := $(filter-out -fprofile-generate -fprofile-use,$(CFLAGS))
  244. # CFLAGS first is not perfect; normally setting CFLAGS should override any
  245. # options in LIBGCC2_CFLAGS. But LIBGCC2_CFLAGS may contain -g0, and CFLAGS
  246. # will usually contain -g, so for the moment CFLAGS goes first. We must
  247. # include CFLAGS - that's where multilib options live.
  248. INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
  249. $(INCLUDES) @set_have_cc_tls@ @set_use_emutls@
  250. # Options to use when compiling crtbegin/end.
  251. CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
  252. $(NO_PIE_CFLAGS) -finhibit-size-directive -fno-inline -fno-exceptions \
  253. -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
  254. -fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \
  255. $(INHIBIT_LIBC_CFLAGS) $(USE_TM_CLONE_REGISTRY)
  256. # Extra flags to use when compiling crt{begin,end}.o.
  257. CRTSTUFF_T_CFLAGS =
  258. MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
  259. MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
  260. MULTIOSSUBDIR := $(shell if test $(MULTIOSDIR) != .; then echo /$(MULTIOSDIR); fi)
  261. inst_libdir = $(libsubdir)$(MULTISUBDIR)
  262. inst_slibdir = $(slibdir)$(MULTIOSSUBDIR)
  263. gcc_compile_bare = $(CC) $(INTERNAL_CFLAGS) $(CFLAGS-$(<F))
  264. compile_deps = -MT $@ -MD -MP -MF $(basename $@).dep
  265. gcc_compile = $(gcc_compile_bare) -o $@ $(compile_deps)
  266. gcc_s_compile = $(gcc_compile) -DSHARED
  267. objects = $(filter %$(objext),$^)
  268. # Collect any host-specific information from Makefile fragments.
  269. LIBGCC_VER_GNU_PREFIX = __
  270. LIBGCC_VER_FIXEDPOINT_GNU_PREFIX = __
  271. LIBGCC_VER_SYMBOLS_PREFIX =
  272. FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
  273. _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
  274. _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
  275. _sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf
  276. DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
  277. _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
  278. _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
  279. _df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df
  280. TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
  281. _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
  282. _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
  283. _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf
  284. # Additional sources to handle exceptions; overridden by targets as needed.
  285. LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
  286. $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
  287. LIB2ADDEHSTATIC = $(LIB2ADDEH)
  288. LIB2ADDEHSHARED = $(LIB2ADDEH)
  289. # nm flags to list global symbols in libgcc object files.
  290. SHLIB_NM_FLAGS = -pg
  291. # Don't build libunwind by default.
  292. LIBUNWIND =
  293. SHLIBUNWIND_LINK =
  294. SHLIBUNWIND_INSTALL =
  295. # Create links to files specified in config.host.
  296. LIBGCC_LINKS = enable-execute-stack.c unwind.h md-unwind-support.h \
  297. sfp-machine.h gthr-default.h
  298. enable-execute-stack.c: $(srcdir)/$(enable_execute_stack)
  299. -$(LN_S) $< $@
  300. unwind.h: $(srcdir)/$(unwind_header)
  301. -$(LN_S) $< $@
  302. md-unwind-support.h: $(srcdir)/config/$(md_unwind_header)
  303. -$(LN_S) $< $@
  304. sfp-machine.h: $(srcdir)/config/$(sfp_machine_header)
  305. -$(LN_S) $< $@
  306. gthr-default.h: $(srcdir)/$(thread_header)
  307. -$(LN_S) $< $@
  308. tmake_file = @tmake_file@
  309. -include $(tmake_file)
  310. # Collect target defines and headers from config.host.
  311. libgcc_tm_defines = @tm_defines@
  312. libgcc_tm_file = @tm_file@
  313. libgcc_tm.h: libgcc_tm.stamp; @true
  314. libgcc_tm.stamp:
  315. DEFINES='$(libgcc_tm_defines)' HEADERS='$(libgcc_tm_file)' \
  316. $(srcdir)/mkheader.sh > tmp-libgcc_tm.h
  317. $(SHELL) $(srcdir)/../move-if-change tmp-libgcc_tm.h libgcc_tm.h
  318. echo timestamp > $@
  319. # Only handle shared libraries if both:
  320. # - the user requested them
  321. # - we know how to build them
  322. ifeq ($(SHLIB_LINK),)
  323. enable_shared := no
  324. endif
  325. ifeq ($(enable_shared),yes)
  326. iterator = $(patsubst %,$(srcdir)/shared-object.mk,$(iter-items))
  327. install-shared = install-shared
  328. ifneq ($(LIBUNWIND),)
  329. install-libunwind = install-libunwind
  330. endif
  331. endif
  332. # For -fvisibility=hidden. We need both a -fvisibility=hidden on
  333. # the command line, and a #define to prevent libgcc2.h etc from
  334. # overriding that with #pragmas.
  335. vis_hide = @vis_hide@
  336. ifneq (,$(vis_hide))
  337. # If we have -fvisibility=hidden, then we need to generate hide
  338. # lists for object files implemented in assembly.
  339. ASM_HIDDEN_OP = @asm_hidden_op@
  340. define gen-hide-list
  341. $(NM) -pg $< | \
  342. $(AWK) 'NF == 3 && $$2 !~ /^[UN]$$/ && $$3 !~ /.*_compat/ \
  343. && $$3 !~ /.*@.*/ \
  344. { print "\t$(ASM_HIDDEN_OP)", $$3 }' > $@T
  345. mv -f $@T $@
  346. endef
  347. else
  348. gen-hide-list = echo > $@
  349. endif
  350. ifneq ($(enable_shared),yes)
  351. iterator = $(patsubst %,$(srcdir)/static-object.mk,$(iter-items))
  352. endif
  353. LIB2ADD += enable-execute-stack.c
  354. # While emutls.c has nothing to do with EH, it is in LIB2ADDEH*
  355. # instead of LIB2ADD because that's the way to be sure on some targets
  356. # (e.g. *-*-darwin*) only one copy of it is linked.
  357. LIB2ADDEH += $(srcdir)/emutls.c
  358. LIB2ADDEHSTATIC += $(srcdir)/emutls.c
  359. LIB2ADDEHSHARED += $(srcdir)/emutls.c
  360. # Library members defined in libgcc2.c.
  361. lib2funcs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2 \
  362. _clear_cache _trampoline __main _absvsi2 \
  363. _absvdi2 _addvsi3 _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 \
  364. _negvsi2 _negvdi2 _ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 \
  365. _ctzsi2 _ctzdi2 _popcount_tab _popcountsi2 _popcountdi2 \
  366. _paritysi2 _paritydi2 _powisf2 _powidf2 _powixf2 _powitf2 \
  367. _mulhc3 _mulsc3 _muldc3 _mulxc3 _multc3 _divhc3 _divsc3 \
  368. _divdc3 _divxc3 _divtc3 _bswapsi2 _bswapdi2 _clrsbsi2 \
  369. _clrsbdi2
  370. # The floating-point conversion routines that involve a single-word integer.
  371. # XX stands for the integer mode.
  372. swfloatfuncs = $(patsubst %,_fixuns%XX,sf df xf)
  373. # Likewise double-word routines.
  374. dwfloatfuncs = $(patsubst %,_fix%XX,sf df xf tf) \
  375. $(patsubst %,_fixuns%XX,sf df xf tf) \
  376. $(patsubst %,_floatXX%,sf df xf tf) \
  377. $(patsubst %,_floatunXX%,sf df xf tf)
  378. ifeq ($(LIB2_SIDITI_CONV_FUNCS),)
  379. lib2funcs += $(subst XX,si,$(swfloatfuncs))
  380. lib2funcs += $(subst XX,di,$(dwfloatfuncs))
  381. endif
  382. # These might cause a divide overflow trap and so are compiled with
  383. # unwinder info.
  384. LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _divmoddi4 \
  385. _udivdi3 _umoddi3 _udivmoddi4 _udiv_w_sdiv
  386. # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
  387. # defined as optimized assembly code in LIB1ASMFUNCS or as C code
  388. # in LIB2FUNCS_EXCLUDE.
  389. lib2funcs := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS),$(lib2funcs))
  390. LIB2_DIVMOD_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS), \
  391. $(LIB2_DIVMOD_FUNCS))
  392. LIB2FUNCS_ST := $(filter-out $(LIB2FUNCS_EXCLUDE),$(LIB2FUNCS_ST))
  393. # Build "libgcc1" (assembly) components.
  394. lib1asmfuncs-o = $(patsubst %,%$(objext),$(LIB1ASMFUNCS))
  395. $(lib1asmfuncs-o): %$(objext): $(srcdir)/config/$(LIB1ASMSRC) %.vis
  396. $(gcc_compile) -DL$* -xassembler-with-cpp -c $< -include $*.vis
  397. $(patsubst %,%.vis,$(LIB1ASMFUNCS)): %.vis: %_s$(objext)
  398. $(gen-hide-list)
  399. libgcc-objects += $(lib1asmfuncs-o)
  400. lib1asmfuncs-s-o = $(patsubst %,%_s$(objext),$(LIB1ASMFUNCS))
  401. $(lib1asmfuncs-s-o): %_s$(objext): $(srcdir)/config/$(LIB1ASMSRC)
  402. $(gcc_s_compile) -DL$* -xassembler-with-cpp -c $<
  403. ifeq ($(enable_shared),yes)
  404. libgcc-s-objects += $(lib1asmfuncs-s-o)
  405. endif
  406. # Build lib2funcs. For the static library also include LIB2FUNCS_ST.
  407. lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST))
  408. $(lib2funcs-o): %$(objext): $(srcdir)/libgcc2.c
  409. $(gcc_compile) -DL$* -c $< $(vis_hide)
  410. libgcc-objects += $(lib2funcs-o)
  411. ifeq ($(enable_shared),yes)
  412. lib2funcs-s-o = $(patsubst %,%_s$(objext),$(lib2funcs))
  413. $(lib2funcs-s-o): %_s$(objext): $(srcdir)/libgcc2.c
  414. $(gcc_s_compile) -DL$* -c $<
  415. libgcc-s-objects += $(lib2funcs-s-o)
  416. endif
  417. ifneq ($(LIB2_SIDITI_CONV_FUNCS),)
  418. # Build libgcc2.c for each conversion function, with a specific
  419. # L<func> definition and LIBGCC2_UNITS_PER_WORD setting. The DImode
  420. # functions are built with a wordsize of 4; the TImode functions are
  421. # built with the same labels, but a wordsize of 8.
  422. sifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,si,$(swfloatfuncs)))
  423. difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,di,$(dwfloatfuncs)))
  424. tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,ti,$(dwfloatfuncs)))
  425. iter-items := $(sifuncs) $(difuncs) $(tifuncs)
  426. iter-labels := $(sifuncs) $(difuncs) $(difuncs)
  427. iter-sizes := $(patsubst %,4,$(sifuncs) $(difuncs)) $(patsubst %,8,$(tifuncs))
  428. -include $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items))
  429. libgcc-objects += $(patsubst %,%$(objext),$(sifuncs) $(difuncs) $(tifuncs))
  430. ifeq ($(enable_shared),yes)
  431. libgcc-s-objects += $(patsubst %,%_s$(objext),$(sifuncs) $(difuncs) $(tifuncs))
  432. endif
  433. endif
  434. ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),)
  435. # Provide default flags for compiling divmod functions, if they haven't been
  436. # set already by a target-specific Makefile fragment.
  437. LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions
  438. endif
  439. # Build LIB2_DIVMOD_FUNCS.
  440. lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
  441. $(lib2-divmod-o): %$(objext): $(srcdir)/libgcc2.c
  442. $(gcc_compile) -DL$* -c $< \
  443. $(LIB2_DIVMOD_EXCEPTION_FLAGS) $(vis_hide)
  444. libgcc-objects += $(lib2-divmod-o)
  445. ifeq ($(enable_shared),yes)
  446. lib2-divmod-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIVMOD_FUNCS))
  447. $(lib2-divmod-s-o): %_s$(objext): $(srcdir)/libgcc2.c
  448. $(gcc_s_compile) -DL$* -c $< \
  449. $(LIB2_DIVMOD_EXCEPTION_FLAGS)
  450. libgcc-s-objects += $(lib2-divmod-s-o)
  451. endif
  452. ifeq ($(TPBIT),)
  453. # _sf_to_tf and _df_to_tf require tp-bit.c being compiled in.
  454. FPBIT_FUNCS := $(filter-out _sf_to_tf,$(FPBIT_FUNCS))
  455. DPBIT_FUNCS := $(filter-out _df_to_tf,$(DPBIT_FUNCS))
  456. endif
  457. FPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(FPBIT_FUNCS))
  458. DPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(DPBIT_FUNCS))
  459. TPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(TPBIT_FUNCS))
  460. fpbit-src := $(srcdir)/fp-bit.c
  461. # Build FPBIT.
  462. ifneq ($(FPBIT),)
  463. fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS))
  464. $(fpbit-o): %$(objext): $(fpbit-src)
  465. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DFLOAT $(FPBIT_CFLAGS) -c $< $(vis_hide)
  466. libgcc-objects += $(fpbit-o)
  467. ifeq ($(enable_shared),yes)
  468. fpbit-s-o = $(patsubst %,%_s$(objext),$(FPBIT_FUNCS))
  469. $(fpbit-s-o): %_s$(objext): $(fpbit-src)
  470. $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DFLOAT $(FPBIT_CFLAGS) -c $<
  471. libgcc-s-objects += $(fpbit-s-o)
  472. endif
  473. endif
  474. # Build DPBIT.
  475. ifneq ($(DPBIT),)
  476. dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS))
  477. $(dpbit-o): %$(objext): $(fpbit-src)
  478. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* $(DPBIT_CFLAGS) -c $< $(vis_hide)
  479. libgcc-objects += $(dpbit-o)
  480. ifeq ($(enable_shared),yes)
  481. dpbit-s-o = $(patsubst %,%_s$(objext),$(DPBIT_FUNCS))
  482. $(dpbit-s-o): %_s$(objext): $(fpbit-src)
  483. $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* $(DPBIT_CFLAGS) -c $<
  484. libgcc-s-objects += $(dpbit-s-o)
  485. endif
  486. endif
  487. # Build TPBIT.
  488. ifneq ($(TPBIT),)
  489. tpbit-o = $(patsubst %,%$(objext),$(TPBIT_FUNCS))
  490. $(tpbit-o): %$(objext): $(fpbit-src)
  491. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DTFLOAT $(TPBIT_CFLAGS) -c $< $(vis_hide)
  492. libgcc-objects += $(tpbit-o)
  493. ifeq ($(enable_shared),yes)
  494. tpbit-s-o = $(patsubst %,%_s$(objext),$(TPBIT_FUNCS))
  495. $(tpbit-s-o): %_s$(objext): $(fpbit-src)
  496. $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DTFLOAT $(TPBIT_CFLAGS) -c $<
  497. libgcc-s-objects += $(tpbit-s-o)
  498. endif
  499. endif
  500. # Build decimal floating point support.
  501. ifeq ($(decimal_float),yes)
  502. # If $DFP_ENABLE is set, then we want all data type sizes.
  503. ifneq ($(DFP_ENABLE),)
  504. D32PBIT = 1
  505. D64PBIT = 1
  506. D128PBIT = 1
  507. endif
  508. dfp-filenames =
  509. ifneq ($(D32PBIT)$(D64PBIT)$(D128PBIT),)
  510. ifeq ($(enable_decimal_float),bid)
  511. dfp-filenames += bid_decimal_globals bid_decimal_data \
  512. bid_binarydecimal bid_convert_data \
  513. _isinfd32 _isinfd64 _isinfd128 bid64_noncomp \
  514. bid128_noncomp bid128_fma bid_round bid_from_int \
  515. bid64_add bid128_add bid64_div bid128_div \
  516. bid64_mul bid128_mul bid64_compare bid128_compare \
  517. bid128 bid32_to_bid64 bid32_to_bid128 bid64_to_bid128 \
  518. bid64_to_int32 bid64_to_int64 \
  519. bid64_to_uint32 bid64_to_uint64 \
  520. bid128_to_int32 bid128_to_int64 \
  521. bid128_to_uint32 bid128_to_uint64
  522. else
  523. dfp-filenames += decContext decNumber decExcept decRound decLibrary decDouble decPacked decQuad decSingle
  524. endif
  525. endif
  526. dfp-objects = $(patsubst %,%$(objext),$(dfp-filenames))
  527. ifeq ($(enable_decimal_float),bid)
  528. $(dfp-objects): %$(objext): $(srcdir)/config/libbid/%.c
  529. else
  530. $(dfp-objects): %$(objext): $(srcdir)/../libdecnumber/%.c
  531. endif
  532. $(gcc_compile) -c $<
  533. libgcc-objects += $(dfp-objects)
  534. decbits-filenames =
  535. ifneq ($(enable_decimal_float),bid)
  536. ifneq ($(D32PBIT),)
  537. decbits-filenames += decimal32
  538. endif
  539. ifneq ($(D64PBIT),)
  540. decbits-filenames += decimal64
  541. endif
  542. ifneq ($(D128PBIT),)
  543. decbits-filenames += decimal128
  544. endif
  545. endif
  546. decbits-objects = $(patsubst %,%$(objext),$(decbits-filenames))
  547. ifeq ($(enable_decimal_float),bid)
  548. $(decbits-objects): %$(objext): $(srcdir)/config/libbid/%.c
  549. else
  550. $(decbits-objects): %$(objext): $(srcdir)/../libdecnumber/$(enable_decimal_float)/%.c
  551. endif
  552. $(gcc_compile) -c $<
  553. libgcc-objects += $(decbits-objects)
  554. # Next build individual support functions.
  555. D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \
  556. _eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \
  557. _sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \
  558. _si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \
  559. _sd_to_sf _sd_to_df _sd_to_xf _sd_to_tf \
  560. _sf_to_sd _df_to_sd _xf_to_sd _tf_to_sd \
  561. _sd_to_dd _sd_to_td _unord_sd _conv_sd
  562. D64PBIT_FUNCS = _addsub_dd _div_dd _mul_dd _plus_dd _minus_dd \
  563. _eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \
  564. _dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \
  565. _si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \
  566. _dd_to_sf _dd_to_df _dd_to_xf _dd_to_tf \
  567. _sf_to_dd _df_to_dd _xf_to_dd _tf_to_dd \
  568. _dd_to_sd _dd_to_td _unord_dd _conv_dd
  569. D128PBIT_FUNCS = _addsub_td _div_td _mul_td _plus_td _minus_td \
  570. _eq_td _ne_td _lt_td _gt_td _le_td _ge_td \
  571. _td_to_si _td_to_di _td_to_usi _td_to_udi \
  572. _si_to_td _di_to_td _usi_to_td _udi_to_td \
  573. _td_to_sf _td_to_df _td_to_xf _td_to_tf \
  574. _sf_to_td _df_to_td _xf_to_td _tf_to_td \
  575. _td_to_sd _td_to_dd _unord_td _conv_td
  576. ifeq ($(enable_decimal_float),bid)
  577. ifneq ($(D32PBIT),)
  578. D32PBIT_FUNCS:=$(filter-out _plus_sd _minus_sd _conv_sd, $(D32PBIT_FUNCS))
  579. endif
  580. ifneq ($(D64PBIT),)
  581. D64PBIT_FUNCS:=$(filter-out _plus_dd _minus_dd _conv_dd, $(D64PBIT_FUNCS))
  582. endif
  583. ifneq ($(D128PBIT),)
  584. D128PBIT_FUNCS:=$(filter-out _plus_td _minus_td _conv_td, $(D128PBIT_FUNCS))
  585. endif
  586. endif
  587. ifneq ($(D32PBIT),)
  588. d32pbit-o = $(patsubst %,%$(objext),$(D32PBIT_FUNCS))
  589. ifeq ($(enable_decimal_float),bid)
  590. $(d32pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
  591. else
  592. $(d32pbit-o): %$(objext): $(srcdir)/dfp-bit.c
  593. endif
  594. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=32 -c $<
  595. libgcc-objects += $(d32pbit-o)
  596. endif
  597. ifneq ($(D64PBIT),)
  598. d64pbit-o = $(patsubst %,%$(objext),$(D64PBIT_FUNCS))
  599. ifeq ($(enable_decimal_float),bid)
  600. $(d64pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
  601. else
  602. $(d64pbit-o): %$(objext): $(srcdir)/dfp-bit.c
  603. endif
  604. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=64 -c $<
  605. libgcc-objects += $(d64pbit-o)
  606. endif
  607. ifneq ($(D128PBIT),)
  608. d128pbit-o = $(patsubst %,%$(objext),$(D128PBIT_FUNCS))
  609. ifeq ($(enable_decimal_float),bid)
  610. $(d128pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
  611. else
  612. $(d128pbit-o): %$(objext): $(srcdir)/dfp-bit.c
  613. endif
  614. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=128 -c $<
  615. libgcc-objects += $(d128pbit-o)
  616. endif
  617. endif
  618. ifeq ($(SYNC),yes)
  619. libgcc-sync-size-funcs := $(foreach op, add sub or and xor nand, \
  620. sync_fetch_and_$(op) \
  621. sync_$(op)_and_fetch) \
  622. sync_bool_compare_and_swap \
  623. sync_val_compare_and_swap \
  624. sync_lock_test_and_set
  625. libgcc-sync-size-funcs := $(foreach prefix, $(libgcc-sync-size-funcs), \
  626. $(foreach suffix, 1 2 4 8 16, \
  627. $(prefix)_$(suffix)))
  628. libgcc-sync-size-funcs-o = $(patsubst %,%$(objext),$(libgcc-sync-size-funcs))
  629. $(libgcc-sync-size-funcs-o): %$(objext): $(srcdir)/sync.c
  630. $(gcc_compile) $(SYNC_CFLAGS) \
  631. -DFN=`echo "$*" | sed 's/_[^_]*$$//'` \
  632. -DSIZE=`echo "$*" | sed 's/.*_//'` \
  633. -c $< $(vis_hide)
  634. libgcc-objects += $(libgcc-sync-size-funcs-o)
  635. libgcc-sync-funcs := sync_synchronize
  636. libgcc-sync-funcs-o = $(patsubst %,%$(objext),$(libgcc-sync-funcs))
  637. $(libgcc-sync-funcs-o): %$(objext): $(srcdir)/sync.c
  638. $(gcc_compile) $(SYNC_CFLAGS) \
  639. -DL$* \
  640. -c $< $(vis_hide)
  641. libgcc-objects += $(libgcc-sync-funcs-o)
  642. ifeq ($(enable_shared),yes)
  643. libgcc-sync-size-funcs-s-o = $(patsubst %,%_s$(objext), \
  644. $(libgcc-sync-size-funcs))
  645. $(libgcc-sync-size-funcs-s-o): %_s$(objext): $(srcdir)/sync.c
  646. $(gcc_s_compile) $(SYNC_CFLAGS) \
  647. -DFN=`echo "$*" | sed 's/_[^_]*$$//'` \
  648. -DSIZE=`echo "$*" | sed 's/.*_//'` \
  649. -c $<
  650. libgcc-s-objects += $(libgcc-sync-size-funcs-s-o)
  651. libgcc-sync-funcs-s-o = $(patsubst %,%_s$(objext),$(libgcc-sync-funcs))
  652. $(libgcc-sync-funcs-s-o): %_s$(objext): $(srcdir)/sync.c
  653. $(gcc_s_compile) $(SYNC_CFLAGS) \
  654. -DL$* \
  655. -c $<
  656. libgcc-s-objects += $(libgcc-sync-funcs-s-o)
  657. endif
  658. endif
  659. # Build fixed-point support.
  660. ifeq ($(fixed_point),yes)
  661. # Generate permutations of function name and mode
  662. fixed-labels := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith labels)
  663. fixed-funcs := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith funcs)
  664. fixed-modes := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith modes)
  665. # Generate the rules for each arithmetic function
  666. iter-items := $(fixed-funcs)
  667. iter-labels := $(fixed-labels)
  668. iter-from := $(fixed-modes)
  669. iter-to := $(fixed-modes)
  670. -include $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items))
  671. # Add arithmetic functions to list of objects to be built
  672. libgcc-objects += $(patsubst %,%$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-funcs)))
  673. ifeq ($(enable_shared),yes)
  674. libgcc-s-objects += $(patsubst %,%_s$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-funcs)))
  675. endif
  676. # Convert from or to fractional
  677. fixed-conv-funcs := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv funcs)
  678. fixed-conv-labels := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv labels)
  679. fixed-conv-from := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv from)
  680. fixed-conv-to := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv to)
  681. # Generate the make rules for each conversion function
  682. iter-items := $(fixed-conv-funcs)
  683. iter-labels := $(fixed-conv-labels)
  684. iter-from := $(fixed-conv-from)
  685. iter-to := $(fixed-conv-to)
  686. -include $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items))
  687. # Add conversion functions to list of objects to be built
  688. libgcc-objects += $(patsubst %,%$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-conv-funcs)))
  689. ifeq ($(enable_shared),yes)
  690. libgcc-s-objects += $(patsubst %,%_s$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-conv-funcs)))
  691. endif
  692. endif
  693. # Build LIB2ADD and LIB2ADD_ST.
  694. ifneq ($(filter-out %.c %.S %.asm,$(LIB2ADD) $(LIB2ADD_ST)),)
  695. $(error Unsupported files in LIB2ADD or LIB2ADD_ST.)
  696. endif
  697. libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD))))
  698. libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD_ST))))
  699. c_flags :=
  700. iter-items := $(LIB2ADD) $(LIB2ADD_ST)
  701. -include $(iterator)
  702. ifeq ($(enable_shared),yes)
  703. libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADD))))
  704. endif
  705. # Build LIB2ADDEH, LIB2ADDEHSTATIC, and LIB2ADDEHSHARED. If we don't have
  706. # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
  707. # LIB2ADDEHSHARED matter. (Usually all three are identical.)
  708. c_flags := -fexceptions
  709. ifeq ($(enable_shared),yes)
  710. libgcc-eh-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEHSTATIC))))
  711. libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADDEHSHARED))))
  712. iter-items := $(sort $(LIB2ADDEHSTATIC) $(LIB2ADDEHSHARED))
  713. -include $(iterator)
  714. else
  715. # Not shared. LIB2ADDEH are added to libgcc.a.
  716. libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEH))))
  717. iter-items := $(LIB2ADDEH)
  718. -include $(iterator)
  719. endif
  720. # Build LIBUNWIND. Use -fno-exceptions so that the unwind library does
  721. # not generate calls to __gcc_personality_v0.
  722. c_flags := -fno-exceptions
  723. libunwind-objects += $(addsuffix $(objext),$(basename $(notdir $(LIBUNWIND))))
  724. ifeq ($(enable_shared),yes)
  725. libunwind-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIBUNWIND))))
  726. endif
  727. iter-items := $(LIBUNWIND)
  728. -include $(iterator)
  729. # Build libgcov components.
  730. LIBGCOV_MERGE = _gcov_merge_add _gcov_merge_topn \
  731. _gcov_merge_ior _gcov_merge_time_profile
  732. LIBGCOV_PROFILER = _gcov_interval_profiler \
  733. _gcov_interval_profiler_atomic \
  734. _gcov_pow2_profiler \
  735. _gcov_pow2_profiler_atomic \
  736. _gcov_topn_values_profiler \
  737. _gcov_topn_values_profiler_atomic \
  738. _gcov_average_profiler \
  739. _gcov_average_profiler_atomic \
  740. _gcov_ior_profiler \
  741. _gcov_ior_profiler_atomic \
  742. _gcov_indirect_call_profiler_v4 \
  743. _gcov_time_profiler
  744. LIBGCOV_INTERFACE = _gcov_dump _gcov_fork \
  745. _gcov_execl _gcov_execlp \
  746. _gcov_execle _gcov_execv _gcov_execvp _gcov_execve _gcov_reset \
  747. _gcov_lock_unlock
  748. LIBGCOV_DRIVER = _gcov _gcov_info_to_gcda
  749. libgcov-merge-objects = $(patsubst %,%$(objext),$(LIBGCOV_MERGE))
  750. libgcov-profiler-objects = $(patsubst %,%$(objext),$(LIBGCOV_PROFILER))
  751. libgcov-interface-objects = $(patsubst %,%$(objext),$(LIBGCOV_INTERFACE))
  752. libgcov-driver-objects = $(patsubst %,%$(objext),$(LIBGCOV_DRIVER))
  753. libgcov-objects = $(libgcov-merge-objects) $(libgcov-profiler-objects) \
  754. $(libgcov-interface-objects) $(libgcov-driver-objects)
  755. $(libgcov-merge-objects): %$(objext): $(srcdir)/libgcov-merge.c $(srcdir)/gcov.h $(srcdir)/libgcov.h
  756. $(gcc_compile) -DL$* -c $(srcdir)/libgcov-merge.c
  757. $(libgcov-profiler-objects): %$(objext): $(srcdir)/libgcov-profiler.c $(srcdir)/gcov.h $(srcdir)/libgcov.h
  758. $(gcc_compile) -DL$* -c $(srcdir)/libgcov-profiler.c
  759. $(libgcov-interface-objects): %$(objext): $(srcdir)/libgcov-interface.c $(srcdir)/gcov.h $(srcdir)/libgcov.h
  760. $(gcc_compile) -DL$* -c $(srcdir)/libgcov-interface.c
  761. $(libgcov-driver-objects): %$(objext): $(srcdir)/libgcov-driver.c \
  762. $(srcdir)/libgcov-driver-system.c $(srcdir)/gcov.h $(srcdir)/libgcov.h
  763. $(gcc_compile) -DL$* -c $(srcdir)/libgcov-driver.c
  764. # Static libraries.
  765. libgcc.a: $(libgcc-objects)
  766. libgcov.a: $(libgcov-objects)
  767. libunwind.a: $(libunwind-objects)
  768. libgcc_eh.a: $(libgcc-eh-objects)
  769. libgcc.a libgcov.a libunwind.a libgcc_eh.a:
  770. -rm -f $@
  771. objects="$(objects)"; \
  772. if test -z "$$objects"; then \
  773. echo 'int __libgcc_eh_dummy;' > eh_dummy.c; \
  774. $(gcc_compile_bare) $(vis_hide) -c eh_dummy.c \
  775. -o eh_dummy$(objext); \
  776. objects=eh_dummy$(objext); \
  777. fi; \
  778. $(AR_CREATE_FOR_TARGET) $@ $$objects
  779. $(RANLIB) $@
  780. all: libgcc.a
  781. ifeq ($(enable_gcov),yes)
  782. all: libgcov.a
  783. endif
  784. ifneq ($(LIBUNWIND),)
  785. all: libunwind.a
  786. endif
  787. ifeq ($(enable_shared),yes)
  788. all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
  789. ifneq ($(LIBUNWIND),)
  790. all: libunwind$(SHLIB_EXT)
  791. libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
  792. endif
  793. # Map-file generation.
  794. ifneq ($(SHLIB_MKMAP),)
  795. libgcc.map.in: $(SHLIB_MAPFILES)
  796. { cat $(SHLIB_MAPFILES) \
  797. | sed -e '/^[ ]*#/d' \
  798. -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \
  799. | $(gcc_compile_bare) -E -xassembler-with-cpp -; \
  800. } > tmp-$@
  801. mv tmp-$@ $@
  802. libgcc.map: $(SHLIB_MKMAP) libgcc.map.in $(libgcc-s-objects)
  803. { $(NM) $(SHLIB_NM_FLAGS) $(libgcc-s-objects); echo %%; \
  804. cat libgcc.map.in; \
  805. } | $(AWK) -f $(SHLIB_MKMAP) $(SHLIB_MKMAP_OPTS) > tmp-$@
  806. mv tmp-$@ $@
  807. libgcc_s$(SHLIB_EXT): libgcc.map
  808. mapfile = libgcc.map
  809. endif
  810. libgcc-std.ver: $(srcdir)/libgcc-std.ver.in
  811. sed -e 's/__PFX__/$(LIBGCC_VER_GNU_PREFIX)/g' \
  812. -e 's/__FIXPTPFX__/$(LIBGCC_VER_FIXEDPOINT_GNU_PREFIX)/g' < $< > $@
  813. libgcc_s$(SHLIB_EXT): $(libgcc-s-objects) $(extra-parts) libgcc.a
  814. # @multilib_flags@ is still needed because this may use
  815. # $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly.
  816. # @multilib_dir@ is not really necessary, but sometimes it has
  817. # more uses than just a directory name.
  818. $(mkinstalldirs) $(MULTIDIR)
  819. $(subst @multilib_flags@,$(CFLAGS) -B./,$(subst \
  820. @multilib_dir@,$(MULTIDIR),$(subst \
  821. @shlib_objs@,$(objects) libgcc.a,$(subst \
  822. @shlib_base_name@,libgcc_s,$(subst \
  823. @shlib_map_file@,$(mapfile),$(subst \
  824. @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
  825. @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
  826. libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
  827. # @multilib_flags@ is still needed because this may use
  828. # $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly.
  829. # @multilib_dir@ is not really necessary, but sometimes it has
  830. # more uses than just a directory name.
  831. $(mkinstalldirs) $(MULTIDIR)
  832. $(subst @multilib_flags@,$(CFLAGS) -B./,$(subst \
  833. @multilib_dir@,$(MULTIDIR),$(subst \
  834. @shlib_objs@,$(objects),$(subst \
  835. @shlib_base_name@,libunwind,$(subst \
  836. @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIBUNWIND_LINK))))))
  837. endif
  838. # Build the standard GCC startfiles and endfiles.
  839. ALL_CRT_CFLAGS = $(CFLAGS) $(CRTSTUFF_CFLAGS) $(INCLUDES)
  840. crt_compile = $(CC) $(ALL_CRT_CFLAGS) -o $@ $(compile_deps)
  841. ifeq ($(CUSTOM_CRTSTUFF),)
  842. # Compile two additional files that are linked with every program
  843. # linked using GCC on systems using COFF or ELF, for the sake of C++
  844. # constructors.
  845. crtbegin$(objext): $(srcdir)/crtstuff.c
  846. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN
  847. crtend$(objext): $(srcdir)/crtstuff.c
  848. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_END
  849. # These are versions of crtbegin and crtend for shared libraries.
  850. crtbeginS$(objext): $(srcdir)/crtstuff.c
  851. $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $< -DCRT_BEGIN -DCRTSTUFFS_O
  852. crtendS$(objext): $(srcdir)/crtstuff.c
  853. $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $< -DCRT_END -DCRTSTUFFS_O
  854. # This is a version of crtbegin for -static links.
  855. crtbeginT$(objext): $(srcdir)/crtstuff.c
  856. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN -DCRTSTUFFT_O
  857. # crtoffloadbegin and crtoffloadend contain symbols, that mark the begin and
  858. # the end of tables with addresses, required for offloading. crtoffloadtable
  859. # contains the array with addresses of those symbols.
  860. crtoffloadbegin$(objext): $(srcdir)/offloadstuff.c
  861. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN
  862. crtoffloadend$(objext): $(srcdir)/offloadstuff.c
  863. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_END
  864. crtoffloadtable$(objext): $(srcdir)/offloadstuff.c
  865. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_TABLE
  866. endif
  867. ifeq ($(enable_vtable_verify),yes)
  868. # These are used in vtable verification; see comments in source files for
  869. # more details.
  870. # Override -finhibit-size-directive to avoid mismatch between libgcc and libvtv
  871. # compilations.
  872. VTV_CFLAGS = $(CRTSTUFF_T_CFLAGS_S) -fno-inhibit-size-directive
  873. vtv_start$(objext): $(srcdir)/vtv_start.c
  874. $(crt_compile) $(VTV_CFLAGS) -c $(srcdir)/vtv_start.c
  875. vtv_end$(objext): $(srcdir)/vtv_end.c
  876. $(crt_compile) $(VTV_CFLAGS) -c $(srcdir)/vtv_end.c
  877. vtv_start_preinit$(objext): $(srcdir)/vtv_start_preinit.c
  878. $(crt_compile) $(VTV_CFLAGS) -c $(srcdir)/vtv_start_preinit.c
  879. vtv_end_preinit$(objext): $(srcdir)/vtv_end_preinit.c
  880. $(crt_compile) $(VTV_CFLAGS) -c $(srcdir)/vtv_end_preinit.c
  881. endif
  882. ifeq ($(CUSTOM_CRTIN),)
  883. # -x assembler-with-cpp is only needed on case-insensitive filesystem.
  884. crti$(objext): $(srcdir)/config/$(cpu_type)/crti.S
  885. $(crt_compile) -c -x assembler-with-cpp $<
  886. crtn$(objext): $(srcdir)/config/$(cpu_type)/crtn.S
  887. $(crt_compile) -c -x assembler-with-cpp $<
  888. endif
  889. # Build extra startfiles in the libgcc directory.
  890. .PHONY: libgcc-extra-parts
  891. libgcc-extra-parts: $(EXTRA_PARTS)
  892. # Early copyback; see "all" above for the rationale. The
  893. # early copy is necessary so that the gcc -B options find
  894. # the right startup files when linking shared libgcc.
  895. $(mkinstalldirs) $(gcc_objdir)$(MULTISUBDIR)
  896. parts="$(EXTRA_PARTS)"; \
  897. for file in $$parts; do \
  898. rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file; \
  899. $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/; \
  900. case $$file in \
  901. *.a) \
  902. $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;; \
  903. esac; \
  904. done
  905. all: $(extra-parts)
  906. $(libgcc-objects) $(libgcc-s-objects) $(libgcc-eh-objects) \
  907. $(libgcov-objects) \
  908. $(libunwind-objects) $(libunwind-s-objects) \
  909. $(EXTRA_PARTS): $(LIBGCC_LINKS) libgcc_tm.h
  910. # Copy unwind.h to the place where gcc will look for it at build-time
  911. install-unwind_h-forbuild: unwind.h
  912. dest=$(gcc_objdir)/include/tmp$$$$-unwind.h; \
  913. cp unwind.h $$dest; \
  914. chmod a+r $$dest; \
  915. sh $(srcdir)/../move-if-change $$dest $(gcc_objdir)/include/unwind.h
  916. # Copy unwind.h to the place where gcc will look at run-time, once installed
  917. #
  918. # This is redundant with the internal copy above when using a regular toplevel
  919. # "install" target, because gcc's install will copy to the destination as well.
  920. #
  921. # This is however useful for "install-no-fixincludes" case, when only the gcc
  922. # internal headers are copied by gcc's install.
  923. install-unwind_h:
  924. $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
  925. $(INSTALL_DATA) unwind.h $(DESTDIR)$(libsubdir)/include
  926. all: install-unwind_h-forbuild
  927. install-gcov_h:
  928. $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
  929. $(INSTALL_DATA) $(srcdir)/gcov.h $(DESTDIR)$(libsubdir)/include
  930. # Documentation targets (empty).
  931. .PHONY: info html dvi pdf install-info install-html install-pdf
  932. info:
  933. install-info:
  934. html:
  935. install-html:
  936. dvi:
  937. pdf:
  938. install-pdf:
  939. # Install rules. These do not depend on "all", so that they can be invoked
  940. # recursively from it.
  941. install-libunwind:
  942. $(mkinstalldirs) $(DESTDIR)$(inst_slibdir)
  943. # NOTE: Maybe this should go into $(inst_libdir), but this
  944. # is where the old mklibgcc.in put it.
  945. $(INSTALL_DATA) libunwind.a $(DESTDIR)$(inst_slibdir)/
  946. chmod 644 $(DESTDIR)$(inst_slibdir)/libunwind.a
  947. $(RANLIB) $(DESTDIR)$(inst_slibdir)/libunwind.a
  948. $(subst @multilib_dir@,$(MULTIDIR),$(subst \
  949. @shlib_base_name@,libunwind,$(subst \
  950. @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIBUNWIND_INSTALL))))
  951. install-shared:
  952. $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
  953. $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
  954. chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
  955. $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
  956. $(subst @multilib_dir@,$(MULTIDIR),$(subst \
  957. @shlib_base_name@,libgcc_s,$(subst \
  958. @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
  959. install-leaf: $(install-shared) $(install-libunwind)
  960. $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
  961. $(INSTALL_DATA) libgcc.a $(DESTDIR)$(inst_libdir)/
  962. chmod 644 $(DESTDIR)$(inst_libdir)/libgcc.a
  963. $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc.a
  964. ifeq ($(enable_gcov),yes)
  965. $(INSTALL_DATA) libgcov.a $(DESTDIR)$(inst_libdir)/
  966. chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
  967. $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
  968. endif
  969. parts="$(INSTALL_PARTS)"; \
  970. for file in $$parts; do \
  971. rm -f $(DESTDIR)$(inst_libdir)/$$file; \
  972. $(INSTALL_DATA) $$file $(DESTDIR)$(inst_libdir)/; \
  973. case $$file in \
  974. *.a) \
  975. $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;; \
  976. esac; \
  977. done
  978. install: install-leaf install-unwind_h install-gcov_h
  979. @: $(MAKE) ; $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
  980. install-strip: install
  981. .PHONY: install install-shared install-libunwind install-strip
  982. .PHONY: install-unwind_h install-unwind_h-forbuild
  983. .PHONY: install-gcov_h
  984. # Don't export variables to the environment, in order to not confuse
  985. # configure.
  986. .NOEXPORT:
  987. -include $(wildcard *.dep)