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

chromium: Enable crabbyavif #829

Open
MaxIhlenfeldt opened this issue Aug 12, 2024 · 3 comments
Open

chromium: Enable crabbyavif #829

MaxIhlenfeldt opened this issue Aug 12, 2024 · 3 comments
Assignees

Comments

@MaxIhlenfeldt
Copy link
Collaborator

In #828, we had to disable crabbyavif from being built, because the bindgen invocations for it created build errors (see #827 (comment)).

I've been able to fix the unsupported option '-mbranch-protection=' for target 'x86_64-unknown-linux-gnu' part, but I'm stuck on the $HEADER file not found part.

My current solution is to get all the flags set in our toolchain BUILD.gn file and pass them through to bindgen, so it can pass them to clang. These two are new in our args.gn:

rust_bindgen_extra_host_args = [
  "-isystem/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/recipe-sysroot-native/usr/include",
  "-isysroot=/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/recipe-sysroot-native",
  "-stdlib=libc++",
  "-O2",
  "-pipe",
]
rust_bindgen_extra_target_args = [
  "-target",
  "arm-oe-linux-gnueabi",
  "-mfpu=neon",
  "-mfloat-abi=hard",
  "-mcpu=cortex-a15",
  "-mlittle-endian",
  "-Qunused-arguments",
  "-D_TIME_BITS=64",
  "-D_FILE_OFFSET_BITS=64",
  "--sysroot=/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/recipe-sysroot",
  "-O2",
  "-g",
  "-fmacro-prefix-map=/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/chromium-127.0.6533.99=/usr/src/debug/chromium-x11/127.0.6533.99",
  "-fdebug-prefix-map=/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/chromium-127.0.6533.99=/usr/src/debug/chromium-x11/127.0.6533.99",
  "-fmacro-prefix-map=/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/chromium-127.0.6533.99/out/Release=/usr/src/debug/chromium-x11/127.0.6533.99",
  "-fdebug-prefix-map=/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/chromium-127.0.6533.99/out/Release=/usr/src/debug/chromium-x11/127.0.6533.99",
  "-fdebug-prefix-map=/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/recipe-sysroot=",
  "-fmacro-prefix-map=/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/recipe-sysroot=",
  "-fdebug-prefix-map=/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/recipe-sysroot-native=",
  "-pipe",
]

I've also manually added these two to the extra target args:

  "-isysroot=/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/recipe-sysroot",
  "-isystem/home/gitlab-runner/yocto-chromium/builds/ci-chromium-x11-qemuarm-master/tmp-glibc/work/cortexa15t2hf-neon-oe-linux-gnueabi/chromium-x11/127.0.6533.99/recipe-sysroot/usr/include",

but that didn't fix the issue.

I've searched for the header files in question in the sysroot, and this is where they seem to be located:

> fdfind stddef.h
usr/include/c++/v1/stddef.h
usr/include/linux/stddef.h

> fdfind stdarg.h
usr/include/c++/14.2.0/tr1/stdarg.h

Adding these directories using -isystem might work, but seems hacky; also, the usr/include/c++/14.2.0/tr1/stdarg.h path looks like it might not be the same across all clang versions / Yocto releases.

I've also tried using bindgen from meta-clang instead of Chromium's by adding a dependency on bindgen-cli-native and setting rust_bindgen_root=".../recipe-sysroot-native/usr" in args.gn, but that didn't seem to change anything.

@kraj do you maybe have suggestions what else I could try?

@MaxIhlenfeldt
Copy link
Collaborator Author

@kraj gentle ping

@kraj
Copy link
Collaborator

kraj commented Aug 26, 2024

hmmm, it seems to be using vendored paths for libclang, Can you check if its using the tools from native sysroot ?

@MaxIhlenfeldt
Copy link
Collaborator Author

@kraj

Can you check if its using the tools from native sysroot ?

What exactly do you mean?

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

2 participants