Repository navigation
eztrace: 1.1-11 -> 2.1.1 - #395939
eztrace: 1.1-11 -> 2.1.1#3959390xda157 wants to merge 1 commit into
Conversation
|
Not sure why this is happening on darwin (both arm and x86_64). Does anyone have any ideas? |
|
|
I fixed the linker error on macOS, but pretty sure this is just broken on anything but Linux because it unconditionally imports Linux specific headers and I don't see a way to turn off compilation for this code: https://gitlab.com/eztrace/eztrace/-/blob/master/src/instrumentation/include/eztrace-instrumentation/tracing.h?ref_type=heads#L80 Said next error: https://gist.github.com/2xsaiko/7026ca51002895910fe5c4dc6f7c7a96 Either way, the linker error happens because it compiles with -finstrument-functions which makes the binary link against functions ___cyg_profile_func_enter and ___cyg_profile_func_exit, but these are not defined in the binary itself (on Linux, it looks like they are defined in glibc which is why it doesn't happen there), and then later at runtime overridden by eztrace. So, tell the linker to dynamically lookup missing symbols with -undefined dynamic_lookup. I couldn't test if this actually works because of aforementioned further compile errors but it at least gets the build further. Patch for the linker error: Commit ID: a98c41831b98dbf660e615762d5c97ccc12166bd
Change ID: kqwwzxxzovqysqvwtrwkrrpqyznoktks
Author : Marco Rebhan <[email protected]> (2025-04-17 14:32:56)
Committer: Marco Rebhan <[email protected]> (2025-04-17 14:44:41)
(no description set)
diff --git a/pkgs/by-name/ez/eztrace/darwin-Fix-compiler-instrumentation-linker-error.patch b/pkgs/by-name/ez/eztrace/darwin-Fix-compiler-instrumentation-linker-error.patch
new file mode 100644
index 0000000000..2e1d25de3e
--- /dev/null
+++ b/pkgs/by-name/ez/eztrace/darwin-Fix-compiler-instrumentation-linker-error.patch
@@ -0,0 +1,23 @@
+Commit ID: 7fcffd58b5994d3411435deda07f5ca480747b38
+Change ID: vvwmpluqxrtspmkqwtrtnqoprwnnomtl
+Author : Marco Rebhan <[email protected]> (2025-04-17 14:31:05)
+Committer: Marco Rebhan <[email protected]> (2025-04-17 14:31:05)
+
+ Fix compiler instrumentation test linker error
+
+diff --git a/test/compiler_instrumentation/CMakeLists.txt b/test/compiler_instrumentation/CMakeLists.txt
+index e8cfba5149..7afa367c70 100644
+--- a/test/compiler_instrumentation/CMakeLists.txt
++++ b/test/compiler_instrumentation/CMakeLists.txt
+@@ -5,6 +5,10 @@
+ set(CMAKE_C_FLAGS "-finstrument-functions -O0")
+ set(LINK_OPTIONS "-rdynamic")
+
++ if (APPLE)
++ add_link_options("-Wl,-undefined,dynamic_lookup")
++ endif()
++
+ add_executable(foo foo.c)
+ add_test(build_foo "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target foo)
+
+
diff --git a/pkgs/by-name/ez/eztrace/package.nix b/pkgs/by-name/ez/eztrace/package.nix
index 42e382a4af..37f332c801 100644
--- a/pkgs/by-name/ez/eztrace/package.nix
+++ b/pkgs/by-name/ez/eztrace/package.nix
@@ -24,6 +24,10 @@
otf2
];
+ patches = [
+ ./darwin-Fix-compiler-instrumentation-linker-error.patch
+ ];
+
env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
doInstallCheck = true;Alternatively this to disable it, which gets you the same next compiler error: Commit ID: b9342c0241b0b21cfad7d35418b9ec90c3011820
Change ID: kvytxvtvlkktusnynzqkmwvvuqqlkyrt
Author : Marco Rebhan <[email protected]> (2025-04-17 14:40:40)
Committer: Marco Rebhan <[email protected]> (2025-04-17 14:40:40)
(no description set)
diff --git a/pkgs/by-name/ez/eztrace/package.nix b/pkgs/by-name/ez/eztrace/package.nix
index 42e382a4af..e197db3de7 100644
--- a/pkgs/by-name/ez/eztrace/package.nix
+++ b/pkgs/by-name/ez/eztrace/package.nix
@@ -24,6 +24,10 @@
otf2
];
+ cmakeFlags = lib.optionals stdenv.isDarwin [
+ "-DEZTRACE_ENABLE_COMPILER_INSTRUMENTATION=NO"
+ ];
+
env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
doInstallCheck = true; |
|
Same when building outside of Nix with Xcode tools/homebrew. This isn't looking good for darwin support to me. |
should I mark darwin as broken or remove it from the platforms? |
|
I'm not sure when to use which. Broken, I suppose. |
|
superseded by #388855 |
also unbreaks on gcc 14 #388196
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.