Skip to content

Commit

Permalink
Use llvm_tools instead of binutils
Browse files Browse the repository at this point in the history
commit_hash:98d2b568a63569d1859bb67f533ce37ea1b77eae
  • Loading branch information
4JustMe4 committed Feb 13, 2025
1 parent ec2db55 commit a310ab2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
2 changes: 2 additions & 0 deletions build/ya.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@
"cxx_compiler": "$(CLANG)/bin/clang++",
"llvm-symbolizer": "$(CLANG)/bin/llvm-symbolizer",
"match_root": "CLANG",
"nm": "$(CLANG)/bin/llvm-nm",
"objcopy": "$(CLANG)/bin/llvm-objcopy",
"profiles": "$(XCODE_TOOLS_ROOT-sbr:799017771)/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles",
"simctl": "$(XCODE_TOOLS_ROOT-sbr:799017771)/Xcode/SystemRoot/PrivateFrameworks/CoreSimulator.framework/Resources/bin/simctl",
Expand Down Expand Up @@ -1229,6 +1230,7 @@
"cxx_compiler": "$(CLANG)/bin/clang++",
"llvm-symbolizer": "$(CLANG)/bin/llvm-symbolizer",
"match_root": "CLANG",
"nm": "$(CLANG)/bin/llvm-nm",
"objcopy": "$(CLANG)/bin/llvm-objcopy",
"profiles": "$(XCODE_TOOLS_ROOT-sbr:799017771)/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles",
"simctl": "$(XCODE_TOOLS_ROOT-sbr:799017771)/Xcode/SystemRoot/PrivateFrameworks/CoreSimulator.framework/Resources/bin/simctl",
Expand Down
27 changes: 16 additions & 11 deletions build/ymake.core.conf
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,9 @@ module _BASE_UNIT: _BARE_UNIT {
DEFAULT(SWIG_LANG python)
DEFAULT(GP_FLAGS -CtTLANSI-C -Dk* -c)

when ($NEED_BINUTILS_PEERDIR && $BINUTILS_USED && $NEED_PLATFORM_PEERDIRS == "yes") {
PEERDIR+=build/platform/binutils
when ($NEED_LLVM_TOOLS_PEERDIR && $NEED_PLATFORM_PEERDIRS == "yes") {
PEERDIR+=build/platform/clang
LLVM_TOOLS_ROOT=$CLANG18_RESOURCE_GLOBAL
}

when ($TIDY_ENABLED == "yes") {
Expand Down Expand Up @@ -2536,20 +2537,25 @@ when ($BT_MINSIZEREL == "yes" || $LINKER_ICF == "yes") {
OBJCOPY_TOOL=$OBJCOPY_TOOL_VENDOR
OBJDUMP_TOOL=$OBJDUMP_TOOL_VENDOR
STRIP_TOOL=$STRIP_TOOL_VENDOR
NEED_BINUTILS_PEERDIR=
BINUTILS_USED=
NM_TOOL=$NM_TOOL_VENDOR
NEED_LLVM_TOOLS_PEERDIR=
LLVM_TOOLS_ROOT=

when (!$OBJCOPY_TOOL_VENDOR) {
OBJCOPY_TOOL=$BINUTILS_ROOT_RESOURCE_GLOBAL/bin/objcopy
NEED_BINUTILS_PEERDIR=yes
OBJCOPY_TOOL=${LLVM_TOOLS_ROOT}/bin/llvm-objcopy
NEED_LLVM_TOOLS_PEERDIR=yes
}
when (!$OBJDUMP_TOOL_VENDOR) {
OBJDUMP_TOOL=$BINUTILS_ROOT_RESOURCE_GLOBAL/bin/objdump
NEED_BINUTILS_PEERDIR=yes
OBJDUMP_TOOL=${LLVM_TOOLS_ROOT}/bin/llvm-objdump
NEED_LLVM_TOOLS_PEERDIR=yes
}
when (!$STRIP_TOOL_VENDOR) {
STRIP_TOOL=$BINUTILS_ROOT_RESOURCE_GLOBAL/bin/strip
NEED_BINUTILS_PEERDIR=yes
STRIP_TOOL=${LLVM_TOOLS_ROOT}/bin/llvm-strip
NEED_LLVM_TOOLS_PEERDIR=yes
}
when (!$NM_TOOL_VENDOR) {
NM_TOOL=${LLVM_TOOLS_ROOT}/bin/llvm-nm
NEED_LLVM_TOOLS_PEERDIR=yes
}

SPLIT_DWARF_VALUE=no
Expand Down Expand Up @@ -2586,7 +2592,6 @@ when ($SPLIT_DWARF_VALUE == "yes" && $NO_SPLIT_DWARF != "yes" && $NO_DEBUGINFO !
$OBJCOPY_TOOL --only-keep-debug $TARGET $SPLIT_DWARF_OUTPUT && \
$STRIP_TOOL --strip-debug $TARGET && \
$OBJCOPY_TOOL --remove-section=.gnu_debuglink --add-gnu-debuglink $SPLIT_DWARF_OUTPUT $TARGET
BINUTILS_USED=yes
}

### @usage: EXTRALIBS_STATIC(Libs...)
Expand Down
3 changes: 3 additions & 0 deletions build/ymake_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,7 @@ def __init__(self, build, detector):
self.objcopy = self.params.get('objcopy')
self.objdump = self.params.get('objdump')
self.isystem = self.params.get('isystem')
self.nm = self.params.get('nm')

self.dwarf_tool = self.target.find_in_dict(self.params.get('dwarf_tool'))

Expand Down Expand Up @@ -1665,6 +1666,7 @@ def __init__(self, tc, build):
self.strip = self.tc.strip
self.objcopy = self.tc.objcopy
self.objdump = self.tc.objdump
self.nm = self.tc.nm

self.musl = Setting('MUSL', convert=to_bool)

Expand Down Expand Up @@ -1728,6 +1730,7 @@ def print_linker(self):
emit('STRIP_TOOL_VENDOR', self.strip)
emit('OBJCOPY_TOOL_VENDOR', self.objcopy)
emit('OBJDUMP_TOOL_VENDOR', self.objdump)
emit('NM_TOOL_VENDOR', self.nm)

emit('_LD_FLAGS', self.ld_flags)
emit('LD_SDK_VERSION', self.ld_sdk)
Expand Down

0 comments on commit a310ab2

Please sign in to comment.