Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(julia): custom build without Frame Pointer Omission #37

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ repos:
rev: v4.4.0
hooks:
- id: end-of-file-fixer
exclude: \.patch$
- id: trailing-whitespace
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
Expand Down
4 changes: 4 additions & 0 deletions julia/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.PHONY: build
build:
docker build -t parca-demo:julia .

build-patched:
docker run --interactive --rm --volume="${PWD}:/build" --workdir=/build \
docker.io/nixos/nix:2.11.1 sh -c '$$(nix-build --no-out-link)' | docker load
25 changes: 25 additions & 0 deletions julia/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ pkgs ? import
(builtins.fetchTarball
"https://github.com/NixOS/nixpkgs/archive/nixos-22.11.tar.gz"
)
{ }
}:

pkgs.dockerTools.streamLayeredImage {
name = "parca-demo";
tag = "julia";
contents = [
(pkgs.julia.overrideAttrs (current: {
patches = current.patches ++ [
./patches/0001-disable-frame-pointer-omission.patch
];
doInstallCheck = false;
}))
(pkgs.writeTextDir "app/main.jl" (builtins.readFile ./main.jl))
];
config = {
Cmd = [ "julia" "main.jl" ];
Env = [ "ENABLE_JITPROFILING=1" ];
WorkingDir = "/app";
};
}
20 changes: 20 additions & 0 deletions julia/patches/0001-disable-frame-pointer-omission.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
commit 1d5a4168933d19df4784aa6c73a5a7653610cf04
Author: Maxime Brunet <[email protected]>
Date: Sat Feb 11 11:37:06 2023 -0800

Disable Frame Pointer Omission on Linux

diff --git a/src/codegen.cpp b/src/codegen.cpp
index 104f77f8d6..5a1284be6d 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -10,7 +10,7 @@
#if defined(_CPU_X86_)
#define JL_NEED_FLOATTEMP_VAR 1
#endif
-#if defined(_OS_WINDOWS_) || defined(_OS_FREEBSD_)
+#if defined(_OS_WINDOWS_) || defined(_OS_LINUX_) || defined(_OS_FREEBSD_)
#define JL_DISABLE_FPO
#endif