rpcs3 icon indicating copy to clipboard operation
rpcs3 copied to clipboard

gentoo LLVM linking problem

Open soredake opened this issue 9 years ago • 22 comments

Tried build with system llvm and with bundled, same error. build.log.zip

soredake avatar Aug 06 '17 12:08 soredake

If you look at the build log it says

error: undefined reference to 'llvm::Module::~Module()'

You probably don't have the static llvm libs or something. Perhaps try installing the llvm or llvm-common packages if you haven't already.

hcorion avatar Aug 06 '17 16:08 hcorion

Alternatively, you could just download the latest AppImage from https://rpcs3.net/download

hcorion avatar Aug 06 '17 16:08 hcorion

@hcorion

Perhaps try installing the llvm or llvm-common packages if you haven't already

Installed already.

soredake avatar Aug 06 '17 17:08 soredake

Hmm, from what I can tell Gentoo's LLVM doesn't provide static libs, apparently because

"static libraries are security flaw and waste of time."

-- http://lists.llvm.org/pipermail/llvm-dev/2015-September/090589.html

However, we need to link statically against llvm because of conflicts with the mesa driver.

I guess you could build llvm using the submodule.

# Assuming in rpcs3 source directory
cd llvm ; mkdir build ; cd build ; cmake ../ -DCMAKE_BUILD_TYPE=Release ; make

and then when building rpcs3, run cmake with

cmake -DLLVM_DIR=/path_to_rpcs3_source/llvm/build/lib/cmake/llvm

hcorion avatar Aug 08 '17 01:08 hcorion

why you don't add shared option for custom build and static will remain as default choice for distributed appimage

NukeMania avatar Aug 08 '17 16:08 NukeMania

@hcorion how about shared option?

soredake avatar Sep 02 '17 18:09 soredake

I reverted this commit https://github.com/RPCS3/rpcs3/pull/3085/commits/e2cef655df4559ef24c6ad1935c038ad040cab23 but nothing changed, same error. Switched linker to bfd from gold and now i see this /usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: cannot find -lLLVM

soredake avatar Sep 02 '17 18:09 soredake

@soredake Can you try with #3404 ?

hcorion avatar Sep 06 '17 20:09 hcorion

You'll need to build with cmake -DUSE_SHARED_LLVM_LIBS=ON

hcorion avatar Sep 06 '17 20:09 hcorion

Should be fixed as of #3404 , provided you build with shared libs, Note that building with shared libs may make RPCS3 not work at all if it conflicts with mesa

AniLeo avatar Sep 06 '17 20:09 AniLeo

Tried again, still /usr/lib/gcc/x86_64-pc-linux-gnu/6.4.0/../../../../x86_64-pc-linux-gnu/bin/ld.bfd: cannot find -lLLVM

soredake avatar Sep 06 '17 23:09 soredake

Probably has to do with weird Gentoo packaging. Try with

cmake -DUSE_SHARED_LLVM_LIBS=ON -DLLVM_DIR=/usr/lib/llvm/4/lib/cmake/llvm/

hcorion avatar Sep 07 '17 03:09 hcorion

I already tried with this path as LLVM_DIR, still the same error, sadly.

soredake avatar Sep 07 '17 12:09 soredake

I think problem related to gcc-6.4 can you try with gcc-5 or clang

NukeMania avatar Sep 07 '17 13:09 NukeMania

Gcc-5 = fail Gcc-7 = fail clang-4 = fail clang-5 = fail Fails with llvm-5 and https://github.com/RPCS3/rpcs3/pull/3410 too

soredake avatar Sep 07 '17 19:09 soredake

Oh. Because of course Gentoo has to do something different from literally every other distro. https://wiki.gentoo.org/wiki/Project:LLVM/Shared_libraries

hcorion avatar Sep 12 '17 07:09 hcorion

So, no support for gentoo will be provided ever?

soredake avatar Sep 27 '17 07:09 soredake

Not at all, this is an open source project, if you or someone else can figure out how to get it to build on Gentoo, then please create a Pull Request for it.

Perhaps I'll setup a Gentoo VM one of these days and figure it out.

hcorion avatar Sep 27 '17 16:09 hcorion

Of course, you could just download and use the AppImage: https://rpcs3.net/download

hcorion avatar Sep 27 '17 16:09 hcorion

Gentoo VM

Better to use docker

docker create -v /usr/portage --name portage gentoo/portage
docker run -it --rm \
  --volumes-from portage \
  --entrypoint "bash" \
  gentoo/stage3-amd64:latest

soredake avatar Sep 27 '17 19:09 soredake