Merge pull request #175187 from trofi/workaround-fno-common-for-pharo-spur64

pharo-spur64: add -fcommon workaround
This commit is contained in:
Sandro 2022-06-03 20:43:26 +02:00 committed by GitHub
commit 136f694bed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -40,6 +40,12 @@ stdenv.mkDerivation rec {
cd build/ cd build/
''; '';
# -fcommon is a workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: CMakeFiles/pharo.dir/build/pharo-vm-2016.02.18/src/vm/gcc3x-cointerp.c.o:(.bss+0x88): multiple definition of
# `sendTrace'; CMakeFiles/pharo.dir/build/pharo-vm-2016.02.18/src/vm/cogit.c.o:(.bss+0x84): first defined here
NIX_CFLAGS_COMPILE = "-fcommon";
installPhase = '' installPhase = ''
mkdir -p "$prefix/lib/$name" mkdir -p "$prefix/lib/$name"

View file

@ -85,6 +85,13 @@ stdenv.mkDerivation rec {
configureFlags = [ "--without-npsqueak" configureFlags = [ "--without-npsqueak"
"--with-vmversion=5.0" "--with-vmversion=5.0"
"--with-src=${vm}" ]; "--with-src=${vm}" ];
# -fcommon is a workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: vm/vm.a(cogit.o):/build/source/spur64src/vm/cointerp.h:358: multiple definition of `checkAllocFiller';
# vm/vm.a(gcc3x-cointerp.o):/build/source/spur64src/vm/cointerp.h:358: first defined here
NIX_CFLAGS_COMPILE = "-fcommon";
CFLAGS = "-DPharoVM -DIMMUTABILITY=1 -msse2 -D_GNU_SOURCE -DCOGMTVM=0 -g -O2 -DNDEBUG -DDEBUGVM=0"; CFLAGS = "-DPharoVM -DIMMUTABILITY=1 -msse2 -D_GNU_SOURCE -DCOGMTVM=0 -g -O2 -DNDEBUG -DDEBUGVM=0";
LDFLAGS = "-Wl,-z,now"; LDFLAGS = "-Wl,-z,now";