11{
22 lib ,
3- stdenv ,
3+ clangStdenv ,
44 fetchFromGitHub ,
55} :
66
77let
88 irFile =
9- if stdenv . hostPlatform . system == "x86_64-linux" then
9+ if clangStdenv . hostPlatform . system == "x86_64-linux" then
1010 "linux-amd64.cpp"
11- else if stdenv . hostPlatform . system == "aarch64-linux" then
11+ else if clangStdenv . hostPlatform . system == "aarch64-linux" then
1212 "linux-arm64.cpp"
13- else if stdenv . hostPlatform . system == "i686-linux" then
13+ else if clangStdenv . hostPlatform . system == "i686-linux" then
1414 "linux-i386.cpp"
15- else if stdenv . hostPlatform . system == "x86_64-darwin" then
15+ else if clangStdenv . hostPlatform . system == "x86_64-darwin" then
1616 "darwin-amd64.cpp"
17- else if stdenv . hostPlatform . system == "aarch64-darwin" then
17+ else if clangStdenv . hostPlatform . system == "aarch64-darwin" then
1818 "darwin-arm64.cpp"
1919 else
20- throw "Unsupported platform: ${ stdenv . hostPlatform . system } " ;
20+ throw "Unsupported platform: ${ clangStdenv . hostPlatform . system } " ;
2121in
22- stdenv . mkDerivation ( finalAttrs : {
22+ clangStdenv . mkDerivation ( finalAttrs : {
2323 pname = "julec" ;
24- version = "0.1.3 " ;
24+ version = "0.1.5 " ;
2525
2626 src = fetchFromGitHub {
2727 owner = "julelang" ;
2828 repo = "jule" ;
2929 tag = "jule${ finalAttrs . version } " ;
3030 name = "jule-${ finalAttrs . version } " ;
31- hash = "sha256-hFWoGeTmfXIPcICWXa5W36QDOk3yB7faORxFaM9shcQ =" ;
31+ hash = "sha256-gFlca9XdRNv2CI3jfMiWejcmGGzabP0VGs4vlvFs72o =" ;
3232 } ;
3333
3434 irSrc = fetchFromGitHub {
3535 owner = "julelang" ;
3636 repo = "julec-ir" ;
3737 # revision determined by the upstream commit hash in julec-ir/README.md
38- rev = "a274782922e4275c4a036d63acffd3369dbc382f " ;
38+ rev = "4a3bf4fc84b53aa607855df6635d95d3e310f7ad " ;
3939 name = "jule-ir-${ finalAttrs . version } " ;
40- hash = "sha256-TXMSXTGTzZntPUhT6QTmn3nD2k855ZoAW9aQWyhrE8s =" ;
40+ hash = "sha256-Wl5AYRGYcQpj/R9nynxNC5r1HK1EmImwkLokdZfp9sE =" ;
4141 } ;
4242
4343 dontConfigure = true ;
@@ -58,16 +58,20 @@ stdenv.mkDerivation (finalAttrs: {
5858 buildPhase = ''
5959 runHook preBuild
6060
61- echo "Building ${ finalAttrs . meta . mainProgram } v${ finalAttrs . version } for ${ stdenv . hostPlatform . system } ..."
61+ echo "Building ${ finalAttrs . meta . mainProgram } -bootstrap v${ finalAttrs . version } for ${ clangStdenv . hostPlatform . system } ..."
6262 mkdir -p bin
63- ${ stdenv . cc . targetPrefix } c++ ir.cpp \
63+ ${ clangStdenv . cc . targetPrefix } c++ ir.cpp \
6464 --std=c++17 \
6565 -Wno-everything \
66- -O3 \
67- -flto \
66+ -fwrapv \
67+ -ffloat-store \
6868 -DNDEBUG \
6969 -fomit-frame-pointer \
70- -o "bin/${ finalAttrs . meta . mainProgram } "
70+ -fno-strict-aliasing \
71+ -o "bin/${ finalAttrs . meta . mainProgram } -bootstrap"
72+
73+ echo "Building ${ finalAttrs . meta . mainProgram } v${ finalAttrs . version } for ${ clangStdenv . hostPlatform . system } ..."
74+ bin/${ finalAttrs . meta . mainProgram } -bootstrap --opt L2 -p -o "bin/${ finalAttrs . meta . mainProgram } " "src/${ finalAttrs . meta . mainProgram } "
7175
7276 runHook postBuild
7377 '' ;
0 commit comments