Skip to content
Snippets Groups Projects
Commit 166117b0 authored by Filippo Cremonese's avatar Filippo Cremonese
Browse files

Merge branch 'feature/host-toolchain-fixes'

parents dd1bda44 056bb696
No related branches found
No related tags found
No related merge requests found
Showing with 79 additions and 13 deletions
...@@ -16,7 +16,7 @@ configure: | ...@@ -16,7 +16,7 @@ configure: |
--enable-fat \ --enable-fat \
CFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \ CFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \
CXXFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \ CXXFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \
LDFLAGS="(@= data.values.use_old_glibc_lflags @)" LDFLAGS="(@= data.values.use_old_glibc_lflags @) -static-libgcc"
build_system: make build_system: make
build_dependencies: build_dependencies:
- glibc - glibc
......
...@@ -17,7 +17,7 @@ configure: | ...@@ -17,7 +17,7 @@ configure: |
--enable-shared=no \ --enable-shared=no \
CFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \ CFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \
CXXFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \ CXXFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \
LDFLAGS="(@= data.values.use_old_glibc_lflags @)" LDFLAGS="(@= data.values.use_old_glibc_lflags @) -static-libgcc"
build_system: make build_system: make
dependencies: dependencies:
- gmp - gmp
......
...@@ -17,7 +17,7 @@ configure: | ...@@ -17,7 +17,7 @@ configure: |
--enable-shared=no \ --enable-shared=no \
CFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \ CFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \
CXXFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \ CXXFLAGS="-fPIC (@= data.values.use_old_glibc_cflags @)" \
LDFLAGS="(@= data.values.use_old_glibc_lflags @)" LDFLAGS="(@= data.values.use_old_glibc_lflags @) -static-libgcc"
build_system: make build_system: make
dependencies: dependencies:
- gmp - gmp
......
...@@ -10,7 +10,7 @@ uclibc_arch_name: arm ...@@ -10,7 +10,7 @@ uclibc_arch_name: arm
uclibc_version: "0.9.33.2" uclibc_version: "0.9.33.2"
binutils_version: "2.35" binutils_version: "2.35"
gdb_version: "8.2.1" gdb_version: "8.2.1"
gcc_version: "4.9.3" gcc_version: "9.2.0"
coreutils_version: "8.29" coreutils_version: "8.29"
extra_gcc_configure_options: extra_gcc_configure_options:
- --enable-__cxa_atexit - --enable-__cxa_atexit
......
...@@ -9,7 +9,7 @@ linux_arch_name: i386 ...@@ -9,7 +9,7 @@ linux_arch_name: i386
binutils_version: "2.35" binutils_version: "2.35"
gdb_version: "8.2.1" gdb_version: "8.2.1"
musl_version: "1.1.12" musl_version: "1.1.12"
gcc_version: "4.9.3" gcc_version: "9.2.0"
coreutils_version: "8.29" coreutils_version: "8.29"
extra_gcc_configure_options: extra_gcc_configure_options:
- --without-cloog - --without-cloog
......
...@@ -9,7 +9,7 @@ linux_arch_name: x86_64 ...@@ -9,7 +9,7 @@ linux_arch_name: x86_64
binutils_version: "2.35" binutils_version: "2.35"
gdb_version: "8.2.1" gdb_version: "8.2.1"
musl_version: "1.1.12" musl_version: "1.1.12"
gcc_version: "4.9.3" gcc_version: "9.2.0"
coreutils_version: "8.29" coreutils_version: "8.29"
extra_gcc_configure_options: extra_gcc_configure_options:
- --without-cloog - --without-cloog
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#@yaml/text-templated-strings #@yaml/text-templated-strings
--- ---
#@ def binutils_args( #@ def binutils_args(
#@ toolchain_name=mandatory,
#@ triple=mandatory, #@ triple=mandatory,
#@ binutils_version=mandatory, #@ binutils_version=mandatory,
#@ extra_binutils_configure_options="", #@ extra_binutils_configure_options="",
...@@ -56,6 +57,10 @@ add_to_path: ${ORCHESTRA_ROOT}/x86_64-pc-linux-gnu/(@= triple @)/binutils-bin/(@ ...@@ -56,6 +57,10 @@ add_to_path: ${ORCHESTRA_ROOT}/x86_64-pc-linux-gnu/(@= triple @)/binutils-bin/(@
build_dependencies: build_dependencies:
- glibc - glibc
- toolchain/host/gcc - toolchain/host/gcc
#@ if "host" not in toolchain_name:
- toolchain/host/binutils
#@ end
#@ end #@ end
--- ---
......
...@@ -18,8 +18,10 @@ ...@@ -18,8 +18,10 @@
#@ fail("GCC stage must be 1 or 2") #@ fail("GCC stage must be 1 or 2")
#@ end #@ end
#@ if/end "host" not in toolchain_name: #@ if "host" not in toolchain_name:
- toolchain/(@= toolchain_name @)/binutils - toolchain/(@= toolchain_name @)/binutils
- toolchain/host/binutils
#@ end
#@ if/end musl_version: #@ if/end musl_version:
- toolchain/(@= toolchain_name @)/musl(@= build @) - toolchain/(@= toolchain_name @)/musl(@= build @)
...@@ -36,7 +38,7 @@ ...@@ -36,7 +38,7 @@
--- ---
#@ def gcc_build_dependencies(stage, toolchain_name): #@ def gcc_build_dependencies(stage, toolchain_name):
#@ if/end stage == 2: #@ if/end stage == 2 and "host" not in toolchain_name:
- toolchain/(@= toolchain_name @)/gcc~stage1 - toolchain/(@= toolchain_name @)/gcc~stage1
- glibc - glibc
...@@ -84,8 +86,10 @@ configure: | ...@@ -84,8 +86,10 @@ configure: |
patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-(@= gcc_version @)-cfns-fix-mismatch-in-gnu_inline-attributes.patch" "$SOURCE_DIR" patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-(@= gcc_version @)-cfns-fix-mismatch-in-gnu_inline-attributes.patch" "$SOURCE_DIR"
patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-(@= gcc_version @)-cpp-musl-support.patch" "$SOURCE_DIR" patch-if-exists "${ORCHESTRA_DOTDIR}/patches/gcc-(@= gcc_version @)-cpp-musl-support.patch" "$SOURCE_DIR"
sed -i 's|gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"|gcc_gxx_include_dir="/${gcc_gxx_without_sysroot#/}"|' "$SOURCE_DIR/gcc/configure" sed -i 's|gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"|gcc_gxx_include_dir="/${gcc_gxx_without_sysroot#/}"|' "$SOURCE_DIR/gcc/configure"
(@ if "host" in toolchain_name: @)
sed -i "s|SHLIB_LINK = .(CC)|\0 -L$ORCHESTRA_ROOT/link-only/lib|" "$SOURCE_DIR/libgcc/config/t-slibgcc" sed -i "s|SHLIB_LINK = .(CC)|\0 -L$ORCHESTRA_ROOT/link-only/lib|" "$SOURCE_DIR/libgcc/config/t-slibgcc"
sed -i 's|@multilib_flags@||' "$SOURCE_DIR/libgcc/config/t-slibgcc" sed -i 's|@multilib_flags@||' "$SOURCE_DIR/libgcc/config/t-slibgcc"
(@ end @)
mkdir -p "$BUILD_DIR" mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR" && "$SOURCE_DIR/configure" \ cd "$BUILD_DIR" && "$SOURCE_DIR/configure" \
...@@ -132,9 +136,9 @@ configure: | ...@@ -132,9 +136,9 @@ configure: |
--without-zstd \ --without-zstd \
(@= expand_args(extra_gcc_configure_options) @) \ (@= expand_args(extra_gcc_configure_options) @) \
(@= expand_args(build_specific_configure_options) @) \ (@= expand_args(build_specific_configure_options) @) \
CFLAGS="-w -ggdb3 -O3" \ CFLAGS="-w -ggdb3 -O3 (@= data.values.use_old_glibc_cflags @)" \
CXXFLAGS="-w -ggdb3 -O3" \ CXXFLAGS="-w -ggdb3 -O3 (@= data.values.use_old_glibc_cflags @)" \
LDFLAGS="(@= linker_flags @)" LDFLAGS="(@= linker_flags @) (@= data.values.use_old_glibc_lflags @) -static-libgcc"
install: | install: |
cd "$BUILD_DIR" cd "$BUILD_DIR"
(@= make @) (@= extra_gcc_make_variables @) (@= make @) (@= extra_gcc_make_variables @)
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#@ ): #@ ):
#@ if/end binutils_version: #@ if/end binutils_version:
(@= "toolchain/" + toolchain_name + "/binutils" @): #@ create_binutils_component(triple=triple, binutils_version=binutils_version, extra_binutils_configure_options=extra_binutils_configure_options, binutils_sysroot=binutils_sysroot) (@= "toolchain/" + toolchain_name + "/binutils" @): #@ create_binutils_component(toolchain_name=toolchain_name, triple=triple, binutils_version=binutils_version, extra_binutils_configure_options=extra_binutils_configure_options, binutils_sysroot=binutils_sysroot)
#@ if/end gdb_version: #@ if/end gdb_version:
(@= "toolchain/" + toolchain_name + "/gdb" @): #@ create_gdb_component(triple=triple, gdb_version=gdb_version) (@= "toolchain/" + toolchain_name + "/gdb" @): #@ create_gdb_component(triple=triple, gdb_version=gdb_version)
......
...@@ -28,7 +28,8 @@ configure: | ...@@ -28,7 +28,8 @@ configure: |
sed 's|$INSTALL_PATH|'"$ORCHESTRA_ROOT"'|g' .config -i && sed 's|$INSTALL_PATH|'"$ORCHESTRA_ROOT"'|g' .config -i &&
sed 's|$FLAGS|(@= additional_cflags @)|g' .config -i && sed 's|$FLAGS|(@= additional_cflags @)|g' .config -i &&
true | (@= serial_make @) oldconfig && true | (@= serial_make @) oldconfig &&
patch -p1 < "${ORCHESTRA_DOTDIR}/patches/blt-blo.patch" && patch -p1 < "${ORCHESTRA_DOTDIR}/patches/blt-blo.patch"
patch -p1 < "${ORCHESTRA_DOTDIR}/patches/uclibc-0071-Fix-libgcc_s_resume-issue.patch"
sed 's|^typedef __kernel_dev_t\s*__kernel_old_dev_t;$|\0\ntypedef long __kernel_long_t;\ntypedef unsigned long __kernel_ulong_t;|' libc/sysdeps/linux/arm/bits/kernel_types.h -i sed 's|^typedef __kernel_dev_t\s*__kernel_old_dev_t;$|\0\ntypedef long __kernel_long_t;\ntypedef unsigned long __kernel_ulong_t;|' libc/sysdeps/linux/arm/bits/kernel_types.h -i
install: | install: |
export PATH=" export PATH="
......
From 7ed8bacef45a2537646e7235092bd2e5408cd0b5 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Sun, 14 Jun 2015 15:14:22 +0200
Subject: [PATCH] Fix libgcc_s_resume issue
When built with gcc 5.1, uClibc fails to build with the following
issue:
LD librt-0.9.33.2.so
librt/librt_so.a(rt-unwind-resume.oS): In function `_Unwind_Resume':
rt-unwind-resume.c:(.text+0x3c): undefined reference to `libgcc_s_resume'
collect2: error: ld returned 1 exit status
make[2]: *** [lib/librt.so] Error 1
This commit fixes the code in a way similar to what was done in glibc
in commit:
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=175cef4163dd60f95106cfd5f593b8a4e09d02c9
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c | 3 ++-
libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
index f4d6f41..a6a0515 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
@@ -27,7 +27,8 @@
#define __libc_fatal(x) {/*write(STDERR_FILENO, x, strlen(x));*/ abort();}
static void *libgcc_s_handle;
-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
+ __attribute_used__;
static _Unwind_Reason_Code (*libgcc_s_personality)
(_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c
index f9a4ffb..e2e2e0b 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c
@@ -25,7 +25,8 @@
#define __libc_dlclose dlclose
#define __libc_fatal(x) {/*write(STDERR_FILENO, x, strlen(x));*/ abort();}
-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
+ __attribute_used__;
static _Unwind_Reason_Code (*libgcc_s_personality)
(_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
--
2.1.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment