darlinghq / darling

Darwin/macOS emulation layer for Linux
http://www.darlinghq.org
GNU General Public License v3.0
11.55k stars 446 forks source link

Darling fails to build on gentoo linux #1447

Closed MagicalTux closed 4 months ago

MagicalTux commented 1 year ago

Build Log What is the build error?

[  9%] Linking C shared library libhost_priv_xtrace_mig.dylib
Undefined symbols for architecture x86_64:
  "___stack_chk_fail", referenced from:
      _xtrace_mig_routine_host_get_exception_ports in host_privXtraceMig.c.o
      _xtrace_mig_routine_host_swap_exception_ports in host_privXtraceMig.c.o
  "___stack_chk_guard", referenced from:
      _xtrace_mig_routine_host_get_exception_ports in host_privXtraceMig.c.o
      _xtrace_mig_routine_host_swap_exception_ports in host_privXtraceMig.c.o
ld: symbol(s) not found for architecture x86_64
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/external/xnu/darling/src/libsystem_kernel/libsyscall/CMakeFiles/host_priv_xtrace_mig.dir/build.make:113: src/external/xnu/darling/src/libsystem_kernel/libsyscall/libhost_priv_xtrace_mig.dylib] Error 1
make[1]: *** [CMakeFiles/Makefile2:17729: src/external/xnu/darling/src/libsystem_kernel/libsyscall/CMakeFiles/host_priv_xtrace_mig.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

System Information What system are you building with?

Software Version
Clang 16.0.6
CMake 3.26.5
Linux Kernel 6.5.8
Darling 7b2aa573bdd9b3ce143ef2f0acf54841e51b9895
Ne94fets commented 1 year ago

Hello, I got the same problem. @MagicalTux Did you already solve it and can you tell how, please?

MagicalTux commented 1 year ago

I haven't solved it yet but ___stack_chk_fail means the stack protector code is enabled somewhere but not linked in the end.

Adding -fno-stack-protector to the flags and rebuilding from a clean env should solve the issue.

MagicalTux commented 4 months ago

Confirmed this issue isn't appearing with 203af1f604727e13032df1870e3491572e7d6704