@@ -9,7 +9,7 @@ OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-
9
9
darwin_native_binutils =native_cctools
10
10
11
11
ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG ) ) ,)
12
- # FORCE_USE_SYSTEM_CLANG is empty, so we use our depends-managed, pinned clang
12
+ # FORCE_USE_SYSTEM_CLANG is empty, so we use our depends-managed, pinned LLVM
13
13
# from llvm.org
14
14
15
15
# Clang is a dependency of native_cctools when FORCE_USE_SYSTEM_CLANG is empty
@@ -19,7 +19,18 @@ clang_prog=$(build_prefix)/bin/clang
19
19
clangxx_prog =$(clang_prog ) ++
20
20
llvm_config_prog =$(build_prefix ) /bin/llvm-config
21
21
22
- darwin_OBJDUMP =$(build_prefix ) /bin/$(host ) -objdump
22
+ llvm_TOOLS =AR NM OBJDUMP RANLIB STRIP
23
+
24
+ # Make-only lowercase function
25
+ lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )
26
+
27
+ # For well-known tools provided by LLVM, make sure that their well-known
28
+ # variable is set to the full path of the tool, just like how AC_PATH_{TOO,PROG}
29
+ # would.
30
+ $(foreach TOOL,$(llvm_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/llvm-$(call lc,$(TOOL))))
31
+
32
+ # Clang expects dsymutil to be called dsymutil
33
+ darwin_DSYMUTIL =$(build_prefix ) /bin/dsymutil
23
34
24
35
else
25
36
# FORCE_USE_SYSTEM_CLANG is non-empty, so we use the clang from the user's
@@ -40,19 +51,14 @@ llvm_config_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-config")
40
51
41
52
llvm_lib_dir =$(shell $(llvm_config_prog ) --libdir)
42
53
54
+ darwin_AR =$(shell $(SHELL ) $(.SHELLFLAGS ) "command -v llvm-ar")
55
+ darwin_DSYMUTIL =$(shell $(SHELL ) $(.SHELLFLAGS ) "command -v dsymutil")
56
+ darwin_NM =$(shell $(SHELL ) $(.SHELLFLAGS ) "command -v llvm-nm")
43
57
darwin_OBJDUMP =$(shell $(SHELL ) $(.SHELLFLAGS ) "command -v llvm-objdump")
58
+ darwin_RANLIB =$(shell $(SHELL ) $(.SHELLFLAGS ) "command -v llvm-ranlib")
59
+ darwin_STRIP =$(shell $(SHELL ) $(.SHELLFLAGS ) "command -v llvm-strip")
44
60
endif
45
61
46
- cctools_TOOLS =AR RANLIB STRIP NM DSYMUTIL
47
-
48
- # Make-only lowercase function
49
- lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )
50
-
51
- # For well-known tools provided by cctools, make sure that their well-known
52
- # variable is set to the full path of the tool, just like how AC_PATH_{TOO,PROG}
53
- # would.
54
- $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(host)-$(call lc,$(TOOL))))
55
-
56
62
# Flag explanations:
57
63
#
58
64
# -mlinker-version
@@ -79,6 +85,11 @@ $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(
79
85
#
80
86
# Indicate to the linker the platform, the oldest supported version,
81
87
# and the SDK used.
88
+ #
89
+ # -no_adhoc_codesign
90
+ #
91
+ # Disable adhoc codesigning (for now) when using LLVM tooling, to avoid
92
+ # non-determinism issues with the Identifier field.
82
93
83
94
darwin_CC =env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
84
95
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
@@ -104,6 +115,7 @@ darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION)
104
115
ifneq ($(build_os ) ,darwin)
105
116
darwin_CFLAGS += -mlinker-version=$(LD64_VERSION )
106
117
darwin_CXXFLAGS += -mlinker-version=$(LD64_VERSION )
118
+ darwin_LDFLAGS += -Wl,-no_adhoc_codesign
107
119
endif
108
120
109
121
darwin_release_CFLAGS =-O2
0 commit comments