Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build Handbrake with llvm-15/clang-15 on linux #4650

Open
StatusCode404 opened this issue Nov 8, 2022 · 3 comments
Open

Unable to build Handbrake with llvm-15/clang-15 on linux #4650

StatusCode404 opened this issue Nov 8, 2022 · 3 comments

Comments

@StatusCode404
Copy link

Problem Description

Unable to build Handbrake with llvm-15/clang-15 on linux.

I'm able to build it without problems on llvm-14/clang-14 on linux.

I'm building to generate FDO/PGO data

These are my build options in the custom.defs file:
GCC.args.O.speed = -fasynchronous-unwind-tables -fno-semantic-interposition -fno-trapping-math -ffat-lto-objects -march=native -mtune=native -pipe -O3
GCC.args.extra = -w -feliminate-unused-debug-types -fstack-protector-strong -fstack-clash-protection -D_FORTIFY_SOURCE=2 -fPIE -pie -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wp,-D_GLIBCXX_ASSERTIONS -fprofile-instr-generate=<path-hidden>/HandBrake/clangFDO/default_%m.profraw -fprofile-update=atomic -flto=thin

This is my build command line:
LDFLAGS="-fuse-ld=lld" ./configure --ld /usr/bin/ld.lld --ar /usr/bin/llvm-ar --ranlib /usr/bin/llvm-ranlib --strip /usr/bin/llvm-strip --cc /usr/bin/clang --optimize=speed --enable-fdk-aac --disable-nvenc --build=build-v1.5.1-CLANG && cd ./build-v1.5.1-CLANG && time LDFLAGS="-fuse-ld=lld" make -j$(( $(nproc) + 2 ));

With llvm-14 and clang-14 as mentioned, I can build smoothly using the options and command line above.
However with version 15 I get the following errors:
bfd plugin: LLVM gold plugin has failed to create LTO module: Not an int attribute (Producer: 'LLVM15.0.3' Reader: 'LLVM 13.0.1') LLVM ERROR: Type mismatch in constant table!

Also not sure why bfd plugin is triggering the use of the gold linker. I've explicitly added "-fuse-ld=lld".
Any help here would be greatly appreciated thanks in advance!

Activity Log, Crash Log or any other details

bfd plugin: LLVM gold plugin has failed to create LTO module: Not an int attribute (Producer: 'LLVM15.0.3' Reader: 'LLVM 13.0.1')
bfd plugin: LLVM gold plugin has failed to create LTO module: Not an int attribute (Producer: 'LLVM15.0.3' Reader: 'LLVM 13.0.1')
LLVM ERROR: Type mismatch in constant table!
./libtool: line 1733: 1964324 Aborted

What Operating System are you running?

Ubuntu 22.04

What version of HandBrake are you running?

1.5.1

Where did you download HandBrake from?

github

@Nomis101
Copy link
Contributor

This reminds me to the Clang error I'm seeing if I try to build with -flto=thin on macOS with current Xcode. If its the same reason, then its because x264 does set -mstack-alignment=64 in configure, FFmpeg does set -mstack-alignment=16 and this seems to be a conflict when linking. There was a change in the recent Clang/LLVM which does makes this now an error.

Can you try to build with your build options and build commands from this branch:
https://github.com/Nomis101/HandBrake/tree/mstack-test

It this does fix your issue, it is the same reason, if not, its a different one.

@StatusCode404
Copy link
Author

StatusCode404 commented Nov 12, 2022

May very well be!
I can't build with the fork atm as I'm in the midst of doing a FDO generation of several videos of various qualities with llvm-14. Takes several days.
Once done I'll try llvm-15 again.

If it does the trick then perhaps you should try and get it into upstream to at least get the discussion going.

@luzpaz
Copy link
Contributor

luzpaz commented Jan 13, 2024

Still relevant ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants