darlinghq / darling

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

build falied connot find NSString #1013

Open amatke31 opened 3 years ago

amatke31 commented 3 years ago
[ 43%] Linking C shared library pam_opendirectory.so.2
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_NSString", referenced from:
      objc-class-ref in pam_opendirectory.m.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/external/openpam/pam_modules/CMakeFiles/pam_opendirectory.dir/build.make:105:src/external/openpam/pam_modules/pam_opendirectory.so.2] error 1
make[1]: *** [CMakeFiles/Makefile2:16355:src/external/openpam/pam_modules/CMakeFiles/pam_opendirectory.dir/all] error 2
make: *** [Makefile:130:all] error 2
Software Version
Clang 6.0.1-10
CMake 3.13.4
Linux Kernel 5.10.50-amd64-desktop
Darling Git Commit Hash
r0one commented 2 years ago

Same error here. I followed the official build instructions, with:

Debian buster

# apt install cmake clang-6.0 bison flex xz-utils libfuse-dev libudev-dev pkg-config \
libc6-dev-i386 linux-headers-amd64 libcap2-bin git python2 libglu1-mesa-dev libcairo2-dev \
libgl1-mesa-dev libtiff5-dev libfreetype6-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev \
libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libpulse-dev libavformat-dev libavcodec-dev \
libavresample-dev libdbus-1-dev libxkbfile-dev libssl-dev

uname -a: Linux 5.10.0-0.bpo.4-amd64 #1 SMP Debian 5.10.19-1~bpo10+1 (2021-03-13) x86_64 GNU/Linux

cmake 3.13.4

clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin

Darling: commit 97fc8eeaa45cfb6d67c45d59a4fa1520c9add50e (master of today)

Tail of the output:

[ 43%] Linking C shared library pam_opendirectory.so.2
ld: warning: OS dylibs should not add rpaths (linker option: -rpath) (Xcode build setting: LD_RUNPATH_SEARCH_PATHS)
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_NSString", referenced from:
      objc-class-ref in pam_opendirectory.m.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)                                
make[2]: *** [src/external/openpam/pam_modules/CMakeFiles/pam_opendirectory.dir/build.make:105: src/external/openpam/pam_modules/pam_opendirectory.so.2] Error 1
make[1]: *** [CMakeFiles/Makefile2:16355: src/external/openpam/pam_modules/CMakeFiles/pam_opendirectory.dir/all]
 Error 2
make: *** [Makefile:130: all] Error 2
tinka-io commented 2 years ago

Exact the same error message here.

also to get it running with make I had to export:

Linux 5.13.0-27-generic #29~20.04.1-Ubuntu SMP Fri Jan 14 00:32:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

cmake version 3.16.3

clang version 6.0.1-14 (tags/RELEASE_601/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin

Did anyone solve this issue?

Greetings

TylerJaacks commented 2 years ago

I have this issue and the export didn't work for me @thomasvey

KishoreKrishna commented 2 years ago

Has anybody got a solution or workaround for this issue?

JCubedS commented 2 years ago

I believe I found the solution to this issue. I tried this on Ubuntu Bionic, and I needed to install clang-10 instead of 'clang' to get past this issue.

So, I updated the apt-get update step and replaced clang with clang-10.
Also, I'm not sure if everyone needs to do this, but I also needed to run the following commands:

ln -s /usr/bin/clang-10 /usr/bin/clang
ln -s /usr/bin/clang++-10 /usr/bin/clang++

I don't understand why it did not work with the default 'clang' as it seems to install v6 by default.

I also noticed that I had other version of clang available on my ubuntu dist besides 10, such as clang-8, which may also work though I have not tried it.

Hopefully this will help.