blob: 11063e6d2503f18f4e24d67a8f4ee2f7fb9143a2 [file] [log] [blame]
Ying Wang6feb6d52014-04-17 10:03:35 -07001#
2# Copyright (C) 2006 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Peter Collingbournefc478d22023-08-04 14:57:31 -070017# Configuration for Darwin (Mac OS X).
Ying Wang6feb6d52014-04-17 10:03:35 -070018# Included by combo/select.mk
19
Shinichiro Hamaji0e7587a2015-10-09 14:36:04 +090020define $(combo_var_prefix)transform-shared-lib-to-toc
21$(call _gen_toc_command_for_macho,$(1),$(2))
22endef
23
Ying Wang6feb6d52014-04-17 10:03:35 -070024HOST_GLOBAL_ARFLAGS := cqs
25
Dan Willemsen1d090fc2018-08-28 01:51:25 -070026HOST_CUSTOM_LD_COMMAND := true
27
28define transform-host-o-to-shared-lib-inner
29$(hide) $(PRIVATE_CXX) \
30 -dynamiclib -single_module -read_only_relocs suppress \
31 $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
32 $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
33 ) \
34 $(PRIVATE_ALL_OBJECTS) \
35 $(addprefix -force_load , $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
36 $(PRIVATE_ALL_SHARED_LIBRARIES) \
37 $(PRIVATE_ALL_STATIC_LIBRARIES) \
38 $(PRIVATE_LDLIBS) \
39 -o $@ \
40 -install_name @rpath/$(notdir $@) \
41 -Wl,-rpath,@loader_path/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
42 -Wl,-rpath,@loader_path/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
43 $(PRIVATE_LDFLAGS)
44endef
45
46define transform-host-o-to-executable-inner
47$(hide) $(PRIVATE_CXX) \
48 $(foreach path,$(PRIVATE_RPATHS), \
49 -Wl,-rpath,@loader_path/$(path)) \
50 -o $@ \
51 -Wl,-headerpad_max_install_names \
52 $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
53 $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
54 ) \
55 $(PRIVATE_ALL_SHARED_LIBRARIES) \
56 $(PRIVATE_ALL_OBJECTS) \
57 $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
58 $(PRIVATE_ALL_STATIC_LIBRARIES) \
59 $(PRIVATE_LDFLAGS) \
60 $(PRIVATE_LDLIBS)
61endef