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

Build fail [88/99] ar -M #47

Closed
sistr22 opened this issue Dec 1, 2015 · 7 comments
Closed

Build fail [88/99] ar -M #47

sistr22 opened this issue Dec 1, 2015 · 7 comments

Comments

@sistr22
Copy link
Contributor

sistr22 commented Dec 1, 2015

While trying to compile on MacOS it works fine at first but stopped near the end, during linking:

****-macbookpro:build ****$ ninja
[35/99] Building CXX object third_party/glslang/SPIRV/CMakeFiles/SPIRV.dir/GlslangToSpv.cpp.o
../third_party/glslang/SPIRV/GlslangToSpv.cpp:1561:33: warning: comparison of constant 4294967295 with expression of type 'spv::BuiltIn' is always true [-Wtautological-constant-out-of-range-compare]
                    if (builtIn != spv::BadValue)
                        ~~~~~~~ ^  ~~~~~~~~~~~~~
../third_party/glslang/SPIRV/GlslangToSpv.cpp:3023:17: warning: comparison of constant 4294967295 with expression of type 'spv::BuiltIn' is always true [-Wtautological-constant-out-of-range-compare]
    if (builtIn != spv::BadValue)
        ~~~~~~~ ^  ~~~~~~~~~~~~~
../third_party/glslang/SPIRV/GlslangToSpv.cpp:3032:13: warning: comparison of constant 4294967295 with expression of type 'spv::Decoration' is always true [-Wtautological-constant-out-of-range-compare]
    if (dec != spv::BadValue)
        ~~~ ^  ~~~~~~~~~~~~~
../third_party/glslang/SPIRV/GlslangToSpv.cpp:3039:13: warning: comparison of constant 4294967295 with expression of type 'spv::Decoration' is always true [-Wtautological-constant-out-of-range-compare]
    if (dec != spv::BadValue)
        ~~~ ^  ~~~~~~~~~~~~~
../third_party/glslang/SPIRV/GlslangToSpv.cpp:3046:13: warning: comparison of constant 4294967295 with expression of type 'spv::Decoration' is always true [-Wtautological-constant-out-of-range-compare]
    if (dec != spv::BadValue)
        ~~~ ^  ~~~~~~~~~~~~~
5 warnings generated.
[88/99] Generating libshaderc_combined.a
FAILED: cd /Users/****/Documents/dev/vulkan/sharder_compiler/shaderc/build/libshaderc && /bin/echo -e create\ libshaderc_combined.a\\naddlib\ /Users/****/Documents/dev/vulkan/sharder_compiler/shaderc/build/libshaderc/libshaderc.a\\naddlib\ /Users/****/Documents/dev/vulkan/sharder_compiler/shaderc/build/third_party/glslang/SPIRV/libSPIRV.a\\naddlib\ /Users/****/Documents/dev/vulkan/sharder_compiler/shaderc/build/libshaderc_util/libshaderc_util.a\\naddlib\ /Users/****/Documents/dev/vulkan/sharder_compiler/shaderc/build/third_party/glslang/glslang/libglslang.a\\naddlib\ /Users/****/Documents/dev/vulkan/sharder_compiler/shaderc/build/third_party/glslang/OGLCompilersDLL/libOGLCompiler.a\\naddlib\ /Users/****/Documents/dev/vulkan/sharder_compiler/shaderc/build/third_party/glslang/glslang/OSDependent/Unix/libOSDependent.a\\nsave\\nend | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar -M
usage:  ar -d [-TLsv] archive file ...
    ar -m [-TLsv] archive file ...
    ar -m [-abiTLsv] position archive file ...
    ar -p [-TLsv] archive [file ...]
    ar -q [-cTLsv] archive file ...
    ar -r [-cuTLsv] archive file ...
    ar -r [-abciuTLsv] position archive file ...
    ar -t [-TLsv] archive [file ...]
    ar -x [-ouTLsv] archive [file ...]
[88/99] Building CXX object libshaderc/CMakeFiles/shaderc_shaderc_cpp_test.dir/src/shaderc_cpp_test.cc.o
ninja: build stopped: subcommand failed.
****-macbookpro:build ****$ 

I haven't found a work around yet (And I've never used ninja ...)

@dekimir
Copy link

dekimir commented Dec 1, 2015

Thanks, @WhiteSEEKER for reporting this. We don't build regularly on MacOS, so support for it will be sporadic.

This looks like it's caused by the GNU-specific ar flag -M in the combine_static_lib function (defined in cmake/utils.cmake). If you can figure out how to achieve the same operation in a portable manner, you can fix this. Alternatively, if you don't care about the libshaderc_combined target, you can modify line 27 of libshaderc/CMakeLists.txt to skip this step for both Windows and MacOS.

@sistr22
Copy link
Contributor Author

sistr22 commented Dec 1, 2015

Thx for the quick fix !
I just did: if (NOT "${MSVC}" AND NOT APPLE) at line 27
There is definitely a way to merge libraries in a cross platform way like that:
ar -rcT libmerged.a lib1.a lib2.a
But I I'm not super familliar with cmake.
Again thx !

@dekimir
Copy link

dekimir commented Dec 1, 2015

Glad this worked for you. Would you consider contributing your fix to the repo?

@sistr22
Copy link
Contributor Author

sistr22 commented Dec 1, 2015

You mean ... making a pull request for one line change ? I would gladly
ofc, I'll do that.

Thx

Damien

On Tue, 1 Dec 2015 at 16:35 Dejan Mircevski notifications@github.com
wrote:

Glad this worked for you. Would you consider contributing your fix to the
repo?


Reply to this email directly or view it on GitHub
#47 (comment).

@dekimir
Copy link

dekimir commented Dec 1, 2015

Prolly more than one line, as you should also add yourself to CONTRIBUTORS. ;)

@sistr22
Copy link
Contributor Author

sistr22 commented Dec 1, 2015

PR submitted! It took some time but at least it's a "real" fix, it also
create the shared lib on mac and pass the test.
Currently it only fail the last test on mac:

14/14 Test #14: glslc_tests ......................***Failed 0.11 sec

Thx !

On Tue, 1 Dec 2015 at 17:50 Dejan Mircevski notifications@github.com
wrote:

Prolly more than one line, as you should also add yourself to
CONTRIBUTORS. ;)


Reply to this email directly or view it on GitHub
#47 (comment).

@sistr22
Copy link
Contributor Author

sistr22 commented Dec 1, 2015

Closing

@sistr22 sistr22 closed this as completed Dec 1, 2015
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

No branches or pull requests

2 participants