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

Cannot compile with gcc-10/9 #3

Open
SweetVishnya opened this issue Jan 26, 2021 · 5 comments
Open

Cannot compile with gcc-10/9 #3

SweetVishnya opened this issue Jan 26, 2021 · 5 comments

Comments

@SweetVishnya
Copy link
Contributor

Hi!

I am trying to compile with gcc-10 and get the following error:

/home/vishnya/fwork/symcc/build/SymRuntime-prefix/src/SymRuntime-build/libSymRuntime.so: undefined reference to `std::experimental::filesystem::v1::status(std::experimental::filesystem::v1::__cxx11::path const&)'
/home/vishnya/fwork/symcc/build/SymRuntime-prefix/src/SymRuntime-build/libSymRuntime.so: undefined reference to `std::experimental::filesystem::v1::__cxx11::path::_M_split_cmpts()'
collect2: error: ld returned 1 exit status

What toolchain do you use?

@sebastianpoeplau
Copy link
Collaborator

Hi @SweetVishnya! Sorry, support for std::filesystem across different compilers and versions is a pain. Your issue is most likely related to this part of the build system. Could you try using target_link_libraries(SymRuntime c++experimental)? It seems that for some reason we can't find the <filesystem> include on your system and therefore fall back to the old experimental version.

@sebastianpoeplau
Copy link
Collaborator

And to answer your question regarding my toolchain, I developed SymCC and SymQEMU on Arch with their default GCC and stdlibc++, and I've also compiled it on Debian 10, Fedora 33, Ubuntu 16.04 and Ubuntu 18.04, using the default toolchain everywhere except on Ubuntu 16.04 (I believe I installed a more recent compiler there).

@SweetVishnya
Copy link
Contributor Author

SweetVishnya commented Jan 27, 2021

I was trying to build with different sorts of compilers on ubuntu 18.04 (including the default toolchain). I will try to modify the build system as you suggested. As soon as we get a working Dockerfile, we can experiment with different distros.

@SweetVishnya
Copy link
Contributor Author

Hi @SweetVishnya! Sorry, support for std::filesystem across different compilers and versions is a pain. Your issue is most likely related to this part of the build system. Could you try using target_link_libraries(SymRuntime c++experimental)? It seems that for some reason we can't find the <filesystem> include on your system and therefore fall back to the old experimental version.

This worked fine for me. Can it be automatically supported in CMake? Something like find_library(STD_CPP_FS stdc++fs)

@sebastianpoeplau
Copy link
Collaborator

Awesome, glad that it worked for you. I'm not sure how easy it is to come up with a generic solution - there is a long discussion of this very issue in the CMake issue tracker, and as far as I can tell they haven't come up with a universally working setup yet.

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