Skip to content
Snippets Groups Projects

Workaround/fixes for cJSON symbol collision

Closed Gijs Peskens requested to merge cjson_workaround into master
1 unresolved thread

Provide 2 new confiration options "disable_json" and "external_cjson" external_cjson is intended ONLY for static libraries that get linked to an application that already has cjson compiled in, so that it may use that. The version of cJSON MUST match the version used in libRIST or at least be ABI compatible. Would fix #111 (closed)

Merge request reports

Pipeline #110556 passed

Pipeline passed for 099fd396 on cjson_workaround

Approval is optional

Closed by Gijs PeskensGijs Peskens 3 years ago (Jul 20, 2021 10:55am UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Sergio Ammirata approved this merge request

    approved this merge request

    • Just to make sure, will the disable_json option have any effect on programs that use librist like ffmpeg, or only on the provided executables in this repo?

    • Author Developer

      It shouldn't, afaik ffmpeg doesn't depend on json output, though other programs might.

      However after sleeping on it I'm inclined to work towards a differing solution, right now we hardcode cJSON as included in the library on Windows, because in the past I had some issues with pkg-config and or cmake not working properly from within the windows build. I'm gonna remove that, update the documentation to reflect the changed build requirements, and if you're open for it I'll submit a PR to your project that builds cJSON as a static library, assuming your project has a working pkg-config/cJSON via msys2.

    • Author Developer

      The solution of building with cJSON via the external option feels to hacky.

      Edited by Gijs Peskens
    • Author Developer

      @sammirata you had some qualms about the disable json option, I think it's still worthwhile to have it. I think we should discuss here

    • hardcode cJSON as included in the library on Windows, because in the past I had some issues with pkg-config and or cmake not working properly from within the windows build. I'm gonna remove that

      I just now realized that msys2 provides a cjson mingw64/mingw-w64-x86_64-cjson 1.7.14-2 package, and it properly provides a pkg-config file

      mingw-w64-x86_64-cjson /mingw64/lib/pkgconfig/libcjson.pc
      mingw-w64-x86_64-cjson /mingw64/lib/pkgconfig/libcjson_utils.pc

      and also provides a static and shared library.

      I guess that means a patch to vulkan-loader will probably need to be submitted since that's where the conflicting cjson symbols are coming from https://github.com/KhronosGroup/Vulkan-Loader

    • Author Developer

      Looking at their cmake files it's hardcoded to build as well :/ (currently without any logic to detect it being present on the system).

      tbh I'm surprised linux distro's even carry it then, since most have a strict policy of not accepting packages with statically compiled in libraries that would be available from the distro itself.

      Edited by Gijs Peskens
    • Please register or sign in to reply
  • Sergio Ammirata unapproved this merge request

    unapproved this merge request

  • closed

Please register or sign in to reply
Loading