DevHeads.net

Need help to build new version of ispc

Comments

Re: Need help to build new version of ispc

By Carmen Bianca Bakker at 11/07/2018 - 05:16

Hi Luya,

Je mer, 2018-11-07 je 00:24 -0800, Luya Tshimbalanga skribis:
I think you accidentally enabled encryption for your message to the
list.

Best regards,
Carmen

Re: Need help to build new version of ispc

By Luya Tshimbalanga at 11/07/2018 - 12:16

Whoops. Here is the actual message:

Getting the snapshot of ispc to support llvm 7.0 and needed by embree,
it looks like the build broke at the following line:

rc/main.cpp: In function 'int main(int, char**)':
src/main.cpp:669:19: error: invalid conversion from 'int' to 'Module::OutputFlags' [-fpermissive]
flags |= Module::GeneratePIC;
~~~~~~^~~~~~~~~
src/main.cpp:685:17: error: invalid conversion from 'int' to 'Module::OutputFlags' [-fpermissive]
flags |= Module::GenerateFlatDeps;
~~~~~~^~~~~~~~~
src/main.cpp:688:62: error: invalid conversion from 'int' to 'Module::OutputFlags' [-fpermissive]
flags |= Module::GenerateMakeRuleForDeps | Module::OutputDepsToStdout;
^~~~~~~~~~~~~~~~~~
src/main.cpp:773:13: error: invalid conversion from 'int' to 'Module::OutputFlags' [-fpermissive]
flags &= ~Module::OutputDepsToStdout;
~~~~~~^~~~~~~~~~
src/main.cpp:787:13: error: invalid conversion from 'int' to 'Module::OutputFlags' [-fpermissive]
flags &= Module::GenerateMakeRuleForDeps;
~~~~~~^~~~~~~~~
At global scope:

See the copr build which include the spec file for analyzing.

<a href="https://copr-be.cloud.fedoraproject.org/results/luya/ispc-git/fedora-rawhide-x86_64/00820232-ispc/" title="https://copr-be.cloud.fedoraproject.org/results/luya/ispc-git/fedora-rawhide-x86_64/00820232-ispc/">https://copr-be.cloud.fedoraproject.org/results/luya/ispc-git/fedora-raw...</a>

Hopefully someone provides a fix. Thanks in advance,

Luya

Re: Need help to build new version of ispc

By Jerry James at 11/07/2018 - 13:57

On Wed, Nov 7, 2018 at 11:07 AM Luya Tshimbalanga
< ... at fedoraproject dot org> wrote:
The problem is that enumerated types are supposed to be used as such,
not as bits in an integer, which is what this code is trying to do.
In order to compute the bitwise or, the enum elements have to be
converted to ints. Then when the assignment part is to be done,
you've got an int that needs to be assigned to a variable of enum
type. That's what the error message is complaining about. The
simplest fix for you, the packager, is to add -fpermissive to the
build flags.

The best approach for upstream to take is to convert GeneratePIC, etc.
from elements of an enum to #define constants.

The most hideous approach for upstream to take is to convert the lines
in the error message to this form:

flags = static_cast<Module::OutputFlags>(flags | Module::GeneratePIC);

I absolutely do not recommend doing that. If you don't want to build
with -fpermissive for some reason, then you could also patch the code
to look like that. Again, not recommended.

Re: Need help to build new version of ispc

By Luya Tshimbalanga at 11/07/2018 - 17:42

On 2018-11-07 10:57 a.m., Jerry James wrote:
%make_build gcc OPT="%{optflags} -fpermissive"
LDFLAGS="%{__global_ldflags} -fpermissive"

Extracted from ispc.spec including in the original post.

As the result,

At global scope:
cc1plus: error: unrecognized command line option
'-Wno-deprecated-register' [-Werror]
cc1plus: error: unrecognized command line option '-Wno-c99-extensions'
[-Werror]
cc1plus: all warnings being treated as errors
make: *** [Makefile:288: objs/main.o] Error 1
make: *** Waiting for unfinished jobs....
Compiling src/llvmutil.cpp
Compiling src/ispc.cpp
Compiling src/expr.cpp
Compiling src/cbackend.cpp
Compiling src/module.cpp
src/module.cpp: In member function 'bool
Module::writeOutput(Module::OutputType, Module::OutputFlags, const
char*, const char*, const char*, DispatchHeaderInfo*)':
src/module.cpp:1301:13: error: this 'if' clause does not guard...
[-Werror=misleading-indentation]
             if (strcasecmp(suffix, "c") && strcasecmp(suffix, "cc") &&
             ^~
src/module.cpp:1305:15: note: ...this statement, but the latter is
misleadingly indented as if it were guarded by the 'if'
               break;
               ^~~~~
src/module.cpp:1307:13: error: this 'if' clause does not guard...
[-Werror=misleading-indentation]
             if (strcasecmp(suffix, "c") && strcasecmp(suffix, "cc") &&
             ^~
src/module.cpp:1311:15: note: ...this statement, but the latter is
misleadingly indented as if it were guarded by the 'if'
               break;
               ^~~~~
At global scope:
cc1plus: error: unrecognized command line option
'-Wno-deprecated-register' [-Werror]
cc1plus: error: unrecognized command line option '-Wno-c99-extensions'
[-Werror]
cc1plus: all warnings being treated as errors
make: *** [Makefile:287: objs/module.o] Error 1

Notice the unrecognized command line. I have no idea how to fix that.

Luya