aboutsummaryrefslogtreecommitdiff
path: root/make/lib_info.mk
blob: 31850f78f981557c691623e7d04e007586aaba49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# compiler-rt Library Info
#
# This should be included once the subdirectory information has been loaded, and
# uses the utilities in 'util.mk'.
#
# This defines the following variables describing compiler-rt:
#   AvailableFunctions   - The entire list of function names (unmangled) the
#                          library can provide.
#   CommonFunctions      - The list of generic functions available.
#   ArchFunctions.<arch> - The list of functions commonly available for
#                          'arch'. This does not include any config specific
#                          functions.
#
#   AvailableIn.<function> - The list of subdir keys where 'function' is
#                            defined.

# Determine the set of available modules.
AvailableModules := $(sort $(foreach key,$(SubDirKeys),\
	$($(key).ModuleName)))

# Build a per-module map of subdir keys.
$(foreach key,$(SubDirKeys),\
	$(call Append,ModuleSubDirKeys.$($(key).ModuleName),$(key)))

AvailableArchs := $(sort $(foreach key,$(SubDirKeys),\
	$($(key).OnlyArchs)))

AvailableFunctions := $(sort $(foreach key,$(SubDirKeys),\
	$(basename $($(key).ObjNames))))

CommonFunctions := $(sort\
  $(foreach key,$(ModuleSubDirKeys.builtins),\
    $(if $(call strneq,,$(strip $($(key).OnlyArchs) $($(key).OnlyConfigs))),,\
         $(basename $($(key).ObjNames)))))

# Compute common arch functions.
$(foreach key,$(ModuleSubDirKeys.builtins),\
  $(if $(call strneq,,$($(key).OnlyConfigs)),,\
    $(foreach arch,$($(key).OnlyArchs),\
      $(call Append,ArchFunctions.$(arch),$(sort \
        $(basename $($(key).ObjNames)))))))

# Compute arch only functions.
$(foreach arch,$(AvailableArchs),\
  $(call Set,ArchFunctions.$(arch),$(sort $(ArchFunctions.$(arch))))\
  $(call Set,ArchOnlyFunctions.$(arch),\
    $(call set_difference,$(ArchFunctions.$(arch)),$(CommonFunctions))))

# Compute lists of where each function is available.
$(foreach key,$(SubDirKeys),\
  $(foreach fn,$(basename $($(key).ObjNames)),\
    $(call Append,AvailableIn.$(fn),$(key))))

# The names of all the available options.
AvailableOptions := AR ARFLAGS \
                    CC CFLAGS LDFLAGS FUNCTIONS OPTIMIZED \
                    RANLIB RANLIBFLAGS \
                    VISIBILITY_HIDDEN KERNEL_USE \
                    SHARED_LIBRARY SHARED_LIBRARY_SUFFIX STRIP LIPO DSYMUTIL