Skip to content

Commit

Permalink
[BugFix] Fix BFD initialization error on aarch64 (#54372)
Browse files Browse the repository at this point in the history
## Why I'm doing:
BFD initialization error on aarch64:
```
[root@starrocks be]# uname -a
Linux starrocks 4.19.90-2107.6.0.0192.8.oe1.bclinux.aarch64 #1 SMP Tue Mar 21 09:23:05 CST 2023 aarch64 aarch64 aarch64 GNU/Linux
[root@starrocks be]# ./bin/start_be.sh --daemon
[root@starrocks be]# tail log/be.WARNING
E20241217 09:49:19.948438 70369568784448 bfd_parser.cpp:107] set default target to elf64-x86-64 failed.
[root@starrocks be]#
```
## What I'm doing:

Fix BFD initialization error on aarch64.

Signed-off-by: qingzhongli <[email protected]>
(cherry picked from commit 699b630)
  • Loading branch information
qingzhongli authored and mergify[bot] committed Dec 27, 2024
1 parent b466728 commit 1c82f97
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions be/src/util/bfd_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,17 @@ void BfdParser::init_bfd() {
}
std::lock_guard<std::mutex> lock(_bfd_mutex);
bfd_init();
#if defined(__x86_64__)
if (!bfd_set_default_target("elf64-x86-64")) {
LOG(ERROR) << "set default target to elf64-x86-64 failed.";
}
#elif defined(__aarch64__)
if (!bfd_set_default_target("elf64-littleaarch64")) {
LOG(ERROR) << "set default target to elf64-littleaarch64 failed.";
}
#else
#error "Not supported architecture"
#endif
_is_bfd_inited = true;
}

Expand Down

0 comments on commit 1c82f97

Please sign in to comment.