Skip to content

Commit

Permalink
pharo: build with gcc48
Browse files Browse the repository at this point in the history
Building with GCC > 4.9 produces a broken VM for reasons that are not
yet understood, see
http://forum.world.st/OSProcess-fork-issue-with-Debian-built-VM-td4947326.html

also disable "stackprotector" hardening for compatibility with this
older gcc.
  • Loading branch information
lukego committed Jul 10, 2017
1 parent af92427 commit 2b3dcfa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions pkgs/development/pharo/vm/build-vm.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, libuuid, autoreconfHook, gcc6, ... }:
{ stdenv, fetchurl, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, libuuid, autoreconfHook, gcc48, ... }:

{ name, src, version, source-date, source-url, ... }:

Expand Down Expand Up @@ -26,7 +26,9 @@ stdenv.mkDerivation rec {
pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; };

# Note: -fPIC causes the VM to segfault.
hardeningDisable = [ "format" "pic" ];
hardeningDisable = [ "format" "pic"
# while the VM depends on <= gcc48:
"stackprotector" ];

# Regenerate the configure script.
# Unnecessary? But the build breaks without this.
Expand Down Expand Up @@ -94,8 +96,14 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;

# Note: Force gcc6 because gcc5 crashes when compiling the VM.
buildInputs = [ bash unzip glibc openssl gcc6 mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share libuuid autoreconfHook ];
# gcc 4.8 used for the build:
#
# gcc5 crashes during compilation; gcc >= 4.9 produces a
# binary that crashes when forking a child process. See:
# http://forum.world.st/OSProcess-fork-issue-with-Debian-built-VM-td4947326.html
#
# (stack protection is disabled above for gcc 4.8 compatibility.)
buildInputs = [ bash unzip glibc openssl gcc48 mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share libuuid autoreconfHook ];

meta = {
description = "Clean and innovative Smalltalk-inspired environment";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/pharo/vm/vms.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ cmake, stdenv, fetchurl, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, libuuid, autoreconfHook, gcc6, fetchFromGitHub, makeWrapper} @args:
{ cmake, stdenv, fetchurl, bash, unzip, glibc, openssl, gcc, mesa, freetype, xorg, alsaLib, cairo, libuuid, autoreconfHook, gcc48, fetchFromGitHub, makeWrapper} @args:

let
pharo-vm-build = import ./build-vm.nix args;
Expand Down

0 comments on commit 2b3dcfa

Please sign in to comment.