xref: /aosp_15_r20/external/compiler-rt/make/lib_info.mk (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot# compiler-rt Library Info
2*7c3d14c8STreehugger Robot#
3*7c3d14c8STreehugger Robot# This should be included once the subdirectory information has been loaded, and
4*7c3d14c8STreehugger Robot# uses the utilities in 'util.mk'.
5*7c3d14c8STreehugger Robot#
6*7c3d14c8STreehugger Robot# This defines the following variables describing compiler-rt:
7*7c3d14c8STreehugger Robot#   AvailableFunctions   - The entire list of function names (unmangled) the
8*7c3d14c8STreehugger Robot#                          library can provide.
9*7c3d14c8STreehugger Robot#   CommonFunctions      - The list of generic functions available.
10*7c3d14c8STreehugger Robot#   ArchFunctions.<arch> - The list of functions commonly available for
11*7c3d14c8STreehugger Robot#                          'arch'. This does not include any config specific
12*7c3d14c8STreehugger Robot#                          functions.
13*7c3d14c8STreehugger Robot#
14*7c3d14c8STreehugger Robot#   AvailableIn.<function> - The list of subdir keys where 'function' is
15*7c3d14c8STreehugger Robot#                            defined.
16*7c3d14c8STreehugger Robot
17*7c3d14c8STreehugger Robot# Determine the set of available modules.
18*7c3d14c8STreehugger RobotAvailableModules := $(sort $(foreach key,$(SubDirKeys),\
19*7c3d14c8STreehugger Robot	$($(key).ModuleName)))
20*7c3d14c8STreehugger Robot
21*7c3d14c8STreehugger Robot# Build a per-module map of subdir keys.
22*7c3d14c8STreehugger Robot$(foreach key,$(SubDirKeys),\
23*7c3d14c8STreehugger Robot	$(call Append,ModuleSubDirKeys.$($(key).ModuleName),$(key)))
24*7c3d14c8STreehugger Robot
25*7c3d14c8STreehugger RobotAvailableArchs := $(sort $(foreach key,$(SubDirKeys),\
26*7c3d14c8STreehugger Robot	$($(key).OnlyArchs)))
27*7c3d14c8STreehugger Robot
28*7c3d14c8STreehugger RobotAvailableFunctions := $(sort $(foreach key,$(SubDirKeys),\
29*7c3d14c8STreehugger Robot	$(basename $($(key).ObjNames))))
30*7c3d14c8STreehugger Robot
31*7c3d14c8STreehugger RobotCommonFunctions := $(sort\
32*7c3d14c8STreehugger Robot  $(foreach key,$(ModuleSubDirKeys.builtins),\
33*7c3d14c8STreehugger Robot    $(if $(call strneq,,$(strip $($(key).OnlyArchs) $($(key).OnlyConfigs))),,\
34*7c3d14c8STreehugger Robot         $(basename $($(key).ObjNames)))))
35*7c3d14c8STreehugger Robot
36*7c3d14c8STreehugger Robot# Compute common arch functions.
37*7c3d14c8STreehugger Robot$(foreach key,$(ModuleSubDirKeys.builtins),\
38*7c3d14c8STreehugger Robot  $(if $(call strneq,,$($(key).OnlyConfigs)),,\
39*7c3d14c8STreehugger Robot    $(foreach arch,$($(key).OnlyArchs),\
40*7c3d14c8STreehugger Robot      $(call Append,ArchFunctions.$(arch),$(sort \
41*7c3d14c8STreehugger Robot        $(basename $($(key).ObjNames)))))))
42*7c3d14c8STreehugger Robot
43*7c3d14c8STreehugger Robot# Compute arch only functions.
44*7c3d14c8STreehugger Robot$(foreach arch,$(AvailableArchs),\
45*7c3d14c8STreehugger Robot  $(call Set,ArchFunctions.$(arch),$(sort $(ArchFunctions.$(arch))))\
46*7c3d14c8STreehugger Robot  $(call Set,ArchOnlyFunctions.$(arch),\
47*7c3d14c8STreehugger Robot    $(call set_difference,$(ArchFunctions.$(arch)),$(CommonFunctions))))
48*7c3d14c8STreehugger Robot
49*7c3d14c8STreehugger Robot# Compute lists of where each function is available.
50*7c3d14c8STreehugger Robot$(foreach key,$(SubDirKeys),\
51*7c3d14c8STreehugger Robot  $(foreach fn,$(basename $($(key).ObjNames)),\
52*7c3d14c8STreehugger Robot    $(call Append,AvailableIn.$(fn),$(key))))
53*7c3d14c8STreehugger Robot
54*7c3d14c8STreehugger Robot# The names of all the available options.
55*7c3d14c8STreehugger RobotAvailableOptions := AR ARFLAGS \
56*7c3d14c8STreehugger Robot                    CC CFLAGS LDFLAGS FUNCTIONS OPTIMIZED \
57*7c3d14c8STreehugger Robot                    RANLIB RANLIBFLAGS \
58*7c3d14c8STreehugger Robot                    VISIBILITY_HIDDEN KERNEL_USE \
59*7c3d14c8STreehugger Robot                    SHARED_LIBRARY SHARED_LIBRARY_SUFFIX STRIP LIPO DSYMUTIL
60