On Fri, Jan 15, 2021 at 4:12 AM Jonathan Wakely via Gcc <gcc@gcc.gnu.org> wrote:
> On Fri, 15 Jan 2021, 07:39 Sebastian Huber, < > sebastian.hu...@embedded-brains.de> wrote: > > > On 14/01/2021 15:16, Sebastian Huber wrote: > > > > > Hello, > > > > > > I try to add a nios2 multilib to support the "Nios II Floating Point > > > Hardware 2 Component": > > > > > > > > > https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/ug/ug_nios2_custom_instruction.pdf > > > > > > > > > If I add all custom instructions supported by the component, then I > > > get an error in libatomic since -Werror is used: > > > > > > cc1: error: switch '-mcustom-fmins' has no effect unless > > > '-ffinite-math-only' is specified [-Werror] > > > cc1: error: switch '-mcustom-fmaxs' has no effect unless > > > '-ffinite-math-only' is specified [-Werror] > > > cc1: error: switch '-mcustom-round' has no effect unless > > > '-fno-math-errno' is specified [-Werror] > > > > > > I am not sure how to fix this. > > Is a compiler warning the right diagnostic for an inconsistent use of > > compiler options? This warning is not related to code processed by GCC. > > > > But the options are part of the input provided by the user. I think a > warning is appropriate (and I'm not sure what other sensible options there > are anyway). > I've seen similar warnings on other architectures and sometimes the linker will give you an error for incompatible code. But I don't know if this incompatibility is something the linker will care about. The message is just saying it is being ignored like C++ options used when compiling C or vice-versa. Have you mapped these odd combinations to multilibs? Personally, I'd be happy for this to be an error and not a warning if they can't be in effect at the same time. The user needs to go back and think more about what they are doing. But it isn't a huge deal. In this case, I think it means your "enable all" may actually be two near complete subsets. One which is all with the no effect options dropped and another which includes the no effect options and drops the conflicting ones. But I have no idea what actually makes sense for someone to configure and deploy on this CPU. I'm just looking at the options like a truth table. --joel --joel