Skip to content

Commit 873cb7d

Browse files
author
Filippo Cremonese
committed
Fix windres not finding gcc
1 parent 3371eae commit 873cb7d

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.orchestra/config/components/toolchain/lib/binutils.lib.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#@ ):
1515
#@ source_url = "https://ftp.gnu.org/gnu/binutils/binutils-" + binutils_version + ".tar.bz2"
1616
#@ binutils_sysroot = binutils_sysroot or "$ORCHESTRA_ROOT/" + triple
17+
#@ bindir = "${ORCHESTRA_ROOT}/x86_64-pc-linux-gnu/" + triple + "/binutils-bin/" + binutils_version
1718
license: COPYING
1819
configure: |
1920
extract.sh --into "$SOURCE_DIR" (@= source_url @)
@@ -27,7 +28,7 @@ configure: |
2728
--datadir=$ORCHESTRA_ROOT/share/binutils-data/(@= triple @)/(@= binutils_version @) \
2829
--infodir=$ORCHESTRA_ROOT/share/binutils-data/(@= triple @)/(@= binutils_version @)/info \
2930
--mandir=$ORCHESTRA_ROOT/share/binutils-data/(@= triple @)/(@= binutils_version @)/man \
30-
--bindir=$ORCHESTRA_ROOT/x86_64-pc-linux-gnu/(@= triple @)/binutils-bin/(@= binutils_version @) \
31+
--bindir=(@= bindir @) \
3132
--libdir=$ORCHESTRA_ROOT/lib64/binutils/(@= triple @)/(@= binutils_version @) \
3233
--libexecdir=$ORCHESTRA_ROOT/lib64/binutils/(@= triple @)/(@= binutils_version @) \
3334
--includedir=$ORCHESTRA_ROOT/lib64/binutils/(@= triple @)/(@= binutils_version @)/include \
@@ -53,7 +54,7 @@ configure: |
5354
CXXFLAGS="-w -ggdb3 -O3"
5455
build_system: make
5556
add_to_path:
56-
- ${ORCHESTRA_ROOT}/x86_64-pc-linux-gnu/(@= triple @)/binutils-bin/(@= binutils_version @)
57+
- #@ bindir
5758
build_dependencies:
5859
- glibc
5960
- toolchain/host/gcc

.orchestra/config/components/toolchain/lib/gcc.lib.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
#@ extra_gcc_stage2_configure_options="",
8080
#@ gcc_sysroot = None,
8181
#@ extra_gcc_make_variables = "",
82+
#@ binutils_version = None,
8283
#@ ):
8384

8485
#@ source_url = "https://ftp.gnu.org/gnu/gcc/gcc-" + gcc_version + "/gcc-" + gcc_version + ".tar.gz"
@@ -96,6 +97,10 @@
9697
#@ dependencies = gcc_dependencies(stage, toolchain_name, musl_version, uclibc_version, linux_version, mingw64_version) or []
9798
#@ build_dependencies = gcc_build_dependencies(stage, toolchain_name) or []
9899

100+
#@ if "win" in toolchain_name:
101+
#@ binutils_bindir = "${ORCHESTRA_ROOT}/x86_64-pc-linux-gnu/" + triple + "/binutils-bin/" + binutils_version
102+
#@ end
103+
99104
#! The sed is required to make `--sysroot=/` work with `--with-gxx-include-dir`
100105
#! properly.
101106
configure: |
@@ -197,7 +202,11 @@ install: |
197202
198203
# Fixinclude locates the wrong pthread.h
199204
find "${DESTDIR}${ORCHESTRA_ROOT}" -type d -name include-fixed -exec rm -f {}/pthread.h \;
200-
205+
(@- if "win" in toolchain_name: @)
206+
# Symlink needed for making windres use the right gcc
207+
mkdir -p "${TMP_ROOT}(@= binutils_bindir @)"
208+
ln -s "../../gcc-bin/(@= gcc_version @)/(@= triple @)-gcc" "${TMP_ROOT}(@= binutils_bindir @)/(@= triple @)-gcc"
209+
(@ end -@)
201210
dependencies: #@ dependencies
202211
build_dependencies: #@ build_dependencies
203212
#@ end

.orchestra/config/components/toolchain/lib/toolchain.lib.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
(@= "toolchain/" + toolchain_name + "/linux-headers" @): #@ create_linux_headers_component(triple=triple, linux_version=linux_version, arch_name=linux_arch_name)
4848

4949
#@ if/end gcc_version:
50-
(@= "toolchain/" + toolchain_name + "/gcc" @): #@ create_gcc_component(toolchain_name=toolchain_name, triple=triple, gcc_sysroot=gcc_sysroot, gcc_version=gcc_version, extra_gcc_configure_options=extra_gcc_configure_options, extra_gcc_stage2_configure_options=extra_gcc_stage2_configure_options, extra_gcc_make_variables=extra_gcc_make_variables, musl_version=musl_version, uclibc_version=uclibc_version, linux_version=linux_version, mingw64_version=mingw64_version)
50+
(@= "toolchain/" + toolchain_name + "/gcc" @): #@ create_gcc_component(toolchain_name=toolchain_name, triple=triple, gcc_sysroot=gcc_sysroot, gcc_version=gcc_version, extra_gcc_configure_options=extra_gcc_configure_options, extra_gcc_stage2_configure_options=extra_gcc_stage2_configure_options, extra_gcc_make_variables=extra_gcc_make_variables, musl_version=musl_version, uclibc_version=uclibc_version, linux_version=linux_version, mingw64_version=mingw64_version, binutils_version=binutils_version)
5151

5252
#@ if/end mingw64_version:
5353
_: #@ template.replace(create_mingw64_components(toolchain_name=toolchain_name, triple=triple, mingw64_version=mingw64_version, gcc_version=gcc_version))

0 commit comments

Comments
 (0)