Unable to build using Clang/LLVM 12

Questions about Wine on Linux
Locked
trilean
Newbie
Newbie
Posts: 1
Joined: Tue Sep 07, 2021 9:53 am

Unable to build using Clang/LLVM 12

Post by trilean »

Hi folks!

I'm trying to build wine (vanilla 6.16) on a Gentoo system built entirely using Clang and the LLVM toolchain. It doesn't have GCC/binutils installed.
The first thing I had to do was symlink clang to as, since llvm-as only assembles LLVM IR and not (x86) assembly. But now I'm running into this issue:

Code: Select all

tools/winebuild/winebuild -w --implib -o dlls/ucrtbase/libucrtbase.a -m64 --export \
  /var/tmp/portage/app-emulation/wine-vanilla-6.16/work/wine-6.16/dlls/ucrtbase/ucrtbase.spec \
  dlls/ucrtbase/crt_gccmain.o dlls/ucrtbase/crt_main.o dlls/ucrtbase/crt_winmain.o \
  dlls/ucrtbase/crt_wmain.o dlls/ucrtbase/crt_wwinmain.o dlls/ucrtbase/mathf.o \
  dlls/ucrtbase/printf.o dlls/ucrtbase/sincos.o
ld.lld: error: undefined symbol: main
>>> referenced by /usr/lib/Scrt1.o:(_start_c)

ld.lld: error: undefined symbol: __wine$func$ucrtbase$1$_Cbuild
>>> referenced by /tmp/libucrtbase-da9a57.o:(_Cbuild)
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
winebuild: /usr/local/bin/as failed with status 1
Obviously it should be building a library and not an executable. Do you have any ideas or pointers to what might be going wrong here?

Thanks
Philipp
Locked