Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Duplicating libgcc.a as libgcc_eh.a for both mingw64/mingw32 to s…
Browse files Browse the repository at this point in the history
…olve `-lgcc_eh` linking problem (#186)
  • Loading branch information
Ilia-Kosenkov authored Feb 28, 2021
1 parent 0b4da33 commit 04a1cbf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mingw-w64-gcc/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=8.3.0
_srcver=8.3.0
#_srcver=8.3.0-RC-20190215
pkgrel=9500
pkgrel=9501
pkgdesc="GCC for the MinGW-w64"
arch=('any')
url="https://gcc.gnu.org"
Expand Down Expand Up @@ -302,10 +302,10 @@ package_mingw-w64-gcc() {
install -D -m644 ${srcdir}/gdbinit ${pkgdir}${MINGW_PREFIX}/etc/gdbinit
sed -i 's|%GCC_NAME%|gcc-'${pkgver}'|g' ${pkgdir}${MINGW_PREFIX}/etc/gdbinit

# Hack for rustc hardcoding -lgcc_eh
if [ "${MINGW_CHOST}" = "i686-w64-mingw32" ]; then
cp ${pkgdir}${MINGW_PREFIX}/lib/gcc/${MINGW_CHOST}/${pkgver}/libgcc.a ${pkgdir}${MINGW_PREFIX}/lib/gcc/${MINGW_CHOST}/${pkgver}/libgcc_eh.a
fi
# 'gcc' when build with --disable-shared does not produce a standalone 'libgcc_eh.a'.
# Instead, everything is put into 'libgcc.a'.
# To please compilers that hardcode -lgcc_eh, such as 'rustc', 'libgcc.a' is duplicated as 'libgcc_eh.a'.
cp ${pkgdir}${MINGW_PREFIX}/lib/gcc/${MINGW_CHOST}/${pkgver}/libgcc.a ${pkgdir}${MINGW_PREFIX}/lib/gcc/${MINGW_CHOST}/${pkgver}/libgcc_eh.a
}

package_mingw-w64-gcc-fortran() {
Expand Down

0 comments on commit 04a1cbf

Please sign in to comment.