Skip to content
Open

Gcc #298

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion recipes/devel/compat/gcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ checkoutScript: |
buildTools: [host-toolchain, target-toolchain]
buildToolsWeak: [m4]
buildVars: [AUTOCONF_BUILD, AUTOCONF_HOST, AUTOCONF_TARGET,
GCC_TARGET_ARCH, GCC_TARGET_FLOAT_ABI, GCC_TARGET_FPU]
GCC_TARGET_ARCH, GCC_TARGET_FLOAT_ABI, GCC_TARGET_FPU, PKG_VERSION]
buildScript: |
GCC_SRC=$1

Expand Down Expand Up @@ -79,6 +79,11 @@ buildScript: |
makeParallel
makeSequential install DESTDIR=${PWD}/../install
popd
#add libbacktrace
cp build/libbacktrace/.libs/libbacktrace.a \
install/${GCC_PREFIX:-usr}/lib/gcc/${AUTOCONF_TARGET:-${AUTOCONF_HOST}}/${PKG_VERSION}/
cp $GCC_SRC/libbacktrace/backtrace.h install/${GCC_PREFIX:-usr}/include

}

packageScript: |
Expand Down
8 changes: 8 additions & 0 deletions recipes/devel/cross-toolchain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ multiPackage:
GCC_LIBC: "glibc"
GCC_ENABLE_LANGUAGES: "c,c++,ada"

x86_64-unknown-elf-ada:
environment:
AUTOCONF_TARGET: "x86_64-unknown-elf"
ARCH: "x86_64"
GCC_LIBC: "newlib"
GCC_ENABLE_LANGUAGES: "c,c++,ada"
GCC_ENABLE_LIBADA: "no"

# ARMv7 Linux CortexA toolchain with hard floating point
arm-linux-gnueabihf:
environment:
Expand Down
19 changes: 17 additions & 2 deletions recipes/devel/gcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ checkoutScript: |

buildVars: [AUTOCONF_BUILD, AUTOCONF_HOST, AUTOCONF_TARGET, GCC_TARGET_ABI,
GCC_TARGET_ARCH, GCC_TARGET_FLOAT_ABI, GCC_TARGET_FPU,
GCC_MULTILIB, GCC_EXTRA_OPTIONS]
GCC_MULTILIB, GCC_EXTRA_OPTIONS, GCC_ENABLE_LIBADA,
PKG_VERSION]
buildToolsWeak: [m4]
buildScript: |
GCC_SRC=$(pwd)/src
Expand All @@ -82,6 +83,11 @@ buildScript: |
{
pushd build
if [[ $GCC_SRC/configure -nt .configure.stamp ]] ; then
ADDITIONAL_OPTIONS=()
if [[ ${GCC_ENABLE_LIBADA:-yes} == no ]]; then
ADDITIONAL_OPTIONS+=("--disable-libada")
fi

$GCC_SRC/configure \
--build=${AUTOCONF_BUILD} \
--host=${AUTOCONF_HOST:-${AUTOCONF_BUILD}} \
Expand All @@ -101,6 +107,7 @@ buildScript: |
--disable-documentation \
--disable-debug \
--disable-nls \
${ADDITIONAL_OPTIONS[@]} \
--with-xmlto=no \
--with-fop=no \
--with-gmp-include=${BOB_DEP_PATHS[libs::gmp-dev]}/usr/include \
Expand All @@ -121,6 +128,11 @@ buildScript: |
configureGcc "$@"
makeParallel -C build
makeSequential -C build install DESTDIR="$PWD/install"

#add libbacktrace
cp build/libbacktrace/.libs/libbacktrace.a \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the wrong libbacktrace. It is built with the AUTOCONF_HOST compiler. But the result is installed in the AUTOCONF_TARGET part. I guess this does not show up in your case because it's all x86_64 but it will blow up if AUTOCONF_TARGET is something vastly different.

Now, gcc will compile the library for the target system. But only if certain languages are enabled. I would advise to compile the library in a separate recipe.

install/${GCC_PREFIX:-usr}/lib/gcc/${AUTOCONF_TARGET:-${AUTOCONF_HOST}}/${PKG_VERSION}/
cp $GCC_SRC/libbacktrace/backtrace.h install/${GCC_PREFIX:-usr}/include
}

packageScript: |
Expand Down Expand Up @@ -238,7 +250,7 @@ multiPackage:
See https://gcc.gnu.org/install/configure.html for more detauls.

buildTools: [binutils]
buildVars: [GCC_LIBC, GCC_ENABLE_LANGUAGES]
buildVars: [GCC_LIBC, GCC_ENABLE_LANGUAGES, GCC_ENABLE_LIBADA]
buildScript: |
if [[ -z "${GCC_MULTILIB:-}" ]] ; then
OPTIONS=( --disable-multilib )
Expand Down Expand Up @@ -311,6 +323,9 @@ multiPackage:
ADDITIONAL_INSTALL=(install-gnattools)
fi
makeParallel -C build all-gcc ${ADDITIONAL_MAKE[@]}
if [[ ${GCC_ENABLE_LIBADA:-yes} == no ]]; then
makeParallel -C build/gcc cross-gnattools ada.all.cross
fi
makeSequential -C build install-gcc ${ADDITIONAL_INSTALL[@]} DESTDIR="$PWD/install"

native:
Expand Down