Skip to content

Libepoxy: Build for riscv64 #11040

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eschnett
Copy link
Contributor

No description provided.

@eschnett
Copy link
Contributor Author

This PR introduces a work-around for a meson/BinaryBuilder incompatibility:

# meson unconditionally (?) adds the command line argument
# `-Werror=unused-command-line-argument`. That would be fine, except
# that we (the `cc` script) add `-Wl,-sdk_version,11.0` on Darwin,
# which is actually unused when meson checks for supported compiler
# options. This means that each such check fails, and meson won't use
# any options. That's mostly fine, except for the option
# `-Wno-int-conversion` which is required by the source code.
#
# The code below modifies the `cc` script to filter out the option
# `-Werror=unused-command-line-argument`. This should arguably either
# happen by default, or `cc` should only add the
# `-Wl,-sdk_version,11.0` when the linker is actually called.
#
# We modify `cc` on all architectures to prevent possible similar
# errors there.

@giordano
Copy link
Member

Meson stubbornness is really frustrating at times.

Comment on lines 19 to 33
# meson unconditionally (?) adds the command line argument
# `-Werror=unused-command-line-argument`. That would be fine, except
# that we (the `cc` script) add `-Wl,-sdk_version,11.0` on Darwin,
# which is actually unused when meson checks for supported compiler
# options. This means that each such check fails, and meson won't use
# any options. That's mostly fine, except for the option
# `-Wno-int-conversion` which is required by the source code.
#
# The code below modifies the `cc` script to filter out the option
# `-Werror=unused-command-line-argument`. This should arguably either
# happen by default, or `cc` should only add the
# `-Wl,-sdk_version,11.0` when the linker is actually called.
#
# We modify `cc` on all architectures to prevent possible similar
# errors there.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm moderately hopeful (but haven't tested) that adding -Wno-unused-command-line-argument to meson C/C++ flags would work around this issue in a less painful way. If only Meson didn't expect to control everything under the sun and left escape hatches for cases like this, it'd be a much nicer build system.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But also, if this was meson-specific, we'd have this issue with all other meson-based packages, no? What am I missing?

Copy link
Contributor Author

@eschnett eschnett Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env CFLAGS='-Wno-unused-command-line-argument' meson .. -Dtests=false --buildtype=release --cross-file="${MESON_TARGET_TOOLCHAIN}"

is not working.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I briefly considered patching cc instead of modifying it by line number but that's even more tedious. First, the source of cc isn't readily available, one has to run a container to get the scripts. And second, this script is very architecture dependent so I'd have to create a different patch for each architecture. That patch is likely to break whenever the script is updated, and updating the patch is quite tedious (since the cc source code isn't available online).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm modifying the meson target toolchain now. That seems to be the only way to make meson listen.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not working

That's because meson completely ignores all environment variables. I've been telling you meson is stubborn.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a different idea for addressing this?

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

Successfully merging this pull request may close these issues.

2 participants