Skip to content

Commit f93c0e1

Browse files
committed
Add ARM and ARM64 GCC drivers to OpenBSD host tools
Fixes a linker error when cross-compiling GCC to OpenBSD: ld: error: undefined symbol: host_detect_local_cpu(int, char const**) >>> referenced by gcc.cc >>> gcc.o:(static_spec_functions) collect2: error: ld returned 1 exit status make[2]: *** [Makefile:2336: xgcc] Error 1
1 parent a191501 commit f93c0e1

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ if ! [ -f "${gcc_tarball}" ]; then
302302
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/patches/0001-Turn-Wint-conversion-back-into-an-warning.patch"
303303
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/patches/0001-Fix-libgcc-build-on-arm.patch"
304304
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/patches/0001-Add-relative-RPATHs-to-GCC-host-tools.patch"
305+
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/patches/0001-Add-ARM-and-ARM64-drivers-to-OpenBSD-host-tools.patch"
305306

306307
if [[ "${CROSS_COMPILE_TRIPLET}" == *'-openbsd'* ]]; then
307308
patch --directory="${gcc_directory}" --strip='1' --input="${workdir}/patches/0001-Fix-missing-stdint.h-include-when-compiling-host-tools-on-OpenBSD.patch"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
From a289af598ca58a5b7a61aea87a112f23dc66d984 Mon Sep 17 00:00:00 2001
2+
From: Kartatz <105828205+Kartatz@users.noreply.github.com>
3+
Date: Fri, 11 Jul 2025 15:54:18 -0300
4+
Subject: [PATCH] Add ARM and ARM64 drivers to OpenBSD host tools
5+
6+
---
7+
gcc/config.host | 4 ++--
8+
1 file changed, 2 insertions(+), 2 deletions(-)
9+
10+
diff --git a/gcc/config.host b/gcc/config.host
11+
index 4c1a5e991..362ed53da 100644
12+
--- a/gcc/config.host
13+
+++ b/gcc/config.host
14+
@@ -100,7 +100,7 @@ esac
15+
16+
case ${host} in
17+
aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia* |\
18+
- aarch64*-*-darwin*)
19+
+ aarch64*-*-darwin* | aarch64*-*-openbsd*)
20+
case ${target} in
21+
aarch64*-*-*)
22+
host_extra_gcc_objs="driver-aarch64.o"
23+
@@ -108,7 +108,7 @@ case ${host} in
24+
;;
25+
esac
26+
;;
27+
- arm*-*-freebsd* | arm*-*-netbsd* | arm*-*-linux* | arm*-*-fuchsia*)
28+
+ arm*-*-freebsd* | arm*-*-netbsd* | arm*-*-linux* | arm*-*-fuchsia* | arm*-*-openbsd*)
29+
case ${target} in
30+
arm*-*-*)
31+
host_extra_gcc_objs="driver-arm.o"
32+
--
33+
2.49.0
34+

0 commit comments

Comments
 (0)