Giter VIP home page Giter VIP logo

Comments (2)

illuhad avatar illuhad commented on June 10, 2024

Can you elaborate why/how stdc++fs is not linked properly? We do have a lengthy cmake module that is supposed to take care of all the different filesystem variants, and should also handle stdc++fs. If special casing is needed, it would be preferable to happen there:
https://github.com/AdaptiveCpp/AdaptiveCpp/blob/develop/cmake/FindFilesystem.cmake

from adaptivecpp.

flying-scotsman avatar flying-scotsman commented on June 10, 2024

Apologies, I hadn't seen that module - it's good and will build the shared object correctly. The problem probably only arises in this special case - GCC 9 system compiler (i.e. C++17's std::filesystem symbols in libstdc++.so.6) and using GCC 8 to compile. I can only assume that the linker discards seemingly unused symbols when linking in libstdc++fs.a, which then again get loaded at runtime from libstdc++.so.6. This potential problem can be avoided by linking libstdc++fs.a in its entirety, which since the archive is small doesn't lead to much bloat.

Line 270 of FindFilesystem.cmake then becomes:
set_property(TARGET std::filesystem APPEND PROPERTY INTERFACE_LINK_LIBRARIES -Wl,--whole-archive stdc++fs -Wl,--no-whole-archive)

from adaptivecpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.