Skip to content

Commit

Permalink
riscv64-unknown-elf-newlib: enable clang64
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed Oct 9, 2022
1 parent ade0f64 commit ca3ff06
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions mingw-w64-riscv64-unknown-elf-newlib/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Based on mingw-w64-arm-none-eabi-newlib

_bootstrap=0
if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then
_bootstrap=1
fi

_realname=newlib
_target=riscv64-unknown-elf
Expand All @@ -13,13 +16,17 @@ pkgver=4.2.0.20211231
pkgrel=2
pkgdesc='GNU Tools for RISC-V Embedded Processors - Newlib (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
url="https://sourceware.org/newlib/"
license=('Various')
groups=("${MINGW_PACKAGE_PREFIX}-${_target}-toolchain")
depends=("${MINGW_PACKAGE_PREFIX}-${_target}-binutils")
makedepends=("${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-mpc"
"${MINGW_PACKAGE_PREFIX}-mpfr"
"${MINGW_PACKAGE_PREFIX}-isl"
$( (( _bootstrap )) || echo "${MINGW_PACKAGE_PREFIX}-${_target}-gcc"))
options=('staticlibs' '!strip' '!emptydirs')
source=(
Expand Down Expand Up @@ -54,6 +61,11 @@ _build_gcc() {

cp -a ${MINGW_PREFIX}/${_target} ${srcdir}/gcc-${_gccver}/gcc-install-${MSYSTEM}

if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then
CFLAGS+=" -Wno-int-conversion -Wno-array-bounds -Wno-mismatched-tags"
CXXFLAGS+=" -Wno-int-conversion -Wno-array-bounds -Wno-mismatched-tags"
fi

local _GCC_LDFLAGS="${LDFLAGS} -Wl,--disable-dynamicbase"
if [ "${CARCH}" = 'x86_64' ]; then
_GCC_LDFLAGS+=",--image-base=0x400000"
Expand Down Expand Up @@ -83,7 +95,6 @@ _build_gcc() {
--without-headers \
--with-libelf \
--with-newlib \
--enable-multilib \
--with-host-libstdcxx="-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm" \
--with-sysroot=${MINGW_PREFIX} \
--with-build-sysroot=${srcdir}/gcc-${_gccver}/gcc-install-${MSYSTEM} \
Expand Down

0 comments on commit ca3ff06

Please sign in to comment.