-
Notifications
You must be signed in to change notification settings - Fork 259
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
Build fails on GCC-only machine, if native symlinks to /usr/bin/{cc,gcc} do not exist. #1301
Comments
The purpose of this Could you please elaborate which distribution comes with an installed host compiler but doesn't provide |
I wonder how exactly you plan to guarantee that it is a host compiler, rather than a cross compiler named /opt/cross-toolchain/bin/cc which is present in $PATH? |
/cc @kcgen who is the author of this. |
If it's not the host compiler, the generated executable will fail to execute, causing the build to fail. Sorry, but I have no interest in porting to Meson. I'd rather port the lookup tables to C++14 to get rid of this logic altogether. |
Presumably that is why the bug report author submitted a bug, yes. |
No. Again, a host compiler must be available for compiling fluidsynth. I am questioning the authors use-case of a host compiler being available, but the symlinks |
Ideally, the user should be able to choose the host compiler at configure time. This is especially relevant if they installed two or more host compilers on their machine, but prefer to use one over the other.
Gentoo Linux officially supports this setup by unsetting the
I submitted this bug to highlight the insufficient logic for determining the host compiler. |
This is kind of circular logic... I am questioning your belief that the symlink As I stated originally, cmake does a $PATH lookup for Your reply was that the result of this is a fluidsynth build that contains a bug: namely, it fails to build with an error. I then pointed out that yes, builds that contain a bug due to failing with an error are, naturally, bugs. Bugs like the one that has been reported in this bug ticket. I am not at all sure why my clarification that a bug report that is reporting a bug is being used as proof that there is no bug. This has nothing to do with /usr/bin/cc, even if the lack of a /usr/bin/cc is one thing that can expose the bug. |
I'm commenting here because of two reasons:
I know a little bit about build systems, I think. :) autotools and meson both have out of the box support for cross compilation (you don't have to have two different projects in order to cross compile while also building a native tool such as gentables). CMake is, somewhat famously, "not great" at cross compilation. You can of course manually work around CMake's deficiencies here. The problem is that you've incompletely done so, because your workaround doesn't include support for the industry standard (CMake also gets the terminology wrong, and calls the native machine the "host", which just causes endless confusion when discussing topics with people who use the well established existing terminology. This is a side effect of the fact that cmake doesn't support mixing host and build machines in a single build, so they don't actually need terminology to describe the difference.) ... The solution here is to allow a dedicated |
I understand this use-case from a user perspective. But from a technical perspective, it doesn't make a difference for fluidsynth in this particular case, because the generated lookup tables should always contain the same values, no matter what host compiler was used for
Ok, thanks for the clarification. No need for docker.
We are using this logic for 5 years now, and I'm not aware of a bug pointing out this is utterly broken. Hence I do believe, the ExternalProject works pretty well in practice... unless you mess around with the symlinks as we've just learned.
I was questioning the motivation behind this being a valid use-case. E.g. if you were to remove
Yes, I agree. I must admit I haven't heard of the |
FluidSynth version
Reproducable at least since v 2.2.5.
Describe the bug
The build fails on GCC-only machines, if native symlinks to /usr/bin/{cc,gcc} are not available. In the following summary CBUILD refers to the build machine in a cross-compilation scenario.
The issue seems to be the cmake implementation to choose a CBUILD compiler for building the "make_tables" binary.
fluidsynth/src/CMakeLists.txt
Lines 551 to 560 in eabae3b
src/gentables/CMakeLists.txt
unsetsCC
to force cmake to look for a C compiler, hopefully a CBUILD one.Since the
CMAKE_C_COMPILER
macro is not passed inCONFIGURE_COMMAND
, theCMakeDetermineCCompiler
module tries and fails to determine a C compiler.If I'm not mistaken, it first inspects the (unset)
CC
env var, then tries all of [cc,gcc,cl,bcc,xlc,icx,clang].Expected behavior
Steps to reproduce
Additional context
Workaround: Append
-DCMAKE_C_COMPILER=my_compiler
toCONFIGURE_COMMAND
.A corresponding bug report exists downstream at https://bugs.gentoo.org/833979.
This is ultimatively a shortcoming of CMake's support for cross-compilation. There exists a Meson WrapDB port for FluidSynth, which may be worth looking into: https://github.com/mesonbuild/wrapdb/tree/master/subprojects/packagefiles/fluidsynth
The text was updated successfully, but these errors were encountered: